bootloader_config() { local grubconf="/boot/grub/grub.conf" if [ -e ${INSTALLROOT}/boot/kernelversion ] then source ${INSTALLROOT}/boot/kernelversion else die $"${INSTALLROOT}/boot/kernelversion is missing" fi if [ -e ${INSTALLROOT}/etc/alx_version ] then OLD_ALXVER="${ALXVER}" source ${INSTALLROOT}/etc/alx_version KRNVER="ALX-${ALXVER}" ALXVER="${OLD_ALXVER}" fi [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX" [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd" [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz" # uuid support if is_uuid_supported then my_roothdd="UUID=$(get_uuid ${ROOTHDD})" else my_roothdd="${ROOTHDD}" fi CONFIG="${INSTALLROOT}/${grubconf}" clearconfig addconfig "default 0" addconfig "timeout 3" # using current root password addconfig "password --md5 $(cat ${INSTALLROOT}/etc/shadow | grep root | cut -d: -f2)" addconfig addconfig "# normal boot" addconfig "title ${KRNVER}" addconfig "root (hd0,0)" addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" if is_initrd_supported then addconfig "initrd /boot/${KRNINITRD}" fi addconfig addconfig "# admin boot" addconfig "title ${KRNVER} - Re-run hardware-detection" addconfig "lock" addconfig "root (hd0,0)" addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" if is_initrd_supported then addconfig "initrd /boot/${KRNINITRD}" fi addconfig addconfig "title ${KRNVER} - Reset *all* local settings" addconfig "lock" addconfig "root (hd0,0)" addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" if is_initrd_supported then addconfig "initrd /boot/${KRNINITRD}" fi } bootloader_install() { local CONFIG CONFIG="${INSTALLROOT}/root/.installrc" clearconfig addconfig '/usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null' addconfig 'root (hd0,0)' addconfig 'setup (hd0)' addconfig 'quit' addconfig 'EOF' addconfig 'exit 0' # run installrc chrooted /bin/bash --rcfile /root/.installrc -i rm ${INSTALLROOT}/root/.installrc }