Submitted By: William Harrington (kb0iic at cross-lfs dot org) Date: 2014-05-16 Initial Package Version: 3.1-pre1 Origin: Idea for cleaning up boot chapter by Chris Staub Upstream Status: Not Applied - CLFS Specific Description: Reduces ${CLFS}/ pollution by using ${CLFS}/tools as much as possible. diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/Makefile bootscripts-cross-lfs-3.0-pre1/Makefile --- bootscripts-cross-lfs-3.0-pre1.orig/Makefile 2011-01-09 02:43:16.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/Makefile 2014-05-17 00:02:04.100001526 +0000 @@ -118,7 +118,6 @@ if [ ! -f ${EXTDIR}/sysconfig/i18n ]; then install -m ${CONFMODE} clfs/sysconfig/i18n ${EXTDIR}/sysconfig/; fi if [ ! -f ${EXTDIR}/sysconfig/modules ]; then install -m ${CONFMODE} clfs/sysconfig/modules ${EXTDIR}/sysconfig/; fi if [ ! -f ${EXTDIR}/sysconfig/rc ]; then install -m ${CONFMODE} clfs/sysconfig/rc ${EXTDIR}/sysconfig/; fi - @$(MAKE) mknod_devices install-network: create-dirs create-service-dir @@ -138,7 +137,7 @@ install-service-mtu: create-service-dir install -m ${MODE} contrib/sysconfig/network-devices/services/mtu ${EXTDIR}/sysconfig/network-devices/services -install-minimal: create-dirs create-service-dir udev_device_dirs udev_device_links +install-minimal: create-dirs create-service-dir sed -e 's|/bin:/usr/bin:/sbin:/usr/sbin|/tools/bin:/tools/sbin:/bin:/sbin|g' clfs/init.d/functions > clfs/init.d/functions.minimal install -m ${MODE} clfs/init.d/checkfs ${EXTDIR}/rc.d/init.d/ install -m ${MODE} clfs/init.d/cleanfs ${EXTDIR}/rc.d/init.d/ @@ -170,7 +169,6 @@ ln -sf ../init.d/setclock ${EXTDIR}/rc.d/rcsysinit.d/S60setclock if [ ! -f ${EXTDIR}/sysconfig/rc ]; then install -m ${CONFMODE} clfs/sysconfig/rc ${EXTDIR}/sysconfig/; fi if [ ! -f ${EXTDIR}/sysconfig/createfiles ]; then install -m ${CONFMODE} clfs/sysconfig/createfiles ${EXTDIR}/sysconfig/; fi - @$(MAKE) mknod_devices install-raq2: create-dirs install -m ${MODE} clfs/init.d/paneld ${EXTDIR}/rc.d/init.d/ diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/checkfs bootscripts-cross-lfs-3.0-pre1/clfs/init.d/checkfs --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/checkfs 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/checkfs 2014-05-17 00:02:04.100001526 +0000 @@ -25,7 +25,7 @@ # ######################################################################### -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/cleanfs bootscripts-cross-lfs-3.0-pre1/clfs/init.d/cleanfs --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/cleanfs 2012-09-05 02:21:09.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/cleanfs 2014-05-17 00:02:04.100001526 +0000 @@ -12,13 +12,13 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} # Function to create files/directory on boot. create_files() { # Read in the configuration file. - exec 9>&0 < /etc/sysconfig/createfiles + exec 9>&0 < /tools/etc/sysconfig/createfiles while read name type perm usr grp dtype maj min junk do @@ -87,8 +87,8 @@ (exit ${failed}) evaluate_retval boot_mesg "" ${NORMAL} - if [ -e /etc/sysconfig/createfiles ]; then - if egrep -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null; then + if [ -e /tools/etc/sysconfig/createfiles ]; then + if egrep -qv '^(#|$)' /tools/etc/sysconfig/createfiles 2>/dev/null; then boot_mesg "Creating files and directories..." create_files evaluate_retval diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/consolelog bootscripts-cross-lfs-3.0-pre1/clfs/init.d/consolelog --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/consolelog 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/consolelog 2014-05-17 00:02:04.100001526 +0000 @@ -13,13 +13,13 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} # set the default loglevel LOGLEVEL=7 -if [ -r /etc/sysconfig/console ]; then - . /etc/sysconfig/console +if [ -r /tools/etc/sysconfig/console ]; then + . /tools/etc/sysconfig/console fi case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/functions bootscripts-cross-lfs-3.0-pre1/clfs/init.d/functions --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/functions 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/functions 2014-05-17 00:03:00.800003131 +0000 @@ -13,14 +13,14 @@ # ######################################################################## -if [ -e /etc/sysconfig/lcd ]; then +if [ -e /tools/etc/sysconfig/lcd ]; then if [ -e /dev/lcd ]; then - source /etc/sysconfig/lcd + source /tools/etc/sysconfig/lcd fi fi -if [ -e /etc/sysconfig/bootscripts ]; then - source /etc/sysconfig/bootscripts +if [ -e /tools/etc/sysconfig/bootscripts ]; then + source /tools/etc/sysconfig/bootscripts fi ## Environmental setup @@ -54,7 +54,7 @@ # If formatting is needed, $ECHO should be used case "`echo -e -n test`" in -[en]*) - ECHO=/bin/echo + ECHO=/tools/bin/echo ;; *) ECHO=echo @@ -153,7 +153,7 @@ boot_log() { if [ "$LOGGING" ]; then - /bin/logger -p local2.info -t bootlog "${DISPLAYLOG} ${1}" + /tools/bin/logger -p local2.info -t bootlog "${DISPLAYLOG} ${1}" else return 0 fi diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/functions.minimal bootscripts-cross-lfs-3.0-pre1/clfs/init.d/functions.minimal --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/functions.minimal 2012-03-13 18:41:15.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/functions.minimal 2014-05-17 00:03:59.963337110 +0000 @@ -13,14 +13,14 @@ # ######################################################################## -if [ -e /etc/sysconfig/lcd ]; then +if [ -e /tools/etc/sysconfig/lcd ]; then if [ -e /dev/lcd ]; then - source /etc/sysconfig/lcd + source /tools/etc/sysconfig/lcd fi fi -if [ -e /etc/sysconfig/bootscripts ]; then - source /etc/sysconfig/bootscripts +if [ -e /tools/etc/sysconfig/bootscripts ]; then + source /tools/etc/sysconfig/bootscripts fi ## Environmental setup @@ -54,7 +54,7 @@ # If formatting is needed, $ECHO should be used case "`echo -e -n test`" in -[en]*) - ECHO=/bin/echo + ECHO=/tools/bin/echo ;; *) ECHO=echo @@ -153,7 +153,7 @@ boot_log() { if [ "$LOGGING" ]; then - /bin/logger -p local2.info -t bootlog "${DISPLAYLOG} ${1}" + /tools/bin/logger -p local2.info -t bootlog "${DISPLAYLOG} ${1}" else return 0 fi diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/halt bootscripts-cross-lfs-3.0-pre1/clfs/init.d/halt --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/halt 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/halt 2014-05-17 00:02:04.103335102 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/i18n bootscripts-cross-lfs-3.0-pre1/clfs/init.d/i18n --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/i18n 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/i18n 2014-05-17 00:02:04.103335102 +0000 @@ -12,11 +12,11 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} -if [ -f /etc/sysconfig/i18n ]; then - . /etc/sysconfig/i18n +if [ -f /tools/etc/sysconfig/i18n ]; then + . /tools/etc/sysconfig/i18n fi case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/localnet bootscripts-cross-lfs-3.0-pre1/clfs/init.d/localnet --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/localnet 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/localnet 2014-05-17 00:02:04.103335102 +0000 @@ -12,9 +12,9 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} -. /etc/sysconfig/network +. /tools/etc/sysconfig/network case "${1}" in start) diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/modules bootscripts-cross-lfs-3.0-pre1/clfs/init.d/modules --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/modules 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/modules 2014-05-17 00:02:04.103335102 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} # Assure that the kernel has module support. @@ -23,8 +23,8 @@ # Exit if there's no modules file or there are no # valid entries - [ -r /etc/sysconfig/modules ] && - egrep -qv '^($|#)' /etc/sysconfig/modules || + [ -r /tools/etc/sysconfig/modules ] && + egrep -qv '^($|#)' /tools/etc/sysconfig/modules || exit 0 boot_mesg -n "Loading modules:" ${INFO} @@ -49,7 +49,7 @@ else failedmod="${failedmod} ${module}" fi - done < /etc/sysconfig/modules + done < /tools/etc/sysconfig/modules boot_mesg "" ${NORMAL} # Print a message about successfully loaded diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/mountfs bootscripts-cross-lfs-3.0-pre1/clfs/init.d/mountfs --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/mountfs 2012-09-05 02:21:09.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/mountfs 2014-05-17 00:02:34.460003607 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "${1}" in @@ -24,16 +24,6 @@ # Remove fsck-related file system watermarks. rm -f /fastboot /forcefsck - boot_mesg "Recording existing mounts in /etc/mtab..." - > /etc/mtab - mount -f / || failed=1 - mount -f /proc || failed=1 - mount -f /sys || failed=1 - mount -f /run || failed=1 - mount -f /dev || failed=1 - (exit ${failed}) - evaluate_retval - # This will mount all filesystems that do not have _netdev in # their option list. _netdev denotes a network filesystem. boot_mesg "Mounting remaining file systems..." diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/mountkernfs bootscripts-cross-lfs-3.0-pre1/clfs/init.d/mountkernfs --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/mountkernfs 2012-09-05 02:21:09.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/mountkernfs 2014-05-17 00:02:04.103335102 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/network bootscripts-cross-lfs-3.0-pre1/clfs/init.d/network --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/network 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/network 2014-05-17 00:02:04.106668584 +0000 @@ -14,9 +14,9 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} -. /etc/sysconfig/network +. /tools/etc/sysconfig/network case "${1}" in start) @@ -70,4 +70,4 @@ ;; esac -# End /etc/rc.d/init.d/network +# End /tools/etc/rc.d/init.d/network diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/paneld bootscripts-cross-lfs-3.0-pre1/clfs/init.d/paneld --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/paneld 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/paneld 2014-05-17 00:02:04.106668584 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . $rc_functions case "$1" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/rc bootscripts-cross-lfs-3.0-pre1/clfs/init.d/rc --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/rc 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/rc 2014-05-17 00:02:04.106668584 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} # This sets a few default terminal options. diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/reboot bootscripts-cross-lfs-3.0-pre1/clfs/init.d/reboot --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/reboot 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/reboot 2014-05-17 00:02:04.106668584 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/rsyslog bootscripts-cross-lfs-3.0-pre1/clfs/init.d/rsyslog --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/rsyslog 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/rsyslog 2014-05-17 00:02:04.106668584 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/sendsignals bootscripts-cross-lfs-3.0-pre1/clfs/init.d/sendsignals --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/sendsignals 2012-09-05 02:21:09.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/sendsignals 2014-05-17 00:02:04.110002078 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/setclock bootscripts-cross-lfs-3.0-pre1/clfs/init.d/setclock --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/setclock 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/setclock 2014-05-17 00:02:04.110002078 +0000 @@ -12,9 +12,9 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} -. /etc/sysconfig/clock +. /tools/etc/sysconfig/clock CLOCKPARAMS= diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/setlcd bootscripts-cross-lfs-3.0-pre1/clfs/init.d/setlcd --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/setlcd 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/setlcd 2014-05-17 00:02:04.110002078 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . $rc_functions case "$1" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/swap bootscripts-cross-lfs-3.0-pre1/clfs/init.d/swap --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/swap 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/swap 2014-05-17 00:02:04.110002078 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/sysctl bootscripts-cross-lfs-3.0-pre1/clfs/init.d/sysctl --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/sysctl 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/sysctl 2014-05-17 00:02:04.110002078 +0000 @@ -14,7 +14,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/template bootscripts-cross-lfs-3.0-pre1/clfs/init.d/template --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/template 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/template 2014-05-17 00:02:04.110002078 +0000 @@ -12,7 +12,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "${1}" in diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/udev bootscripts-cross-lfs-3.0-pre1/clfs/init.d/udev --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/init.d/udev 2013-08-07 19:54:26.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/init.d/udev 2014-05-17 00:02:04.113335656 +0000 @@ -16,7 +16,7 @@ # ######################################################################## -. /etc/sysconfig/rc +. /tools/etc/sysconfig/rc . ${rc_functions} case "$1" in @@ -25,7 +25,7 @@ # start udevd boot_mesg "\nStarting udevd..." - /sbin/udevd --daemon + /tools/sbin/udevd --daemon evaluate_retval # start coldplugging @@ -35,29 +35,29 @@ #mkdir -p /run/.udev/queue # configure all devices - /sbin/udevadm trigger --action=add --type=subsystems - /sbin/udevadm trigger --action=add --type=devices + /tools/sbin/udevadm trigger --action=add --type=subsystems + /tools/sbin/udevadm trigger --action=add --type=devices # this replaces the old loop, exits after all devices are done - /sbin/udevadm settle + /tools/sbin/udevadm settle echo_ok ;; stop) boot_mesg "Stopping udevd..." - killproc /sbin/udevd + killproc /tools/sbin/udevd ;; restart) boot_mesg "Restarting udevd..." - killproc /sbin/udevd - loadproc /sbin/udevd --daemon + killproc /tools/sbin/udevd + loadproc /tools/sbin/udevd --daemon evaluate_retval ;; status) - statusproc /sbin/udevd + statusproc /tools/sbin/udevd ;; *) diff -Naur bootscripts-cross-lfs-3.0-pre1.orig/clfs/sysconfig/rc bootscripts-cross-lfs-3.0-pre1/clfs/sysconfig/rc --- bootscripts-cross-lfs-3.0-pre1.orig/clfs/sysconfig/rc 2009-07-07 01:39:12.000000000 +0000 +++ bootscripts-cross-lfs-3.0-pre1/clfs/sysconfig/rc 2014-05-17 00:03:44.446670264 +0000 @@ -11,8 +11,8 @@ # ######################################################################## -rc_base=/etc/rc.d +rc_base=/tools/etc/rc.d rc_functions=${rc_base}/init.d/functions -network_devices=/etc/sysconfig/network-devices +network_devices=/tools/etc/sysconfig/network-devices # End /etc/sysconfig/rc