Dash:
[t2.git] / package / boot / aboot / aboot.setup
blob6f63329377709ca722a2425c9fbd4fe1f893452d
1 #!/bin/sh
3 # ROCK Linux: /etc/setup.d/10-aboot
5 # Read /etc/setup.d/00-general for details about ROCK Linux setup scripts.
8 case "$1" in
9 setup)
11 [a-z]*)
12 exit 0 ;;
14 echo "Usage: $0 setup" ; exit 1 ;;
15 esac
17 echo -n 'WARNING: This script is for testing purposes only! No guarantee of correct work!\n\n'
18 echo -n 'YOU HAVE BEEN WARNED!!!\n\n'
20 echo -n 'Would you like to run the aboot setup script now? (YES/no) '
21 read in ; [[ "$in" == [nN]* ]] && exit 0 ; unset in
23 echo -e '\n==> ABOOT configuration <=='
25 echo -n 'Would you like me to create a /etc/aboot.conf file? (YES/no) '
26 read in
27 case "$in" in
28 [nN]*) echo ; exit ;;
30 rootdev="`grep '^/dev/.* / ' /etc/mtab | tr ' ' '\t' | cut -f1`"
31 bootdev="`grep '^/dev/.* /boot ' /etc/mtab | tr ' ' '\t' | cut -f1`"
34 # check, ob rootdev != bootdev
35 if [ $rootdev != $bootdev ] ; then
36 notice="# NOTICE: You have a /boot partition. This means\
37 that\n# all kernel paths are relative to /boot/"
38 kernelpath="1:`echo -e $bootdev | sed 's/.*part//;'`/vmlinux"
42 echo
43 { echo -e '# aboot configuration file'
44 echo -e $notice'\n'
45 echo -e $kernelpath' root='$rootdev'\n'
47 } | tee /etc/aboot.conf.test | sed 's,^,> ,'
48 esac
50 echo -n 'Would you like me to install ABOOT now in the MBR? (YES/no) '
51 read in ; echo
52 case "$in" in
53 [nN]*) ;;
55 bootdisc=`echo -e $bootdev | sed 's/part[0-9]$//;'`"disc"
57 switeboot -c`echo -e $bootdev | sed 's/.*part//;'` $bootdisc bootlx
58 abootconf $bootdisc
60 esac