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