mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.5 KiB

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