OpenSDE Packages Database (without history before r20070)
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.

76 lines
2.1 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: package/.../aboot/aboot.setup
  6. # Copyright (C) 2006 The OpenSDE Project
  7. # Copyright (C) 2006 The T2 SDE Project
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. #
  17. # ROCK Linux: /etc/setup.d/10-aboot
  18. #
  19. # Read /etc/setup.d/00-general for details about ROCK Linux setup scripts.
  20. #
  21. case "$1" in
  22. setup)
  23. ;;
  24. [a-z]*)
  25. exit 0 ;;
  26. *)
  27. echo "Usage: $0 setup" ; exit 1 ;;
  28. esac
  29. echo -n 'WARNING: This script is for testing purposes only! No guarantee of correct work!\n\n'
  30. echo -n 'YOU HAVE BEEN WARNED!!!\n\n'
  31. echo -n 'Would you like to run the aboot setup script now? (YES/no) '
  32. read in ; [[ "$in" == [nN]* ]] && exit 0 ; unset in
  33. echo -e '\n==> ABOOT configuration <=='
  34. echo -n 'Would you like me to create a /etc/aboot.conf file? (YES/no) '
  35. read in
  36. case "$in" in
  37. [nN]*) echo ; exit ;;
  38. *)
  39. rootdev="`grep '^/dev/.* / ' /etc/mtab | tr ' ' '\t' | cut -f1`"
  40. bootdev="`grep '^/dev/.* /boot ' /etc/mtab | tr ' ' '\t' | cut -f1`"
  41. # check, ob rootdev != bootdev
  42. if [ $rootdev != $bootdev ] ; then
  43. notice="# NOTICE: You have a /boot partition. This means\
  44. that\n# all kernel paths are relative to /boot/"
  45. kernelpath="1:`echo -e $bootdev | sed 's/.*part//;'`/vmlinux"
  46. fi
  47. echo
  48. { echo -e '# aboot configuration file'
  49. echo -e $notice'\n'
  50. echo -e $kernelpath' root='$rootdev'\n'
  51. } | tee /etc/aboot.conf.test | sed 's,^,> ,'
  52. esac
  53. echo -n 'Would you like me to install ABOOT now in the MBR? (YES/no) '
  54. read in ; echo
  55. case "$in" in
  56. [nN]*) ;;
  57. *)
  58. bootdisc=`echo -e $bootdev | sed 's/part[0-9]$//;'`"disc"
  59. switeboot -c`echo -e $bootdev | sed 's/.*part//;'` $bootdisc bootlx
  60. abootconf $bootdisc
  61. ;;
  62. esac