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.

67 lines
2.1 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/x86/lilo/stone_mod_lilo.sh
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  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; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. #
  23. # [MAIN] 70 lilo LILO Boot Loader Setup
  24. create_lilo_conf() {
  25. i=0 ; rootdev="`grep ' / ' /proc/mounts | tail -n 1 | \
  26. awk '/\/dev\// { print $1; }'`"
  27. rootdev="$( cd `dirname $rootdev` ; pwd -P )/$( basename $rootdev )"
  28. while [ -L $rootdev ] ; do
  29. directory="$( cd `dirname $rootdev` ; pwd -P )"
  30. rootdev="$( ls -l $rootdev | sed 's,.* -> ,,' )"
  31. [ "${rootdev##/*}" ] && rootdev="$directory/$rootdev"
  32. i=$(( $i + 1 )) ; [ $i -gt 20 ] && rootdev="Not found!"
  33. done
  34. bootdev="$( dirname $rootdev )/disc"
  35. cat << EOT > /etc/lilo.conf
  36. boot=$bootdev
  37. delay=40
  38. lba32
  39. image=/boot/vmlinuz
  40. label=rock
  41. append="root=$rootdev"
  42. read-only
  43. image=/boot/memtest86.bin
  44. label=memtest
  45. optional
  46. EOT
  47. gui_message "This is the new /etc/lilo.conf file:
  48. $( cat /etc/lilo.conf )"
  49. }
  50. main() {
  51. while
  52. gui_menu lilo 'LILO Boot Loader Setup' \
  53. '(Re-)Create default /etc/lilo.conf' 'create_lilo_conf' \
  54. '(Re-)Install LILO in MBR of /dev/discs/disc0/disc' \
  55. 'gui_cmd "Installing LILO in MBR" "lilo -v"' \
  56. "Edit /etc/lilo.conf (recommended before installing LILO)" \
  57. "gui_edit 'LILO Config File' /etc/lilo.conf"
  58. do : ; done
  59. }