Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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