--- alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh 2008/06/27 23:32:03 526 +++ alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh 2009/08/04 18:09:51 1123 @@ -1,6 +1,6 @@ #!/bin/sh # -# $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.12 2008-06-27 23:32:03 niro Exp $ +# $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.15 2008-06-28 00:37:45 niro Exp $ # # AutoSta_LX Installation Script # @@ -21,7 +21,7 @@ ######################################## ### System/Config Version -VERSION="0.3" +VERSION="0.3.2" TITLE="alxinstall-ng - ${VERSION}" CDPATH="/mnt/cdrom" @@ -402,15 +402,35 @@ [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX" [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd" - echo "default 0" > ${INSTALLPATH}/boot/grub/grub.conf || die - echo "timeout 0" >> ${INSTALLPATH}/boot/grub/grub.conf ||die + local grubconf=${INSTALLPATH}/boot/grub/grub.conf + : > ${grubconf} || die + echo "default 0" >> ${grubconf} || die + echo "timeout 3" >> ${grubconf} || die + # using current root password + echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} || die + + echo >> ${grubconf} || die + echo "# normal boot" >> ${grubconf} || die + echo "title ${KRNVER}" >> ${grubconf} || die + echo "root (hd0,0)" >> ${grubconf} || die + echo "kernel /boot/vmlinuz root=${ROOTHDD} quiet" >> ${grubconf} || die + echo "initrd /boot/initrd" >> ${grubconf} || die + + echo >> ${grubconf} || die + echo "# admin boot" >> ${grubconf} || die + echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die + echo "lock" >> ${grubconf} || die + echo "root (hd0,0)" >> ${grubconf} || die + echo "kernel /boot/vmlinuz root=${ROOTHDD} quiet hardware-auto-detection" >> ${grubconf} || die + echo "initrd /boot/initrd" >> ${grubconf} || die + + echo >> ${grubconf} || die + echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die + echo "lock" >> ${grubconf} || die + echo "root (hd0,0)" >> ${grubconf} || die + echo "kernel /boot/vmlinuz root=${ROOTHDD} quiet alx-reset-settings" >> ${grubconf} || die + echo "initrd /boot/initrd" >> ${grubconf} || die - echo -e "\ntitle=${KRNVER}" >> ${INSTALLPATH}/boot/grub/grub.conf || die - echo "root (hd0,0)" >> ${INSTALLPATH}/boot/grub/grub.conf || die - - echo "kernel /boot/vmlinuz root=${ROOTHDD} quiet" >> ${INSTALLPATH}/boot/grub/grub.conf || die - echo "initrd /boot/initrd" >> ${INSTALLPATH}/boot/grub/grub.conf || die - # bootsector schreiben chrooted schreiben (lfs/magellan) cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null @@ -418,8 +438,25 @@ setup (hd0) quit EOF -echo "MODULES=\"ext3 amd74xx piix sis5513 via82cxxx\" > /etc/conf.d/mkinitrd -mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") +exit 0 +CHROOTEOF + + ## enters chroot + mount -t proc proc ${INSTALLPATH}/proc + mount -t sysfs sysfs ${INSTALLPATH}/sys + mount -o bind /dev ${INSTALLPATH}/dev + chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i + umount ${INSTALLPATH}/proc + umount ${INSTALLPATH}/sys + umount ${INSTALLPATH}/dev + rm ${INSTALLPATH}/root/.bashrc +} + +install_mkinitrd_chroot() +{ + cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF +echo "MODULES=\"ext3 amd74xx piix sis5513 via82cxxx\"" > /etc/conf.d/mkinitrd +mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null exit 0 CHROOTEOF @@ -442,6 +479,9 @@ echo -e "${SWAPHDD}\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die + + # install network config skeleton + install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die } install_system_settings_flash() @@ -491,6 +531,7 @@ dialog_install_settings sleep 1 install_system_settings + install_mkinitrd_chroot install_umount_rootfs dialog_install_successful } @@ -511,6 +552,7 @@ dialog_install_settings sleep 1 install_system_settings_flash + install_mkinitrd_chroot install_umount_rootfs_flash dialog_install_successful }