rc.site 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Set base directory information
  2. RC_BASE="/etc"
  3. RC_FUNCTIONS="${RC_BASE}/init.d/lfs-functions"
  4. # Location of network device scripts and config files
  5. NETWORK_DEVICES="/etc/sysconfig/network-devices"
  6. # Directory to store boot process accounting information
  7. # Used for boot logging and interactive flag when rootfs
  8. # is not writable
  9. TEMPFS_MOUNT="${RC_BASE}/init.d/boottemp"
  10. # Bootlogging (requires a tempfs mount)
  11. BOOTLOG_ENAB="yes"
  12. # Manual input is not appropriate on remote systems. Define what happens when
  13. # an error is encountered that interupts the boot/shutdown proceess
  14. FAILURE_ACTION="read ENTER"
  15. # Distro Information
  16. DISTRO="Linux From Scratch" # The distro name
  17. DISTRO_CONTACT="lfs-dev@linuxfromscratch.org" # Bug report address
  18. DISTRO_MINI="lfs" # Short name used in filenames for distro config
  19. # Define custom colors used in messages printed to the screen
  20. BRACKET="\\033[1;34m" # Blue
  21. FAILURE="\\033[1;31m" # Red
  22. INFO="\\033[1;36m" # Cyan
  23. NORMAL="\\033[0;39m" # Grey
  24. SUCCESS="\\033[1;32m" # Green
  25. WARNING="\\033[1;33m" # Yellow
  26. # Prefix boot messages for easier reading on framebuffer consoles
  27. PREFIX_SUCCESS=" ${SUCCESS}*${NORMAL} "
  28. PREFIX_WARNING="${WARNING}**${NORMAL} "
  29. PREFIX_FAILURE="${FAILURE}***${NORMAL}"
  30. # Export varialbles so that they are inherited by the initscripts
  31. export RC_BASE RC_FUNCTIONS NETWORK_DEVICES TEMPFS_MOUNT BOOTLOG_ENAB
  32. export FAILURE_ACTION
  33. export DISTRO DISTRO_CONTACT DISTRO_MINI
  34. export BRACKET FAILURE INFO NORMAL SUCCESS WARNING
  35. export PREFIX_SUCCESS PREFIX_WARNING PREFIX_FAILURE
  36. # Interactive startup
  37. iprompt="yes" # Wether to display the interactive boot promp
  38. itime="2" # The ammount of time (in seconds) to display the prompt
  39. dlen="29" # The total length of the distro welcome string
  40. ilen="38" # The total length of the interactive message
  41. welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}"
  42. i_message="Press '${FAILURE}I${NORMAL}' to enter interactive startup"
  43. # Error message displayed when a script's exit value is not zero
  44. print_error_msg()
  45. {
  46. # ${link} and ${error_value} are defined by the rc script
  47. echo -e "${FAILURE}FAILURE: You should not be reading this error message."
  48. echo -e ""
  49. echo -e -n "${FAILURE}It means that an unforseen error took place in"
  50. echo -e -n "${INFO} ${link}"
  51. echo -e "${FAILURE},"
  52. echo -e "${FAILURE}which exited with a return value of ${error_value}."
  53. echo -e ""
  54. echo -e -n "${FAILURE}If you are able to track this error down to a bug"
  55. echo -e "${FAILURE}in one of the files"
  56. echo -e -n "provided by ${INFO}${DISTRO}${FAILURE}, "
  57. echo -e -n "${FAILURE}please be so kind to inform us at "
  58. echo -e "${INFO}${DISTRO_CONTACT}${FAILURE}.${NORMAL}"
  59. echo -e ""
  60. echo -e "${INFO}Press Enter to continue..."
  61. echo -e "${NORMAL}"
  62. $FAILURE_ACTION
  63. }