Magellan Linux

Contents of /trunk/mlivecdbuild/profiles/alx-0_7_branch/prepare_custom

Parent Directory Parent Directory | Revision Log Revision Log


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