Changeset dc55fb5e
- Timestamp:
- 05/14/2011 09:00:31 PM (13 years ago)
- Branches:
- 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
- Children:
- 9f55ea0
- Parents:
- b4a6782
- Location:
- bootscripts/contrib/lsb-v3
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
bootscripts/contrib/lsb-v3/ChangeLog
rb4a6782 rdc55fb5e 6 6 * Moved configuration of clock and hostname to rc.site 7 7 * Removed $time provides from setclock script 8 * Setup the /run mountpoint in the rc script (for use by bootloging) 9 * Moved network services to /lib/network-services 10 * Moved network configuration files to /etc/network 11 * Moved ifup and ifdown scripts to /sbin 12 * ifup - copy network configuration scritps to /run on startup 13 * ifdown - use running configuration stored in /run to stop interfaces 14 * Moved sysconfig files to /etc/default 8 15 9 16 20110424 - [dj] -
bootscripts/contrib/lsb-v3/Makefile
rb4a6782 rdc55fb5e 18 18 install -d -m ${DIRMODE} ${EXTDIR}/init.d 19 19 install -d -m ${DIRMODE} ${EXTDIR}/default 20 install -d -m ${DIRMODE} ${EXTDIR}/network 20 21 install -d -m ${DIRMODE} ${DESTDIR}/lib/lsb 21 22 install -d -m ${DIRMODE} ${EXTDIR}/lsb/state -
bootscripts/contrib/lsb-v3/etc/default/createfiles
rb4a6782 rdc55fb5e 1 1 ######################################################################## 2 # Begin /etc/ sysconfig/createfiles2 # Begin /etc/default/createfiles 3 3 # 4 4 # Description : Createfiles script config file -
bootscripts/contrib/lsb-v3/etc/default/modules
rb4a6782 rdc55fb5e 1 1 ######################################################################## 2 # Begin /etc/ sysconfig/modules2 # Begin /etc/default/modules 3 3 # 4 4 # Description : Module auto-loading configuration … … 16 16 ######################################################################## 17 17 18 # End /etc/ sysconfig/modules18 # End /etc/default/modules -
bootscripts/contrib/lsb-v3/etc/default/rc
rb4a6782 rdc55fb5e 1 # Begin /etc/ sysconfig/rc1 # Begin /etc/default/rc 2 2 3 3 # Author: DJ Lucas - dj@linuxfromscratch.org … … 8 8 9 9 # Source site specific rc configuration 10 . /etc/ sysconfig/rc.site10 . /etc/default/rc.site 11 11 12 12 # This sets default terminal options. … … 39 39 CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char 40 40 41 # Bootlogging and interactive startup require a valid tempfs mount 42 # if this mount is not present, disable them 43 if [ "${TEMPFS_MOUNT}" = "" -o ! -d "${TEMPFS_MOUNT}" ]; then 44 TEMPFS_MOUNT="" 45 iprompt="" 46 BOOTLOG_ENAB="" 47 fi 41 # Export the environment variables so they are inherited by the scripts 42 export PATH SET_COL SET_WCOL CURS_UP BOOTLOG_ENAB 48 43 49 # Export the environment variables so they are inherited by the scripts 50 export PATH SET_COL SET_WCOL CURS_UP TEMPFS_MOUNT BOOTLOG_ENAB RUNLEVEL 51 52 # End /etc/sysconfig/rc 44 # End /etc/default/rc -
bootscripts/contrib/lsb-v3/etc/default/rc.site
rb4a6782 rdc55fb5e 4 4 5 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" 6 NETWORK_DEVICES="/etc/network" 12 7 13 8 # Bootlogging (requires a tempfs mount) … … 44 39 45 40 # Export varialbles so that they are inherited by the initscripts 46 export RC_BASE RC_FUNCTIONS NETWORK_DEVICES TEMPFS_MOUNTBOOTLOG_ENAB41 export RC_BASE RC_FUNCTIONS NETWORK_DEVICES BOOTLOG_ENAB 47 42 export HOSTNAME UTC CLOCKPARAMS FAILURE_ACTION 48 43 export DISTRO DISTRO_CONTACT DISTRO_MINI … … 80 75 } 81 76 77 -
bootscripts/contrib/lsb-v3/etc/init.d/cleanfs
rb4a6782 rdc55fb5e 13 13 # Description: Cleans temporary directories /var/run, /var/lock, and 14 14 # /tmp. cleanfs also creates /var/run/utmp and any files 15 # defined in /etc/ sysconfig/createfiles.15 # defined in /etc/default/createfiles. 16 16 # X-LFS-Provided-By: LFS 17 17 ### END INIT INFO … … 23 23 { 24 24 # Read in the configuration file. 25 exec 9>&0 < /etc/ sysconfig/createfiles25 exec 9>&0 < /etc/default/createfiles 26 26 while read name type perm usr grp dtype maj min junk 27 27 do … … 90 90 evaluate_retval standard 91 91 92 if egrep -qv '^(#|$)' /etc/ sysconfig/createfiles 2>/dev/null92 if egrep -qv '^(#|$)' /etc/default/createfiles 2>/dev/null 93 93 then 94 94 message="Creating files and directories..." -
bootscripts/contrib/lsb-v3/etc/init.d/console
rb4a6782 rdc55fb5e 12 12 # Short-Description: Sets up a localised console. 13 13 # Description: Sets up fonts and language settings for the user's 14 # local as defined by /etc/ sysconfig/console.14 # local as defined by /etc/default/console. 15 15 # X-LFS-Provided-By: LFS 16 16 ### END INIT INFO … … 20 20 MESSAGE="Setting up Linux console..." 21 21 22 # Native English speakers probably don't have /etc/ sysconfig/console at all23 if [ -f /etc/ sysconfig/console ]22 # Native English speakers probably don't have /etc/default/console at all 23 if [ -f /etc/default/console ] 24 24 then 25 . /etc/ sysconfig/console25 . /etc/default/console 26 26 fi 27 27 -
bootscripts/contrib/lsb-v3/etc/init.d/modules
rb4a6782 rdc55fb5e 11 11 # Default-Stop: 12 12 # Short-Description: Loads required modules. 13 # Description: Loads modules listed in /etc/ sysconfig/modules.13 # Description: Loads modules listed in /etc/default/modules. 14 14 # X-LFS-Provided-By: LFS 15 15 ### END INIT INFO … … 25 25 # Exit if there's no modules file or there are no 26 26 # valid entries 27 [ -r /etc/ sysconfig/modules ] &&28 egrep -qv '^($|#)' /etc/ sysconfig/modules ||27 [ -r /etc/default/modules ] && 28 egrep -qv '^($|#)' /etc/default/modules || 29 29 exit 0 30 30 … … 45 45 # Only try to load modules if the user has actually given us 46 46 # some modules to load. 47 if egrep -qv '^(#|$)' /etc/ sysconfig/modules 2>/dev/null47 if egrep -qv '^(#|$)' /etc/default/modules 2>/dev/null 48 48 then 49 49 50 50 # Read in the configuration file. 51 exec 9>&0 < /etc/ sysconfig/modules51 exec 9>&0 < /etc/default/modules 52 52 53 53 message="${INFO}Loading modules:" -
bootscripts/contrib/lsb-v3/etc/init.d/mountvirtfs
rb4a6782 rdc55fb5e 31 31 fi 32 32 33 if ! mountpoint /run > /dev/null; then 34 message="${message}${INFO} /run${NORMAL}" 35 mount -n /run || failed=1 36 mkdir /run/{var,lock,shm} || failed=1 37 fi 33 # create needed directories in /run 34 mkdir /run/{var,lock,shm} || failed=1 38 35 39 36 (exit ${failed}) -
bootscripts/contrib/lsb-v3/etc/init.d/network
rb4a6782 rdc55fb5e 16 16 17 17 . /lib/lsb/init-functions 18 . /etc/sysconfig/network19 18 20 19 case "${1}" in … … 30 29 continue 31 30 fi 32 IN_BOOT=1 ${NETWORK_DEVICES}/ifup ${interface}31 IN_BOOT=1 /sbin/ifup ${interface} 33 32 done 34 33 ;; … … 37 36 # Reverse list 38 37 FILES="" 39 for file in ${NETWORK_DEVICES}/ifconfig.*38 for file in /run/network/ifconfig.* 40 39 do 41 40 FILES="${file} ${FILES}" … … 53 52 fi 54 53 55 IN_BOOT=1 ${NETWORK_DEVICES}/ifdown ${interface}54 IN_BOOT=1 /sbin/ifdown ${interface} 56 55 done 57 56 ;; -
bootscripts/contrib/lsb-v3/etc/init.d/rc
rb4a6782 rdc55fb5e 4 4 # Get the configuration file 5 5 # All changes are to occur in the config file 6 . /etc/ sysconfig/rc6 . /etc/default/rc 7 7 8 8 # These 3 signals will not cause our script to exit … … 26 26 fi 27 27 28 # Mount a tmpfs to store boot accounting information29 if [ "${runlevel}" = "S" -a "${TEMPFS_MOUNT}" != ""]; then30 mount -n -t tmpfs tmpfs "${TEMPFS_MOUNT}" -o mode=60028 # Mount /run 29 if [ "${runlevel}" = "S" ]; then 30 mount -n -t tmpfs tmpfs /run 31 31 fi 32 32 … … 53 53 echo -n -e "${CURS_UP}" 54 54 echo -e "${INFO}Interactive boot selected...${NORMAL}" 55 echo "interactive=I" > "${TEMPFS_MOUNT}/.interactive-start"55 echo "interactive=I" > /run/.interactive-start 56 56 fi 57 57 fi … … 67 67 68 68 # Source the interactive state file if it exists 69 if [ "${runlevel}" != "S" -a -f "${TEMPFS_MOUNT}/.interactive-start"]; then70 . "${TEMPFS_MOUNT}/.interactive-start"69 if [ "${runlevel}" != "S" -a -f /run/.interactive-start ]; then 70 . /run/.interactive-start 71 71 fi 72 72 … … 181 181 # Strip apply time to the logs, strip out any color codes and dump 182 182 # the log to /var/log/boot.log 183 if [ -f "${TEMPFS_MOUNT}/.bootlog"-a "${runlevel}" != "S" ]; then183 if [ -f /run/.bootlog -a "${runlevel}" != "S" ]; then 184 184 # Remove any color codes from the temp log file 185 sed -i 's@\\033\[[0-9];[0-9][0-9]m@@g' "${TEMPFS_MOUNT}/.bootlog"185 sed -i 's@\\033\[[0-9];[0-9][0-9]m@@g' /run/.bootlog 186 186 #Fix the time and hostname 187 187 BTIMESPEC=$(echo `date +"%b %d %T"` `hostname`) 188 sed -i "s@^bootlog:@${BTIMESPEC} bootlog:@" "${TEMPFS_MOUNT}/.bootlog"188 sed -i "s@^bootlog:@${BTIMESPEC} bootlog:@" /run/.bootlog 189 189 # Don't try and write in 0 and 6, this is a 'boot' log 190 190 if [ "${runlevel}" != "0" -a "${runlevel}" != "6" ]; then 191 cat "${TEMPFS_MOUNT}/.bootlog" >> /var/log/boot.log 192 rm -f "${TEMPFS_MOUNT}/.bootlog" 193 fi 191 cat /run/.bootlog >> /var/log/boot.log 192 rm -f /run/.bootlog 193 fi 194 fi 195 196 # Remove interactive boot temp file 197 if [ -f /run/.interactive-start -a "${runlevel}" != "S" ]; then 198 rm -f /run/.interactive-start 194 199 fi 195 200 -
bootscripts/contrib/lsb-v3/etc/init.d/template
rb4a6782 rdc55fb5e 25 25 MESSAGE="Template Service" 26 26 BIN_FILE="/some/path/to/template" 27 CONFIGFILE="/etc/ sysconfig/template.conf"27 CONFIGFILE="/etc/default/template.conf" 28 28 29 29 # check that $BIN_FILE exists and is executable, and $CONFIGFILE exists. -
bootscripts/contrib/lsb-v3/etc/init.d/udev
rb4a6782 rdc55fb5e 34 34 fi 35 35 36 # Mount a temporary file system over /dev, so that any devices 37 # made or removed during this boot don't affect the next one. 38 # The reason we don't write to mtab is because we don't ever 39 # want /dev to be unavailable (such as by `umount -a'). 36 # If not using DEVTMPFS mount a temporary file system over 37 # /dev, so that any devices made or removed during this boot 38 # don't affect the next one. The reason we don't write to mtab 39 # is because we don't ever want /dev to be unavailable (such as 40 # by `umount -a'). 40 41 if ! mountpoint /dev > /dev/null; then 41 42 mount -n -t tmpfs tmpfs /dev -o mode=755 … … 58 59 # Udev handles uevents itself, so we don't need to have 59 60 # the kernel call out to any binary in response to them 61 # This is a failsafe and should be done in kernel config 60 62 echo > /proc/sys/kernel/hotplug 61 63 62 64 # Copy the only static device node that Udev >= 155 doesn't 63 # handle to /dev 64 cp -a /lib/udev/devices/null /dev 65 # handle to /dev (handled by default with DEVTMPFS) 66 if [ ! -f /dev/null ]; then 67 cp -a /lib/udev/devices/null /dev 68 fi 65 69 66 70 # Start the udev daemon to continually watch for, and act on, -
bootscripts/contrib/lsb-v3/lib/lsb/init-functions
rb4a6782 rdc55fb5e 6 6 # Source rc configuration if not inherited from the environment 7 7 if [ "${RC_BASE}" = "" ]; then 8 . /etc/ sysconfig/rc8 . /etc/default/rc 9 9 fi 10 10 … … 450 450 BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) " 451 451 fi 452 echo "${BTTIMESPEC}bootlog: ${@} Successful" >> "${TEMPFS_MOUNT}/.bootlog" 452 if [ "${RUNLEVEL}" != "0" -a "${RUNLEVEL}" != "6" ]; then 453 echo "${BTTIMESPEC}bootlog: ${@} Successful" >> /run/.bootlog 454 fi 453 455 fi 454 456 return 0 … … 477 479 BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) " 478 480 fi 479 echo "${BTTIMESPEC}bootlog: ${@} Failed!" >> "${TEMPFS_MOUNT}/.bootlog" 481 if [ "${RUNLEVEL}" != "0" -a "${RUNLEVEL}" != "6" ]; then 482 echo "${BTTIMESPEC}bootlog: ${@} Failed!" >> /run/.bootlog 483 fi 480 484 fi 481 485 return 0 … … 504 508 BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) " 505 509 fi 506 echo "${BTTIMESPEC}bootlog: ${@} Warning" >> "${TEMPFS_MOUNT}/.bootlog" 510 if [ "${RUNLEVEL}" != "0" -a "${RUNLEVEL}" != "6" ]; then 511 echo "${BTTIMESPEC}bootlog: ${@} Warning" >> /run/.bootlog 512 fi 507 513 fi 508 514 return 0 -
bootscripts/contrib/lsb-v3/sbin/ifdown
rb4a6782 rdc55fb5e 21 21 if [ -n "${2}" ]; then 22 22 for file in ${@#$1}; do # All parameters except $1 23 FILES="${FILES} ${NETWORK_DEVICES}/ifconfig.${1}/${file}"23 FILES="${FILES} /run/network/ifconfig.${1}/${file}" 24 24 done 25 elif [ -d " ${NETWORK_DEVICES}/ifconfig.${1}" ]; then26 FILES=`echo ${NETWORK_DEVICES}/ifconfig.${1}/*`25 elif [ -d "/run/network/ifconfig.${1}" ]; then 26 FILES=`echo /run/network/ifconfig.${1}/*` 27 27 else 28 FILES=" ${NETWORK_DEVICES}/ifconfig.${1}"28 FILES="/run/network/ifconfig.${1}" 29 29 fi 30 30 … … 47 47 fi 48 48 ( 49 . ${file} 49 if [ ! -d "${file}" ]; then 50 . ${file} 51 fi 50 52 51 53 # Will not process this service if started by boot, and ONBOOT … … 62 64 63 65 # This will run the service script, if SERVICE is set 64 if [ -n "${SERVICE}" -a -x " ${NETWORK_DEVICES}/services/${SERVICE}" ]; then66 if [ -n "${SERVICE}" -a -x "/lib/network-services/${SERVICE}" ]; then 65 67 if ip link show ${1} > /dev/null 2>&1 66 68 then 67 IFCONFIG=${file} ${NETWORK_DEVICES}/services/${SERVICE} ${1} down 69 IFCONFIG=${file} /lib/network-services/${SERVICE} ${1} down && 70 if [ -f "${file}" ]; then 71 rm ${file} 72 fi 68 73 else 69 74 message="Interface ${1} doesn't exist." -
bootscripts/contrib/lsb-v3/sbin/ifup
rb4a6782 rdc55fb5e 46 46 47 47 ( 48 . ${file} 48 if [ ! -d "${file}" ]; then 49 . ${file} 50 fi 49 51 50 52 # Will not process this service if started by boot, and ONBOOT … … 59 61 fi 60 62 61 if [ -n "${SERVICE}" -a -x " ${NETWORK_DEVICES}/services/${SERVICE}" ]; then63 if [ -n "${SERVICE}" -a -x "/lib/network-services/${SERVICE}" ]; then 62 64 if [ -z "${CHECK_LINK}" -o "${CHECK_LINK}" = "y" -o "${CHECK_LINK}" = "yes" -o "${CHECK_LINK}" = "1" ]; then 63 65 if ip link show ${1} > /dev/null 2>&1; then … … 74 76 fi 75 77 fi 76 IFCONFIG=${file} ${NETWORK_DEVICES}/services/${SERVICE} ${1} up 78 IFCONFIG=${file} /lib/network-services/${SERVICE} ${1} up 79 if [ "${?}" -eq "0" ]; then 80 if [ ! -d "${file}" -a "${file}" != "${NETWORK_DEVICES}/ifconfig.${1}" ]; then 81 mkdir -p "/run/network/ifconfig.${1}" 82 cp "${file}" "/run/network/ifconfig.${1}" 83 elif [ ! -d "${file}" ]; then 84 cp "${file}" "/run/network/" 85 fi 86 fi 77 87 else 78 88 echo -e "${FAILURE}Unable to process ${file}. Either"
Note:
See TracChangeset
for help on using the changeset viewer.