Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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