#!/bin/bash # set an empty root password chroot ${CDCHROOTDIR} passwd -d root # install a custom boot-duration matching this livecd install -d ${CDCHROOTDIR}/var/lib/plymouth || die install -m 0644 $(get_profile boot-duration.livecd) ${CDCHROOTDIR}/var/lib/plymouth/boot-duration || die # disable splash X11 vt change and set splash to be always verbose #if [[ -f ${CDCHROOTDIR}/etc/splash/splash.conf ]] #then # sed -i -e 's:^\(SPLASH_X11_TTY=.*\):#\1:' \ # -e 's:^\(SPLASH_MODE=\).*:\1\"verbose\":' \ # ${CDCHROOTDIR}/etc/splash/splash.conf #fi # stop here if the user don't want to create the install tarball [[ ! -z ${SKIP_CREATE_INSTALL_TARBALL} ]] && exit 0 ## # create the install tarball ## install -d ${LIVECDROOT}/install-temp install -d ${CDISOROOT}/system # use all settings from the global config, but the basesystem # 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!" # set an empty root password for the install system too chroot ${LIVECDROOT}/install-temp passwd -d root # add user station with empty password chroot ${LIVECDROOT}/install-temp adduser -G users -h /home/station -s /bin/bash -D station # fix hostname and hosts file echo "alx-i486" > ${LIVECDROOT}/install-temp/etc/hostname echo "127.0.0.1 localhost alx-i486.magellan-linux.de alx-i486" > ${LIVECDROOT}/install-temp/etc/hosts cat >> ${LIVECDROOT}/install-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 # create a default network interface config file cat > ${LIVECDROOT}/install-temp/etc/conf.d/net.eth0 << EOF ONBOOT="yes" NETWORKING="dhcp" EOF # fix mage.rc and config.rc updateconfig() { local variables="$@" local value local i if [[ -z ${CONFIG} ]] then echo "You must define \$CONFIG varibale first!" return 1 fi for i in ${variables} do value="$(eval echo \${NEW_${i}})" if [[ ! -z $(grep "^${i}=" ${CONFIG}) ]] then echo "fixing ${i} -> ${value}" sed -i "s|^\(${i}=\).*|\1\"${value}\"|" ${CONFIG} else echo "adding ${i}=${value}" echo "${i}=\"${value}\"" >> ${CONFIG} fi done } NEW_SQL_USER="alx_install" NEW_SQL_PASS="@lx" NEW_SQL_HOST="128.20.41.110" NEW_SQL_DB="alx_web" NEW_SMB_UPDATE_HOST="//${NEW_SQL_HOST}/magetmp" NEW_SMB_UPDATE_USER="${NEW_SQL_USER}" NEW_SMB_UPDATE_PASS="${NEW_SQL_PASS}" NEW_MAGE_MIRRORS="http://${NEW_SQL_HOST}/magellan/alx-070" NEW_MAGE_RSYNC="rsync://${NEW_SQL_HOST}/mage-alx-070" NEW_RSYNC="${NEW_MAGE_RSYNC}" NEW_SMAGE2RSYNC="rsync://${NEW_SQL_HOST}/smage-alx-070" NEW_MIRRORS="${NEW_MAGE_MIRRORS}" NEW_MAGE_UNINSTALL_TIMEOUT="0" CONFIG="${LIVECDROOT}/install-temp/etc/mage.rc" updateconfig RSYNC SMAGE2RSYNC MIRRORS MAGE_UNINSTALL_TIMEOUT CONFIG="${LIVECDROOT}/install-temp/etc/alxconfig-ng/config.rc" updateconfig SQL_USER SQL_PASS SQL_HOST SQL_DB SMB_UPDATE_HOST SMB_UPDATE_USER SMB_UPDATE_PASS MAGE_MIRRORS MAGE_RSYNC # create tarball [[ -f ${CDISOROOT}/system/alx-i486.tar.bz2 ]] && rm ${CDISOROOT}/system/alx-i486.tar.bz2 ( cd ${LIVECDROOT}/install-temp; tar cvjpf ${CDISOROOT}/system/alx-i486.tar.bz2 ./ | tee log) # create images.conf echo "CDIMAGENAME=alx-i486.tar.bz2" > ${CDISOROOT}/system/images.conf echo "TOTALLINES=$(wc -l ${LIVECDROOT}/install-temp/log | cut -d' ' -f1)" >> ${CDISOROOT}/system/images.conf # clean up if [[ -d ${LIVECDROOT}/install-temp ]] then rm -rf ${LIVECDROOT}/install-temp fi # install usb-install script [ ! -d ${CDISOROOT}/usb-install ] && mkdir ${CDISOROOT}/usb-install [ -f $(get_profile usb-install/usb-install.cmd) ] && cp $(get_profile usb-install)/usb-install.cmd ${CDISOROOT}/usb-install [ -f $(get_profile usb-install/syslinux.exe) ] && cp $(get_profile usb-install)/syslinux.exe ${CDISOROOT}/usb-install [ -f $(get_profile usb-install/syslinux.cfg) ] && cp $(get_profile usb-install)/syslinux.cfg ${CDISOROOT}/usb-install