[147] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | ## Author: Jazz Yao-Tsung Wang <jazzwang.tw@gmail.com> |
---|
| 4 | ## |
---|
| 5 | ## v0.1 - 2010-05-23 - initial version |
---|
| 6 | ## |
---|
| 7 | ## Reference: |
---|
| 8 | ## [1] http://live.debian.net/manual/html/packages.html#package-sources |
---|
| 9 | ## [2] /opt/drbl/sbin/create-drbl-live (from drbl - http://drbl.sf.net) |
---|
| 10 | ## [3] man lh_config and lh_build |
---|
| 11 | |
---|
[150] | 12 | ## Check root privileges |
---|
| 13 | if [ `id -u` != 0 ]; then |
---|
| 14 | echo "[ERROR] This script must run as root or sudo !!" |
---|
| 15 | exit |
---|
| 16 | fi |
---|
| 17 | |
---|
[149] | 18 | ## Check current distribution is debian-like or not |
---|
| 19 | if [ ! -f /etc/debian_version ]; then |
---|
| 20 | echo "[ERROR] This script must run on Debian or Ubuntu !!" |
---|
| 21 | exit |
---|
| 22 | fi |
---|
| 23 | |
---|
| 24 | ## If /usr/bin/lh is not found, install live-helper package first!! |
---|
| 25 | if [ ! -x /usr/bin/lh ]; then |
---|
| 26 | echo "[WARN] live-helper not found!! I will install it first for you!!" |
---|
| 27 | apt-get install -y live-helper |
---|
| 28 | fi |
---|
| 29 | |
---|
| 30 | ## [MEMO] following parameter is for live-helper ........... |
---|
| 31 | ### -b|--binary-images iso|net|tar|usb-hdd |
---|
| 32 | ### --binary-filesystem fat16|fat32|ext2 |
---|
| 33 | ### --binary-indices enabled|disabled |
---|
| 34 | ### --bootstrap-config FILE |
---|
| 35 | ### -f|--bootstrap-flavour minimal|standard |
---|
| 36 | ### --cache enabled|disabled |
---|
| 37 | ### --cache-indices enabled|disabled |
---|
| 38 | ### --categories CATEGORY|"CATEGORIES" |
---|
| 39 | ### -d|--distribution CODENAME |
---|
| 40 | ### --hostname NAME |
---|
| 41 | ### -m|--mirror-bootstrap URL |
---|
| 42 | ### --mirror-chroot URL |
---|
[147] | 43 | ### --mirror-chroot-security URL |
---|
[149] | 44 | ### --username NAME |
---|
| 45 | |
---|
| 46 | lh clean --binary |
---|
| 47 | # [Note] option '--categories' is only avaible at live-helper 1.0.3-2 |
---|
[150] | 48 | lh config -b iso --binary-indices disabled -f minimal --cache enabled --cache-indices enabled -d lenny --hostname hadoop -m http://free.nchc.org.tw/debian --mirror-chroot http://free.nchc.org.tw/debian --mirror-chroot-security http://free.nchc.org.tw/debian-security --mirror-binary http://free.nchc.org.tw/debian --mirror-binary-security http://free.nchc.org.tw/debian-security --username hadoop --packages 'net-tools wireless-tools ssh sudo xserver-xorg-video-vesa xinit xfonts-base x11-xserver-utils xterm openbox iceweasel dhcp3-client' -k 686 |
---|
[149] | 49 | |
---|
[151] | 50 | cp chroot-hook/* config/chroot_local-hooks/ |
---|
[149] | 51 | |
---|
| 52 | lh build |
---|
| 53 | |
---|
| 54 | if [ -f binary.iso ]; then |
---|
[150] | 55 | filename=`date +"hadoop-live-%y%m%d%H%M"` |
---|
[151] | 56 | mv binary.iso "$filename.iso" |
---|
| 57 | mv binary.packages "$filename.packages" |
---|
[149] | 58 | fi |
---|