26 |
done |
done |
27 |
} |
} |
28 |
|
|
29 |
## |
# prepare_custom_baseconfig $_OSROOT $_OSHOSTNAME $_OSHOSTDOMAIN |
30 |
# create the install tarball |
prepare_custom_baseconfig() |
|
## |
|
|
create_install_tarball() |
|
31 |
{ |
{ |
32 |
install -d ${LIVECDROOT}/install-temp |
local _OSROOT="$1" |
33 |
install -d ${CDISOROOT}/system |
local _OSHOSTNAME="$2" |
34 |
|
local _OSHOSTDOMAIN="$3" |
35 |
# use all settings from the global config, but the basesystem |
if [[ -z ${_OSROOT} ]] |
|
# has to be the normal install basesystem not for livecds |
|
|
mage-bootstrap \ |
|
|
--root ${LIVECDROOT}/install-temp \ |
|
|
--profile ${MAGE_PROFILE} \ |
|
|
--magerc ${MAGERC} \ |
|
|
--toolchain ${TOOLCHAIN} \ |
|
|
--update-tarball \ |
|
|
--basesystem basesystem || die "bootstrapping target system failed!" |
|
|
|
|
|
## DEV SERVER ## |
|
|
# NEW_MCORE_CONTROL_SERVER="alx-control-dev.dom-aka-nt.intern" |
|
|
# CONFIG="${LIVECDROOT}/install-temp/etc/mcore/mcore.conf" |
|
|
# updateconfig MCORE_CONTROL_SERVER |
|
|
### |
|
|
|
|
|
# fix missing symlink |
|
|
if [ ! -L ${LIVECDROOT}/install-temp/usr/bin/X ] |
|
36 |
then |
then |
37 |
ln -snf Xorg ${LIVECDROOT}/install-temp/usr/bin/X |
echo "no _OSROOT given" |
38 |
|
return 1 |
39 |
|
fi |
40 |
|
if [[ ! -d ${_OSROOT} ]] |
41 |
|
then |
42 |
|
echo "Root dir '${_OSROOT}' does not exist" |
43 |
|
return 1 |
44 |
|
fi |
45 |
|
if [[ -z ${_OSHOSTNAME} ]] |
46 |
|
then |
47 |
|
echo "no _OSHOSTNAME given" |
48 |
|
return 1 |
49 |
|
fi |
50 |
|
if [[ -z ${_OSHOSTDOMAIN} ]] |
51 |
|
then |
52 |
|
echo "no _OSHOSTDOMAIN given" |
53 |
|
return 1 |
54 |
fi |
fi |
55 |
|
|
56 |
# generate a new machine-id on first-boot |
# generate a new machine-id on first-boot |
57 |
:> ${LIVECDROOT}/install-temp/etc/machine-id |
:> ${_OSROOT}/etc/machine-id |
58 |
|
|
59 |
# fix localtime symlink |
# fix localtime symlink |
60 |
ln -snf ../usr/share/zoneinfo/Europe/Berlin ${LIVECDROOT}/install-temp/etc/localtime |
ln -snf ../usr/share/zoneinfo/Europe/Berlin ${_OSROOT}/etc/localtime |
61 |
|
|
62 |
# activate timeserver via dhcp (NTP - option 42) |
# activate timeserver via dhcp (NTP - option 42) |
63 |
CDCHROOTDIR=${LIVECDROOT}/install-temp custom_services add systemd-timesyncd.service |
CDCHROOTDIR=${_OSROOT} custom_services add systemd-timesyncd.service |
64 |
|
|
65 |
# empty root password |
# empty root password |
66 |
chroot ${LIVECDROOT}/install-temp passwd -d root |
chroot ${_OSROOT} passwd -d root |
67 |
|
|
68 |
# empty user password |
# empty user password |
69 |
chroot ${LIVECDROOT}/install-temp passwd -d station |
chroot ${_OSROOT} passwd -d station |
70 |
|
|
71 |
if [ -x ${LIVECDROOT}/install-temp/usr/bin/mcorepasswd ] || |
if [ -x ${_OSROOT}/usr/bin/mcorepasswd ] || |
72 |
[ -L ${LIVECDROOT}/install-temp/usr/bin/mcorepasswd ] |
[ -L ${_OSROOT}/usr/bin/mcorepasswd ] |
73 |
then |
then |
74 |
# add mcored default user |
# add mcored default user |
75 |
( echo "foobar"; sleep 0.1; echo "foobar" ) | chroot ${LIVECDROOT}/install-temp /usr/bin/mcorepasswd mcore |
( echo "foobar"; sleep 0.1; echo "foobar" ) | chroot ${_OSROOT} /usr/bin/mcorepasswd mcore |
76 |
fi |
fi |
77 |
|
|
78 |
# fix hostname and hosts file |
# fix hostname and hosts file |
79 |
echo "alx-${CDOSARCH}" > ${LIVECDROOT}/install-temp/etc/hostname |
echo "${_OSHOSTNAME}" > ${_OSROOT}/etc/hostname |
80 |
echo "127.0.0.1 localhost alx-${CDOSARCH}.magellan-linux.de alx-${CDOSARCH}" > ${LIVECDROOT}/install-temp/etc/hosts |
echo "127.0.0.1 localhost ${_OSHOSTNAME}.${_OSHOSTDOMAIN} ${_OSHOSTNAME}" > ${_OSROOT}/etc/hosts |
81 |
cat >> ${LIVECDROOT}/install-temp/etc/hosts << EOF |
cat >> ${_OSROOT}/etc/hosts << EOF |
82 |
::1 ip6-localhost ip6-loopback |
::1 ip6-localhost ip6-loopback |
83 |
fe00::0 ip6-localnet |
fe00::0 ip6-localnet |
84 |
ff00::0 ip6-mcastprefix |
ff00::0 ip6-mcastprefix |
86 |
ff02::2 ip6-allrouters |
ff02::2 ip6-allrouters |
87 |
ff02::3 ip6-allhosts |
ff02::3 ip6-allhosts |
88 |
EOF |
EOF |
89 |
|
} |
90 |
|
|
91 |
|
# prepare_custom_installertarball $_OSROOT $_TARBALLNAME $_TARBALLTARGET |
92 |
|
prepare_custom_installertarball() |
93 |
|
{ |
94 |
|
local _OSROOT="$1" |
95 |
|
local _TARBALLNAME="$2" |
96 |
|
local _TARBALLTARGET="$3" |
97 |
|
if [[ -z ${_OSROOT} ]] |
98 |
|
then |
99 |
|
echo "no _OSROOT given" |
100 |
|
return 1 |
101 |
|
fi |
102 |
|
if [[ ! -d ${_OSROOT} ]] |
103 |
|
then |
104 |
|
echo "Root dir '${_OSROOT}' does not exist" |
105 |
|
return 1 |
106 |
|
fi |
107 |
|
if [[ -z ${_TARBALLNAME} ]] |
108 |
|
then |
109 |
|
echo "no _TARBALLNAME given" |
110 |
|
return 1 |
111 |
|
fi |
112 |
|
if [[ -z ${_TARBALLTARGET} ]] |
113 |
|
then |
114 |
|
echo "no _TARBALLTARGET given" |
115 |
|
return 1 |
116 |
|
fi |
117 |
|
|
118 |
# create tarball |
# create tarball |
119 |
[[ -f ${CDISOROOT}/system/alx-${CDOSARCH}.tar.bz2 ]] && rm ${CDISOROOT}/system/alx-${CDOSARCH}.tar.bz2 |
[[ -f ${_TARBALLTARGET}/${_TARBALLNAME}.tar.bz2 ]] && rm ${_TARBALLTARGET}/${_TARBALLNAME}.tar.bz2 |
120 |
( cd ${LIVECDROOT}/install-temp; tar cvjpf ${CDISOROOT}/system/alx-${CDOSARCH}.tar.bz2 ./ | tee ${LIVECDROOT}/install.log ) |
( cd ${_OSROOT}; tar cvjpf ${CDISOROOT}/${_TARBALLTARGET}/${_TARBALLNAME}.tar.bz2 ./ | tee ${LIVECDROOT}/${_TARBALLNAME}.log ) |
121 |
|
|
122 |
# create images.conf |
# create images.conf |
123 |
echo "CDIMAGENAME=alx-${CDOSARCH}.tar.bz2" > ${CDISOROOT}/system/images.conf |
echo "CDIMAGENAME=${_TARBALLNAME}.tar.bz2" > ${_TARBALLTARGET}/images.conf |
124 |
echo "TOTALLINES=$(wc -l ${LIVECDROOT}/install.log | cut -d' ' -f1)" >> ${CDISOROOT}/system/images.conf |
echo "TOTALLINES=$(wc -l ${LIVECDROOT}/${_TARBALLNAME}.log | cut -d' ' -f1)" >> ${_TARBALLTARGET}/images.conf |
|
|
|
|
create_netboot_image |
|
125 |
|
|
126 |
# clean up |
# clean up |
127 |
if [[ -d ${LIVECDROOT}/install-temp ]] |
if [[ -z ${SKIP_REMOVE_INSTALLROOT} ]] |
128 |
then |
then |
129 |
rm -r ${LIVECDROOT}/install-temp |
if [[ -d ${_OSROOT} ]] |
130 |
|
then |
131 |
|
rm -r ${_OSROOT} |
132 |
|
fi |
133 |
|
if [[ -f ${LIVECDROOT}/${_TARBALLNAME}.log ]] |
134 |
|
then |
135 |
|
rm ${LIVECDROOT}/${_TARBALLNAME}.log |
136 |
|
fi |
137 |
fi |
fi |
138 |
if [[ -f ${LIVECDROOT}/install.log ]] |
} |
139 |
|
|
140 |
|
## |
141 |
|
# create the install tarball |
142 |
|
## |
143 |
|
create_install_tarball() |
144 |
|
{ |
145 |
|
install -d ${LIVECDROOT}/install-temp |
146 |
|
install -d ${CDISOROOT}/system |
147 |
|
|
148 |
|
# use all settings from the global config, but the basesystem |
149 |
|
# has to be the normal install basesystem not for livecds |
150 |
|
mage-bootstrap \ |
151 |
|
--root ${LIVECDROOT}/install-temp \ |
152 |
|
--profile ${MAGE_PROFILE} \ |
153 |
|
--magerc ${MAGERC} \ |
154 |
|
--toolchain ${TOOLCHAIN} \ |
155 |
|
--update-tarball \ |
156 |
|
--basesystem basesystem || die "bootstrapping target system failed!" |
157 |
|
|
158 |
|
## DEV SERVER ## |
159 |
|
# NEW_MCORE_CONTROL_SERVER="alx-control-dev.dom-aka-nt.intern" |
160 |
|
# CONFIG="${LIVECDROOT}/install-temp/etc/mcore/mcore.conf" |
161 |
|
# updateconfig MCORE_CONTROL_SERVER |
162 |
|
### |
163 |
|
|
164 |
|
# fix missing symlink |
165 |
|
if [ ! -L ${LIVECDROOT}/install-temp/usr/bin/X ] |
166 |
then |
then |
167 |
rm ${LIVECDROOT}/install.log |
ln -snf Xorg ${LIVECDROOT}/install-temp/usr/bin/X |
168 |
fi |
fi |
169 |
|
|
170 |
|
# os config |
171 |
|
prepare_custom_baseconfig "${LIVECDROOT}/install-temp" "alx-${CDOSARCH}" "magellan-linux.de" |
172 |
|
|
173 |
|
# create tarball |
174 |
|
prepare_custom_installertarball "${LIVECDROOT}/install-temp" "alx-${CDOSARCH}" "${CDISOROOT}/system" |
175 |
} |
} |
176 |
|
|
177 |
## |
## |
180 |
create_netboot_image() |
create_netboot_image() |
181 |
{ |
{ |
182 |
install -d ${CDISOROOT}/netboot |
install -d ${CDISOROOT}/netboot |
183 |
install -d ${LIVECDROOT}/network-temp |
install -d ${LIVECDROOT}/netboot-temp |
184 |
|
install -d ${LIVECDROOT}/network-squashfs-temp |
185 |
|
|
186 |
|
# use all settings from the global config, but use netbootsysten as basesystem |
187 |
|
mage-bootstrap \ |
188 |
|
--root ${LIVECDROOT}/netboot-temp \ |
189 |
|
--profile ${MAGE_PROFILE} \ |
190 |
|
--magerc ${MAGERC} \ |
191 |
|
--toolchain ${TOOLCHAIN} \ |
192 |
|
--update-tarball \ |
193 |
|
--basesystem netbootsystem || die "bootstrapping target system failed!" |
194 |
|
|
195 |
|
# os config |
196 |
|
prepare_custom_baseconfig "${LIVECDROOT}/netboot-temp" "alx-${CDOSARCH}" "magellan-linux.de" |
197 |
|
|
198 |
install -d ${LIVECDROOT}/network-temp/{LiveOS,mnt} || die |
# creating netboot image from here on |
199 |
|
install -d ${LIVECDROOT}/network-squashfs-temp/{LiveOS,mnt} || die |
200 |
|
|
201 |
# fix fstab, use the livecd fstab without rootfs and swap |
# fix fstab, use the livecd fstab without rootfs and swap |
202 |
install -m 0644 $(get_profile fstab) ${LIVECDROOT}/install-temp/etc/fstab || die |
install -m 0644 $(get_profile fstab) ${LIVECDROOT}/netboot-temp/etc/fstab || die |
203 |
|
|
204 |
# get the actual size of the chroot |
# get the actual size of the chroot |
205 |
size=$(du -s ${LIVECDROOT}/install-temp | sed 's:^\(.*\)[[:space:]].*:\1:') |
size=$(du -s ${LIVECDROOT}/netboot-temp | sed 's:^\(.*\)[[:space:]].*:\1:') |
206 |
|
|
207 |
# generate a ext3fs file for devicemapper |
# generate a ext3fs file for devicemapper |
208 |
dd if=/dev/zero of=${LIVECDROOT}/network-temp/LiveOS/ext3fs.img bs=1024 count=$(( ${size} + 20000 )) || die |
dd if=/dev/zero of=${LIVECDROOT}/network-squashfs-temp/LiveOS/ext3fs.img bs=1024 count=$(( ${size} + 20000 )) || die |
209 |
# create a filesystem |
# create a filesystem |
210 |
mkfs.ext3 -L "_${CDID}_EXT3" -m 1 -b 1024 -F ${LIVECDROOT}/network-temp/LiveOS/ext3fs.img || die |
mkfs.ext3 -L "_${CDID}_EXT3" -m 1 -b 1024 -F ${LIVECDROOT}/network-squashfs-temp/LiveOS/ext3fs.img || die |
211 |
# set mount_counts and check_intervals to 0 |
# set mount_counts and check_intervals to 0 |
212 |
# set dir_index top, to speed up things with hashed b-trees |
# set dir_index top, to speed up things with hashed b-trees |
213 |
# allow acls too |
# allow acls too |
214 |
tune2fs -c0 -i0 -Odir_index -ouser_xattr,acl ${LIVECDROOT}/network-temp/LiveOS/ext3fs.img || die |
tune2fs -c0 -i0 -Odir_index -ouser_xattr,acl ${LIVECDROOT}/network-squashfs-temp/LiveOS/ext3fs.img || die |
215 |
# strip the journal |
# strip the journal |
216 |
# tune2fs -O^has_journal ${LIVECDROOT}/network-temp/LiveOS/ext3fs.img || die |
# tune2fs -O^has_journal ${LIVECDROOT}/network-squashfs-temp/LiveOS/ext3fs.img || die |
217 |
# fsck after journal removal |
# fsck after journal removal |
218 |
# fsck ${LIVECDROOT}/network-temp/LiveOS/ext3fs.img || die |
# fsck ${LIVECDROOT}/network-squashfs-temp/LiveOS/ext3fs.img || die |
219 |
|
|
220 |
# losetup the device |
# losetup the device |
221 |
loopdev=$(losetup -f) |
loopdev=$(losetup -f) |
222 |
[[ -z ${loopdev} ]] && die "No unused loopdev found. Maybe you want 'modprobe loop'?" |
[[ -z ${loopdev} ]] && die "No unused loopdev found. Maybe you want 'modprobe loop'?" |
223 |
|
|
224 |
# mount the image |
# mount the image |
225 |
losetup ${loopdev} ${LIVECDROOT}/network-temp/LiveOS/ext3fs.img || die |
losetup ${loopdev} ${LIVECDROOT}/network-squashfs-temp/LiveOS/ext3fs.img || die |
226 |
mount ${loopdev} ${LIVECDROOT}/network-temp/mnt || die |
mount ${loopdev} ${LIVECDROOT}/network-squashfs-temp/mnt || die |
227 |
|
|
228 |
# copy everything to the image file and preserve permissions |
# copy everything to the image file and preserve permissions |
229 |
( cd ${LIVECDROOT}/install-temp && tar cpf - . ) | ( cd ${LIVECDROOT}/network-temp/mnt && tar xvpf - ) |
( cd ${LIVECDROOT}/netboot-temp && tar cpf - . ) | ( cd ${LIVECDROOT}/network-squashfs-temp/mnt && tar xvpf - ) |
230 |
sleep 3 |
sleep 3 |
231 |
|
|
232 |
# now umount everything and create the squashfs image |
# now umount everything and create the squashfs image |
233 |
umount ${LIVECDROOT}/network-temp/mnt || die |
umount ${LIVECDROOT}/network-squashfs-temp/mnt || die |
234 |
losetup -d ${loopdev} || die |
losetup -d ${loopdev} || die |
235 |
# remove mount to not ending up in the squashfs image |
# remove mount to not ending up in the squashfs image |
236 |
if [[ -d ${LIVECDROOT}/network-temp/mnt ]] |
if [[ -d ${LIVECDROOT}/network-squashfs-temp/mnt ]] |
237 |
then |
then |
238 |
rm -r ${LIVECDROOT}/network-temp/mnt || die |
rm -r ${LIVECDROOT}/network-squashfs-temp/mnt || die |
239 |
fi |
fi |
240 |
mksquashfs ${LIVECDROOT}/network-temp ${CDISOROOT}/netboot/squashfs.img || die |
mksquashfs ${LIVECDROOT}/network-squashfs-temp ${CDISOROOT}/netboot/squashfs.img || die |
241 |
|
|
242 |
# copy kernel, bootloader and create initramfs to isoroot/netboot |
# copy kernel, bootloader and create initramfs to isoroot/netboot |
243 |
install -d ${CDISOROOT}/netboot || die |
install -d ${CDISOROOT}/netboot || die |
247 |
# initrd |
# initrd |
248 |
install -d ${CDCHROOTDIR}/etc/dracut.conf.d || die |
install -d ${CDCHROOTDIR}/etc/dracut.conf.d || die |
249 |
echo 'add_dracutmodules+=" livenet busybox "' > ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf || die |
echo 'add_dracutmodules+=" livenet busybox "' > ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf || die |
|
#echo 'omit_dracutmodules+=" systemd plymouth mcored "' >> ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf || die |
|
|
# use plymouth to get all kms modules, but boot with nosplash as default to fix some Xorg issues |
|
|
#echo 'omit_dracutmodules+=" systemd mcored "' >> ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf || die |
|
250 |
echo 'omit_dracutmodules+=" mcored "' >> ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf || die |
echo 'omit_dracutmodules+=" mcored "' >> ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf || die |
251 |
echo 'hostonly="no"' >> ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf || die |
echo 'hostonly="no"' >> ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf || die |
252 |
# install dracut-dev package to have all modules |
# install dracut-dev package to have all modules |
256 |
mv ${CDISOROOT}/isolinux/initrd.gz ${CDISOROOT}/netboot/ || die |
mv ${CDISOROOT}/isolinux/initrd.gz ${CDISOROOT}/netboot/ || die |
257 |
# fix initrd permissions |
# fix initrd permissions |
258 |
chmod 0644 ${CDISOROOT}/netboot/initrd.gz || die |
chmod 0644 ${CDISOROOT}/netboot/initrd.gz || die |
|
# custom_packages uninstall "dracut-dev curl curl-dev" || die |
|
259 |
if [ -e ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf ] |
if [ -e ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf ] |
260 |
then |
then |
261 |
rm ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf |
rm ${CDCHROOTDIR}/etc/dracut.conf.d/03-netboot.conf |
283 |
[ -f $(get_profile index.msg) ] && install -m0644 $(get_profile index.msg) ${CDISOROOT}/netboot/lpxelinux/ |
[ -f $(get_profile index.msg) ] && install -m0644 $(get_profile index.msg) ${CDISOROOT}/netboot/lpxelinux/ |
284 |
|
|
285 |
# final cleanup |
# final cleanup |
286 |
if [[ -d ${LIVECDROOT}/network-temp ]] |
if [[ -z ${SKIP_REMOVE_INSTALLROOT} ]] |
287 |
then |
then |
288 |
rm -r ${LIVECDROOT}/network-temp || die |
if [[ -d ${LIVECDROOT}/network-squasfs-temp ]] |
289 |
|
then |
290 |
|
rm -r ${LIVECDROOT}/network-squasfs-temp || die |
291 |
|
fi |
292 |
|
if [[ -d ${LIVECDROOT}/netboot-temp ]] |
293 |
|
then |
294 |
|
rm -r ${LIVECDROOT}/netboot-temp |
295 |
|
fi |
296 |
fi |
fi |
297 |
} |
} |
298 |
|
|
312 |
--update-tarball \ |
--update-tarball \ |
313 |
--basesystem serversystem || die "bootstrapping target system failed!" |
--basesystem serversystem || die "bootstrapping target system failed!" |
314 |
|
|
|
# generate a new machine-id on first-boot |
|
|
:> ${LIVECDROOT}/server-temp/etc/machine-id |
|
315 |
|
|
316 |
# enable getty1 |
# enable getty1 |
317 |
install -d ${LIVECDROOT}/server-temp/etc/systemd/system/getty.target.wants |
install -d ${LIVECDROOT}/server-temp/etc/systemd/system/getty.target.wants |
320 |
# be more verbose |
# be more verbose |
321 |
sed -i 's:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1"rd.info":' ${LIVECDROOT}/server-temp/etc/conf.d/grub |
sed -i 's:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1"rd.info":' ${LIVECDROOT}/server-temp/etc/conf.d/grub |
322 |
|
|
|
# fix localtime symlink |
|
|
ln -snf ../usr/share/zoneinfo/Europe/Berlin ${LIVECDROOT}/server-temp/etc/localtime |
|
|
|
|
|
# activate timeserver via dhcp (NTP - option 42) |
|
|
CDCHROOTDIR=${LIVECDROOT}/server-temp custom_services add systemd-timesyncd.service |
|
|
|
|
|
# empty root password |
|
|
chroot ${LIVECDROOT}/server-temp passwd -d root |
|
|
|
|
|
# empty user password |
|
|
chroot ${LIVECDROOT}/server-temp passwd -d station |
|
|
|
|
|
if [ -x ${LIVECDROOT}/server-temp/usr/bin/mcorepasswd ] || |
|
|
[ -L ${LIVECDROOT}/server-temp/usr/bin/mcorepasswd ] |
|
|
then |
|
|
# add mcored default user |
|
|
( echo "foobar"; sleep 0.1; echo "foobar" ) | chroot ${LIVECDROOT}/server-temp /usr/bin/mcorepasswd mcore |
|
|
fi |
|
|
|
|
323 |
# remove phpmyadmin configuration directory |
# remove phpmyadmin configuration directory |
324 |
if [ -d ${LIVECDROOT}/server-temp/usr/share/phpmyadmin/config ] |
if [ -d ${LIVECDROOT}/server-temp/usr/share/phpmyadmin/config ] |
325 |
then |
then |
326 |
rm -r ${LIVECDROOT}/server-temp/usr/share/phpmyadmin/config |
rm -r ${LIVECDROOT}/server-temp/usr/share/phpmyadmin/config |
327 |
fi |
fi |
328 |
|
|
329 |
# fix hostname and hosts file |
# os config |
330 |
echo "alx-svr-${CDOSARCH}" > ${LIVECDROOT}/server-temp/etc/hostname |
prepare_custom_baseconfig "${LIVECDROOT}/server-temp" "alx-svr-${CDOSARCH}" "magellan-linux.de" |
331 |
echo "127.0.0.1 localhost alx-svr-${CDOSARCH}.magellan-linux.de alx-svr-${CDOSARCH}" > ${LIVECDROOT}/server-temp/etc/hosts |
|
332 |
# fix certificate issues with mcored (common name of cert issuer) and >php-5.4 |
# fix certificate issues with mcored (common name of cert issuer) and >php-5.4 |
333 |
echo "127.0.0.1 mcored" >> ${LIVECDROOT}/server-temp/etc/hosts |
echo "127.0.0.1 mcored" >> ${LIVECDROOT}/server-temp/etc/hosts |
|
cat >> ${LIVECDROOT}/server-temp/etc/hosts << EOF |
|
|
::1 ip6-localhost ip6-loopback |
|
|
fe00::0 ip6-localnet |
|
|
ff00::0 ip6-mcastprefix |
|
|
ff02::1 ip6-allnodes |
|
|
ff02::2 ip6-allrouters |
|
|
ff02::3 ip6-allhosts |
|
|
EOF |
|
334 |
|
|
335 |
# create tarball |
# create tarball |
336 |
[[ -f ${CDISOROOT}/server/alx-svr-${CDOSARCH}.tar.bz2 ]] && rm ${CDISOROOT}/server/alx-svr-${CDOSARCH}.tar.bz2 |
prepare_custom_installertarball "${LIVECDROOT}/server-temp" "alx-svr-${CDOSARCH}" "${CDISOROOT}/server" |
|
( cd ${LIVECDROOT}/server-temp; tar cvjpf ${CDISOROOT}/server/alx-svr-${CDOSARCH}.tar.bz2 ./ | tee ${LIVECDROOT}/server.log ) |
|
|
|
|
|
# create images.conf |
|
|
echo "CDIMAGENAME=alx-svr-${CDOSARCH}.tar.bz2" > ${CDISOROOT}/server/images.conf |
|
|
echo "TOTALLINES=$(wc -l ${LIVECDROOT}/server.log | cut -d' ' -f1)" >> ${CDISOROOT}/server/images.conf |
|
|
|
|
|
# clean up |
|
|
if [[ -d ${LIVECDROOT}/server-temp ]] |
|
|
then |
|
|
rm -r ${LIVECDROOT}/server-temp |
|
|
fi |
|
|
if [[ -f ${LIVECDROOT}/server.log ]] |
|
|
then |
|
|
rm ${LIVECDROOT}/server.log |
|
|
fi |
|
337 |
} |
} |
338 |
|
|
339 |
# set an empty root password |
# set an empty root password |
362 |
# stop here if the user don't want to create the install tarball |
# stop here if the user don't want to create the install tarball |
363 |
[[ -n ${SKIP_CREATE_INSTALL_TARBALL} ]] || create_install_tarball |
[[ -n ${SKIP_CREATE_INSTALL_TARBALL} ]] || create_install_tarball |
364 |
|
|
365 |
|
# stop here if the user don't want to create the netboot image |
366 |
|
[[ -n ${SKIP_CREATE_NETBOOT_TARBALL} ]] || create_netboot_image |
367 |
|
|
368 |
# stop here if the user don't want to create the server tarball |
# stop here if the user don't want to create the server tarball |
369 |
[[ -n ${SKIP_CREATE_SERVER_TARBALL} ]] || create_server_tarball |
[[ -n ${SKIP_CREATE_SERVER_TARBALL} ]] || create_server_tarball |
370 |
|
|