Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2120 - (show annotations) (download)
Thu May 16 13:19:35 2013 UTC (11 years ago) by niro
File size: 4010 byte(s)
-install missing xinitrc for user station
1 #!/bin/bash
2
3 # set an empty root password
4 chroot ${CDCHROOTDIR} passwd -d root
5
6 # 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 # 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 # install xinitrc
41 echo 'exec startfluxbox' > ${LIVECDROOT}/install-temp/home/station/.xinitrc
42
43 # fix hostname and hosts file
44 echo "alx-i486" > ${LIVECDROOT}/install-temp/etc/hostname
45 echo "127.0.0.1 localhost alx-i486.magellan-linux.de alx-i486" > ${LIVECDROOT}/install-temp/etc/hosts
46 cat >> ${LIVECDROOT}/install-temp/etc/hosts << EOF
47 ::1 ip6-localhost ip6-loopback
48 fe00::0 ip6-localnet
49 ff00::0 ip6-mcastprefix
50 ff02::1 ip6-allnodes
51 ff02::2 ip6-allrouters
52 ff02::3 ip6-allhosts
53 EOF
54
55 # create a default network intface config file
56 cat > ${LIVECDROOT}/install-temp/etc/conf.d/net.eth0 << EOF
57 ONBOOT="yes"
58 NETWORKING="dhcp"
59 EOF
60
61 # fix mage.rc and config.rc
62 updateconfig()
63 {
64 local variables="$@"
65 local value
66 local i
67
68 if [[ -z ${CONFIG} ]]
69 then
70 echo "You must define \$CONFIG varibale first!"
71 return 1
72 fi
73
74 for i in ${variables}
75 do
76 value="$(eval echo \${NEW_${i}})"
77 if [[ ! -z $(grep "^${i}=" ${CONFIG}) ]]
78 then
79 echo "fixing ${i} -> ${value}"
80 sed -i "s|^\(${i}=\).*|\1\"${value}\"|" ${CONFIG}
81 else
82 echo "adding ${i}=${value}"
83 echo "${i}=\"${value}\"" >> ${CONFIG}
84 fi
85 done
86 }
87 NEW_SQL_USER="alx_install"
88 NEW_SQL_PASS="@lx"
89 NEW_SQL_HOST="128.20.41.110"
90 NEW_SQL_DB="alx_web"
91 NEW_SMB_UPDATE_HOST="//${NEW_SQL_HOST}/magetmp"
92 NEW_SMB_UPDATE_USER="${NEW_SQL_USER}"
93 NEW_SMB_UPDATE_PASS="${NEW_SQL_PASS}"
94 NEW_MAGE_MIRRORS="http://${NEW_SQL_HOST}/magellan/alx-060"
95 NEW_MAGE_RSYNC="rsync://${NEW_SQL_HOST}/mage-alx-060"
96 NEW_RSYNC="${NEW_MAGE_RSYNC}"
97 NEW_SMAGE2RSYNC="rsync://${NEW_SQL_HOST}/smage-alx-060"
98 NEW_MIRRORS="${NEW_MAGE_MIRRORS}"
99 NEW_MAGE_UNINSTALL_TIMEOUT="0"
100 CONFIG="${LIVECDROOT}/install-temp/etc/mage.rc"
101 updateconfig RSYNC SMAGE2RSYNC MIRRORS MAGE_UNINSTALL_TIMEOUT
102 CONFIG="${LIVECDROOT}/install-temp/etc/alxconfig-ng/config.rc"
103 updateconfig SQL_USER SQL_PASS SQL_HOST SQL_DB SMB_UPDATE_HOST SMB_UPDATE_USER SMB_UPDATE_PASS MAGE_MIRRORS MAGE_RSYNC
104
105 # create tarball
106 [[ -f ${CDISOROOT}/system/alx-i486.tar.bz2 ]] && rm ${CDISOROOT}/system/alx-i486.tar.bz2
107 ( cd ${LIVECDROOT}/install-temp; tar cvjpf ${CDISOROOT}/system/alx-i486.tar.bz2 ./ | tee log)
108
109 # create images.conf
110 echo "CDIMAGENAME=alx-i486.tar.bz2" > ${CDISOROOT}/system/images.conf
111 echo "TOTALLINES=$(wc -l ${LIVECDROOT}/install-temp/log | cut -d' ' -f1)" >> ${CDISOROOT}/system/images.conf
112
113 # clean up
114 if [[ -d ${LIVECDROOT}/install-temp ]]
115 then
116 rm -rf ${LIVECDROOT}/install-temp
117 fi
118
119 # install usb-install script
120 [ ! -d ${CDISOROOT}/usb-install ] && mkdir ${CDISOROOT}/usb-install
121 [ -f $(get_profile usb-install/usb-install.cmd) ] && cp $(get_profile usb-install)/usb-install.cmd ${CDISOROOT}/usb-install
122 [ -f $(get_profile usb-install/syslinux.exe) ] && cp $(get_profile usb-install)/syslinux.exe ${CDISOROOT}/usb-install
123 [ -f $(get_profile usb-install/syslinux.cfg) ] && cp $(get_profile usb-install)/syslinux.cfg ${CDISOROOT}/usb-install