#!/bin/sh # # ROCK Linux: /etc/setup.d/10-aboot # # Read /etc/setup.d/00-general for details about ROCK Linux setup scripts. # case "$1" in setup) ;; [a-z]*) exit 0 ;; *) echo "Usage: $0 setup" ; exit 1 ;; esac echo -n 'WARNING: This script is for testing purposes only! No guarantee of correct work!\n\n' echo -n 'YOU HAVE BEEN WARNED!!!\n\n' echo -n 'Would you like to run the aboot setup script now? (YES/no) ' read in ; [[ "$in" == [nN]* ]] && exit 0 ; unset in echo -e '\n==> ABOOT configuration <==' echo -n 'Would you like me to create a /etc/aboot.conf file? (YES/no) ' read in case "$in" in [nN]*) echo ; exit ;; *) rootdev="`grep '^/dev/.* / ' /etc/mtab | tr ' ' '\t' | cut -f1`" bootdev="`grep '^/dev/.* /boot ' /etc/mtab | tr ' ' '\t' | cut -f1`" # check, ob rootdev != bootdev if [ $rootdev != $bootdev ] ; then notice="# NOTICE: You have a /boot partition. This means\ that\n# all kernel paths are relative to /boot/" kernelpath="1:`echo -e $bootdev | sed 's/.*part//;'`/vmlinux" fi echo { echo -e '# aboot configuration file' echo -e $notice'\n' echo -e $kernelpath' root='$rootdev'\n' } | tee /etc/aboot.conf.test | sed 's,^,> ,' esac echo -n 'Would you like me to install ABOOT now in the MBR? (YES/no) ' read in ; echo case "$in" in [nN]*) ;; *) bootdisc=`echo -e $bootdev | sed 's/part[0-9]$//;'`"disc" switeboot -c`echo -e $bootdev | sed 's/.*part//;'` $bootdisc bootlx abootconf $bootdisc ;; esac