Changeset dc55fb5e


Ignore:
Timestamp:
05/14/2011 09:00:31 PM (13 years ago)
Author:
DJ Lucas <dj@…>
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
Message:

Changes per thread starting at http://archive.linuxfromscratch.org/mail-archives/lfs-dev/2011-May/064677.html

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

Location:
bootscripts/contrib/lsb-v3
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • bootscripts/contrib/lsb-v3/ChangeLog

    rb4a6782 rdc55fb5e  
    66        * Moved configuration of clock and hostname to rc.site
    77        * 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
    815
    91620110424 - [dj]
  • bootscripts/contrib/lsb-v3/Makefile

    rb4a6782 rdc55fb5e  
    1818        install -d -m ${DIRMODE} ${EXTDIR}/init.d
    1919        install -d -m ${DIRMODE} ${EXTDIR}/default
     20        install -d -m ${DIRMODE} ${EXTDIR}/network
    2021        install -d -m ${DIRMODE} ${DESTDIR}/lib/lsb
    2122        install -d -m ${DIRMODE} ${EXTDIR}/lsb/state
  • bootscripts/contrib/lsb-v3/etc/default/createfiles

    rb4a6782 rdc55fb5e  
    11########################################################################
    2 # Begin /etc/sysconfig/createfiles
     2# Begin /etc/default/createfiles
    33#
    44# Description : Createfiles script config file
  • bootscripts/contrib/lsb-v3/etc/default/modules

    rb4a6782 rdc55fb5e  
    11########################################################################
    2 # Begin /etc/sysconfig/modules
     2# Begin /etc/default/modules
    33#
    44# Description : Module auto-loading configuration
     
    1616########################################################################
    1717
    18 # End /etc/sysconfig/modules
     18# End /etc/default/modules
  • bootscripts/contrib/lsb-v3/etc/default/rc

    rb4a6782 rdc55fb5e  
    1 # Begin /etc/sysconfig/rc
     1# Begin /etc/default/rc
    22
    33# Author: DJ Lucas - dj@linuxfromscratch.org
     
    88
    99# Source site specific rc configuration
    10 . /etc/sysconfig/rc.site
     10. /etc/default/rc.site
    1111
    1212# This sets default terminal options.
     
    3939CURS_UP="\\033[1A\\033[0G"   # Up one line, at the 0'th char
    4040
    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
     42export PATH SET_COL SET_WCOL CURS_UP BOOTLOG_ENAB
    4843
    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  
    44
    55# 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"
     6NETWORK_DEVICES="/etc/network"
    127
    138# Bootlogging (requires a tempfs mount)
     
    4439
    4540# Export varialbles so that they are inherited by the initscripts
    46 export RC_BASE RC_FUNCTIONS NETWORK_DEVICES TEMPFS_MOUNT BOOTLOG_ENAB
     41export RC_BASE RC_FUNCTIONS NETWORK_DEVICES BOOTLOG_ENAB
    4742export HOSTNAME UTC CLOCKPARAMS FAILURE_ACTION
    4843export DISTRO DISTRO_CONTACT DISTRO_MINI
     
    8075}
    8176
     77
  • bootscripts/contrib/lsb-v3/etc/init.d/cleanfs

    rb4a6782 rdc55fb5e  
    1313# Description:         Cleans temporary directories /var/run, /var/lock, and
    1414#                      /tmp.  cleanfs also creates /var/run/utmp and any files
    15 #                      defined in /etc/sysconfig/createfiles.
     15#                      defined in /etc/default/createfiles.
    1616# X-LFS-Provided-By:   LFS
    1717### END INIT INFO
     
    2323{
    2424    # Read in the configuration file.
    25     exec 9>&0 < /etc/sysconfig/createfiles
     25    exec 9>&0 < /etc/default/createfiles
    2626    while read name type perm usr grp dtype maj min junk
    2727    do
     
    9090        evaluate_retval standard
    9191
    92         if egrep -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null
     92        if egrep -qv '^(#|$)' /etc/default/createfiles 2>/dev/null
    9393        then
    9494            message="Creating files and directories..."
  • bootscripts/contrib/lsb-v3/etc/init.d/console

    rb4a6782 rdc55fb5e  
    1212# Short-Description:   Sets up a localised console.
    1313# 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.
    1515# X-LFS-Provided-By:   LFS
    1616### END INIT INFO
     
    2020MESSAGE="Setting up Linux console..."
    2121
    22 # Native English speakers probably don't have /etc/sysconfig/console at all
    23 if [ -f /etc/sysconfig/console ]
     22# Native English speakers probably don't have /etc/default/console at all
     23if [ -f /etc/default/console ]
    2424then
    25         . /etc/sysconfig/console
     25        . /etc/default/console
    2626fi
    2727
  • bootscripts/contrib/lsb-v3/etc/init.d/modules

    rb4a6782 rdc55fb5e  
    1111# Default-Stop:
    1212# Short-Description:   Loads required modules.
    13 # Description:         Loads modules listed in /etc/sysconfig/modules.
     13# Description:         Loads modules listed in /etc/default/modules.
    1414# X-LFS-Provided-By:   LFS
    1515### END INIT INFO
     
    2525        # Exit if there's no modules file or there are no
    2626        # valid entries
    27         [ -r /etc/sysconfig/modules ] &&
    28             egrep -qv '^($|#)' /etc/sysconfig/modules ||
     27        [ -r /etc/default/modules ] &&
     28            egrep -qv '^($|#)' /etc/default/modules ||
    2929            exit 0
    3030
     
    4545        # Only try to load modules if the user has actually given us
    4646        # some modules to load.
    47         if egrep -qv '^(#|$)' /etc/sysconfig/modules 2>/dev/null
     47        if egrep -qv '^(#|$)' /etc/default/modules 2>/dev/null
    4848        then
    4949
    5050            # Read in the configuration file.
    51             exec 9>&0 < /etc/sysconfig/modules
     51            exec 9>&0 < /etc/default/modules
    5252
    5353                message="${INFO}Loading modules:"
  • bootscripts/contrib/lsb-v3/etc/init.d/mountvirtfs

    rb4a6782 rdc55fb5e  
    3131        fi
    3232
    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
    3835
    3936        (exit ${failed})
  • bootscripts/contrib/lsb-v3/etc/init.d/network

    rb4a6782 rdc55fb5e  
    1616
    1717. /lib/lsb/init-functions
    18 . /etc/sysconfig/network
    1918
    2019case "${1}" in
     
    3029                                continue
    3130                        fi
    32                         IN_BOOT=1 ${NETWORK_DEVICES}/ifup ${interface}
     31                        IN_BOOT=1 /sbin/ifup ${interface}
    3332                done
    3433                ;;
     
    3736                # Reverse list
    3837                FILES=""
    39                 for file in ${NETWORK_DEVICES}/ifconfig.*
     38                for file in /run/network/ifconfig.*
    4039                do
    4140                        FILES="${file} ${FILES}"
     
    5352                        fi
    5453
    55                         IN_BOOT=1 ${NETWORK_DEVICES}/ifdown ${interface}
     54                        IN_BOOT=1 /sbin/ifdown ${interface}
    5655                done
    5756                ;;
  • bootscripts/contrib/lsb-v3/etc/init.d/rc

    rb4a6782 rdc55fb5e  
    44# Get the configuration file
    55# All changes are to occur in the config file
    6 . /etc/sysconfig/rc
     6. /etc/default/rc
    77
    88# These 3 signals will not cause our script to exit
     
    2626fi
    2727
    28 # Mount a tmpfs to store boot accounting information
    29 if [ "${runlevel}" = "S" -a "${TEMPFS_MOUNT}" != "" ]; then
    30     mount -n -t tmpfs tmpfs "${TEMPFS_MOUNT}" -o mode=600
     28# Mount /run
     29if [ "${runlevel}" = "S" ]; then
     30    mount -n -t tmpfs tmpfs /run
    3131fi
    3232
     
    5353            echo -n -e "${CURS_UP}"
    5454            echo -e "${INFO}Interactive boot selected...${NORMAL}"
    55             echo "interactive=I" > "${TEMPFS_MOUNT}/.interactive-start"
     55            echo "interactive=I" > /run/.interactive-start
    5656        fi
    5757    fi
     
    6767
    6868# Source the interactive state file if it exists
    69 if [ "${runlevel}" != "S" -a -f "${TEMPFS_MOUNT}/.interactive-start" ]; then
    70     . "${TEMPFS_MOUNT}/.interactive-start"
     69if [ "${runlevel}" != "S" -a -f /run/.interactive-start ]; then
     70    . /run/.interactive-start
    7171fi
    7272
     
    181181# Strip apply time to the logs, strip out any color codes and dump
    182182# the log to /var/log/boot.log
    183 if [ -f "${TEMPFS_MOUNT}/.bootlog" -a "${runlevel}" != "S" ]; then
     183if [ -f /run/.bootlog -a "${runlevel}" != "S" ]; then
    184184    # 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
    186186    #Fix the time and hostname
    187187    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
    189189    # Don't try and write in 0 and 6, this is a 'boot' log
    190190    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
     194fi
     195
     196# Remove interactive boot temp file
     197if [ -f /run/.interactive-start -a "${runlevel}" != "S" ]; then
     198    rm -f /run/.interactive-start
    194199fi
    195200
  • bootscripts/contrib/lsb-v3/etc/init.d/template

    rb4a6782 rdc55fb5e  
    2525MESSAGE="Template Service"
    2626BIN_FILE="/some/path/to/template"
    27 CONFIGFILE="/etc/sysconfig/template.conf"
     27CONFIGFILE="/etc/default/template.conf"
    2828
    2929# check that $BIN_FILE exists and is executable, and $CONFIGFILE exists.
  • bootscripts/contrib/lsb-v3/etc/init.d/udev

    rb4a6782 rdc55fb5e  
    3434                fi
    3535
    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').
    4041                if ! mountpoint /dev > /dev/null; then
    4142                        mount -n -t tmpfs tmpfs /dev -o mode=755
     
    5859                # Udev handles uevents itself, so we don't need to have
    5960                # the kernel call out to any binary in response to them
     61                # This is a failsafe and should be done in kernel config
    6062                echo > /proc/sys/kernel/hotplug
    6163
    6264                # 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
    6569
    6670                # Start the udev daemon to continually watch for, and act on,
  • bootscripts/contrib/lsb-v3/lib/lsb/init-functions

    rb4a6782 rdc55fb5e  
    66# Source rc configuration if not inherited from the environment
    77if [ "${RC_BASE}" = "" ]; then
    8     . /etc/sysconfig/rc
     8    . /etc/default/rc
    99fi
    1010
     
    450450            BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) "
    451451        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
    453455    fi
    454456    return 0
     
    477479            BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) "
    478480        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
    480484    fi
    481485    return 0
     
    504508            BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) "
    505509        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
    507513    fi
    508514    return 0
  • bootscripts/contrib/lsb-v3/sbin/ifdown

    rb4a6782 rdc55fb5e  
    2121if [ -n "${2}" ]; then
    2222    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}"
    2424    done
    25 elif [ -d "${NETWORK_DEVICES}/ifconfig.${1}" ]; then
    26     FILES=`echo ${NETWORK_DEVICES}/ifconfig.${1}/*`
     25elif [ -d "/run/network/ifconfig.${1}" ]; then
     26    FILES=`echo /run/network/ifconfig.${1}/*`
    2727else
    28     FILES="${NETWORK_DEVICES}/ifconfig.${1}"
     28    FILES="/run/network/ifconfig.${1}"
    2929fi
    3030
     
    4747    fi
    4848    (
    49         . ${file}
     49        if [ ! -d "${file}" ]; then
     50            . ${file}
     51        fi
    5052
    5153        # Will not process this service if started by boot, and ONBOOT
     
    6264   
    6365        # This will run the service script, if SERVICE is set
    64         if [ -n "${SERVICE}" -a -x "${NETWORK_DEVICES}/services/${SERVICE}" ]; then
     66        if [ -n "${SERVICE}" -a -x "/lib/network-services/${SERVICE}" ]; then
    6567            if ip link show ${1} > /dev/null 2>&1
    6668            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
    6873            else
    6974                message="Interface ${1} doesn't exist."
  • bootscripts/contrib/lsb-v3/sbin/ifup

    rb4a6782 rdc55fb5e  
    4646
    4747    (
    48         . ${file}
     48        if [ ! -d "${file}" ]; then
     49            . ${file}
     50        fi
    4951
    5052        # Will not process this service if started by boot, and ONBOOT
     
    5961        fi
    6062
    61         if [ -n "${SERVICE}" -a -x "${NETWORK_DEVICES}/services/${SERVICE}" ]; then
     63        if [ -n "${SERVICE}" -a -x "/lib/network-services/${SERVICE}" ]; then
    6264            if [ -z "${CHECK_LINK}" -o "${CHECK_LINK}" = "y" -o "${CHECK_LINK}" = "yes" -o "${CHECK_LINK}" = "1" ]; then
    6365                if ip link show ${1} > /dev/null 2>&1; then
     
    7476                fi
    7577            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
    7787        else
    7888            echo -e "${FAILURE}Unable to process ${file}.  Either"
Note: See TracChangeset for help on using the changeset viewer.