Magellan Linux

Annotation of /trunk/mlivecdbuild/profiles/alx-0_6_branch/prepare_custom

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1818 - (hide annotations) (download)
Fri May 4 08:23:02 2012 UTC (12 years ago) by niro
File size: 3915 byte(s)
-added usbstick installation script and tools
1 niro 1409 #!/bin/bash
2    
3     # set an empty root password
4     chroot ${CDCHROOTDIR} passwd -d root
5    
6 niro 1524 # disable splash X11 vt change and set splash to be always verbose
7     if [[ -f ${CDCHROOTDIR}/etc/splash/splash.conf ]]
8     then
9     sed -i -e 's:^\(SPLASH_X11_TTY=.*\):#\1:' \
10     -e 's:^\(SPLASH_MODE=\).*:\1\"verbose\":' \
11     ${CDCHROOTDIR}/etc/splash/splash.conf
12     fi
13    
14 niro 1409 # stop here if the user don't want to create the install tarball
15     [[ ! -z ${SKIP_CREATE_INSTALL_TARBALL} ]] && exit 0
16    
17    
18     ##
19     # create the install tarball
20     ##
21    
22     install -d ${LIVECDROOT}/install-temp
23     install -d ${CDISOROOT}/system
24    
25     # use all settings from the global config, but the basesystem
26     # has to be the normal install basesystem not for livecds
27     mage-bootstrap \
28     --root ${LIVECDROOT}/install-temp \
29     --profile ${MAGE_PROFILE} \
30     --magerc ${MAGERC} \
31     --toolchain ${TOOLCHAIN} \
32     --basesystem basesystem || die "bootstrapping target system failed!"
33    
34     # set an empty root password for the install system too
35     chroot ${LIVECDROOT}/install-temp passwd -d root
36    
37     # add user station with empty password
38     chroot ${LIVECDROOT}/install-temp adduser -G users -h /home/station -s /bin/bash -D station
39    
40     # fix hostname and hosts file
41     echo "alx-i486" > ${LIVECDROOT}/install-temp/etc/hostname
42     echo "127.0.0.1 localhost alx-i486.magellan-linux.de alx-i486" > ${LIVECDROOT}/install-temp/etc/hosts
43     cat >> ${LIVECDROOT}/install-temp/etc/hosts << EOF
44     ::1 ip6-localhost ip6-loopback
45     fe00::0 ip6-localnet
46     ff00::0 ip6-mcastprefix
47     ff02::1 ip6-allnodes
48     ff02::2 ip6-allrouters
49     ff02::3 ip6-allhosts
50     EOF
51    
52     # create a default network intface config file
53     cat > ${LIVECDROOT}/install-temp/etc/conf.d/net.eth0 << EOF
54     ONBOOT="yes"
55     NETWORKING="dhcp"
56     EOF
57    
58 niro 1421 # fix mage.rc and config.rc
59     updateconfig()
60     {
61     local variables="$@"
62     local value
63     local i
64 niro 1409
65 niro 1421 if [[ -z ${CONFIG} ]]
66     then
67     echo "You must define \$CONFIG varibale first!"
68     return 1
69     fi
70    
71     for i in ${variables}
72     do
73     value="$(eval echo \${NEW_${i}})"
74     if [[ ! -z $(grep "^${i}=" ${CONFIG}) ]]
75     then
76     echo "fixing ${i} -> ${value}"
77     sed -i "s|^\(${i}=\).*|\1\"${value}\"|" ${CONFIG}
78     else
79     echo "adding ${i}=${value}"
80     echo "${i}=\"${value}\"" >> ${CONFIG}
81     fi
82     done
83     }
84     NEW_SQL_USER="alx_install"
85     NEW_SQL_PASS="@lx"
86     NEW_SQL_HOST="128.20.41.110"
87     NEW_SQL_DB="alx_web"
88     NEW_SMB_UPDATE_HOST="//${NEW_SQL_HOST}/magetmp"
89     NEW_SMB_UPDATE_USER="${NEW_SQL_USER}"
90     NEW_SMB_UPDATE_PASS="${NEW_SQL_PASS}"
91     NEW_MAGE_MIRRORS="http://${NEW_SQL_HOST}/magellan/alx-060"
92     NEW_MAGE_RSYNC="rsync://${NEW_SQL_HOST}/mage-alx-060"
93     NEW_RSYNC="${NEW_MAGE_RSYNC}"
94     NEW_SMAGE2RSYNC="rsync://${NEW_SQL_HOST}/smage-alx-060"
95     NEW_MIRRORS="${NEW_MAGE_MIRRORS}"
96     NEW_MAGE_UNINSTALL_TIMEOUT="0"
97     CONFIG="${LIVECDROOT}/install-temp/etc/mage.rc"
98     updateconfig RSYNC SMAGE2RSYNC MIRRORS MAGE_UNINSTALL_TIMEOUT
99     CONFIG="${LIVECDROOT}/install-temp/etc/alxconfig-ng/config.rc"
100     updateconfig SQL_USER SQL_PASS SQL_HOST SQL_DB SMB_UPDATE_HOST SMB_UPDATE_USER SMB_UPDATE_PASS MAGE_MIRRORS MAGE_RSYNC
101    
102 niro 1409 # create tarball
103     [[ -f ${CDISOROOT}/system/alx-i486.tar.bz2 ]] && rm ${CDISOROOT}/system/alx-i486.tar.bz2
104     ( cd ${LIVECDROOT}/install-temp; tar cvjpf ${CDISOROOT}/system/alx-i486.tar.bz2 ./ | tee log)
105    
106     # create images.conf
107     echo "CDIMAGENAME=alx-i486.tar.bz2" > ${CDISOROOT}/system/images.conf
108     echo "TOTALLINES=$(wc -l ${LIVECDROOT}/install-temp/log | cut -d' ' -f1)" >> ${CDISOROOT}/system/images.conf
109    
110     # clean up
111     if [[ -d ${LIVECDROOT}/install-temp ]]
112     then
113     rm -rf ${LIVECDROOT}/install-temp
114     fi
115 niro 1818
116     # install usb-install script
117     [ ! -d ${CDISOROOT}/usb-install ] && mkdir ${CDISOROOT}/usb-install
118     [ -f $(get_profile usb-install/usb-install.cmd) ] && cp $(get_profile usb-install)/usb-install.cmd ${CDISOROOT}/usb-install
119     [ -f $(get_profile usb-install/syslinux.exe) ] && cp $(get_profile usb-install)/syslinux.exe ${CDISOROOT}/usb-install
120     [ -f $(get_profile usb-install/syslinux.cfg) ] && cp $(get_profile usb-install)/syslinux.cfg ${CDISOROOT}/usb-install