source: lsb-bootscripts/etc/default/rc@ f3d1e33

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since f3d1e33 was f3f65e73, checked in by DJ Lucas <dj@…>, 13 years ago

Added stop_on_error parameter to rc.site and cleaned up Begin and End lines.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9552 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 3.4 KB
Line 
1# Begin /etc/default/rc
2
3# Global variable inherited by initscripts are in caps
4# Local variables for the rc script are in lowercase
5
6# Source site specific rc configuration
7. /etc/default/rc.site
8
9# Set base directory information
10RC_BASE="/etc/rc.d"
11
12# Location of network device scripts and config files
13NETWORK_DEVICES="/etc/network"
14
15# This sets default terminal options.
16# stty sane - this has been removed as nobody recalls
17# the reason for it in the first place - if no problems arize,
18# then it will be removed completely at a later date.
19
20# Setup default values for the environment
21umask 022
22PATH="/bin:/sbin"
23
24# Find current screen size
25if [ -z "${COLUMNS}" ]; then
26 COLUMNS=$(stty size)
27 COLUMNS=${COLUMNS##* }
28fi
29
30# When using remote connections, such as a serial port, stty size returns 0
31if [ "${COLUMNS}" = "0" ]; then
32 COLUMNS=80
33fi
34
35## Measurements for positioning result messages
36COL=$((${COLUMNS} - 8))
37WCOL=$((${COL} - 2))
38
39# Set Cursur Position Commands, used via echo -e
40SET_COL="\\033[${COL}G" # at the $COL char
41SET_WCOL="\\033[${WCOL}G" # at the $WCOL char
42CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char
43
44# Distro Information
45DISTRO="Linux From Scratch" # The distro name
46DISTRO_CONTACT="lfs-dev@linuxfromscratch.org" # Bug report address
47DISTRO_MINI="lfs" # Short name used in filenames for distro config
48
49# Define custom colors used in messages printed to the screen
50BRACKET="\\033[1;34m" # Blue
51FAILURE="\\033[1;31m" # Red
52INFO="\\033[1;36m" # Cyan
53NORMAL="\\033[0;39m" # Grey
54SUCCESS="\\033[1;32m" # Green
55WARNING="\\033[1;33m" # Yellow
56
57# Prefix boot messages for easier reading on framebuffer consoles
58PREFIX_SUCCESS=" ${SUCCESS}*${NORMAL} "
59PREFIX_WARNING="${WARNING}**${NORMAL} "
60PREFIX_FAILURE="${FAILURE}***${NORMAL}"
61
62# Export the environment variables so they are inherited by the scripts
63export RC_BASE NETWORK_DEVICES PATH SET_COL SET_WCOL CURS_UP
64export DISTRO DISTRO_CONTACT DISTRO_MINI
65export BRACKET FAILURE INFO NORMAL SUCCESS WARNING
66export PREFIX_SUCCESS PREFIX_WARNING PREFIX_FAILURE
67
68# Interactive startup
69dlen="29" # The total length of the distro welcome string
70ilen="38" # The total length of the interactive message
71welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}"
72i_message="Press '${FAILURE}I${NORMAL}' to enter interactive startup"
73
74# FAILURE_ACTION (what to do when script failure occurs)
75case "${stop_on_error}" in
76 Y* | y* | 0)
77 FAILURE_ACTION='read Enter'
78 ;;
79 *)
80 FAILURE_ACTION='echo ""'
81 ;;
82esac
83
84# Error message displayed when a script's exit value is not zero
85print_error_msg()
86{
87 # ${link} and ${error_value} are defined by the rc script
88 echo -e "${FAILURE}FAILURE: You should not be reading this error message."
89 echo -e ""
90 echo -e -n "${FAILURE}It means that an unforseen error took place in"
91 echo -e -n "${INFO} ${link}"
92 echo -e "${FAILURE},"
93 echo -e "${FAILURE}which exited with a return value of ${error_value}."
94 echo -e ""
95 echo -e -n "${FAILURE}If you are able to track this error down to a bug"
96 echo -e "${FAILURE}in one of the files"
97 echo -e -n "provided by ${INFO}${DISTRO}${FAILURE}, "
98 echo -e -n "${FAILURE}please be so kind to inform us at "
99 echo -e "${INFO}${DISTRO_CONTACT}${FAILURE}.${NORMAL}"
100 echo -e ""
101 echo -e "${INFO}Press Enter to continue..."
102 echo -e "${NORMAL}"
103 $FAILURE_ACTION
104}
105
106# End /etc/default/rc
Note: See TracBrowser for help on using the repository browser.