Ignore:
Timestamp:
09/19/2011 03:31:46 AM (13 years ago)
Author:
Bruce Dubbs <bdubbs@…>
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:
5a58876
Parents:
103bbd6
Message:

Rename /etc/sysconfig/init_params to /etc/sysconfig/rc.site.
Move network services to /lib/services.
Move init-functions to /lib/lsb.
Make /lib/lsb a symlink to /lib/services.
Create convenience symlink /etc/init.d->/etc/rc.d/init.d
Add help and man pages to ifup/ifdown.

Append /run/var/bootlog to /var/log/boot.log at the end of
the boot sequence.

Add capability to step through the boot scripts at boot time.

Optionally allow environment variables in sysconfig directory's
console, network, and clock files to be placed in rc.site.

Add an optional FASTBOOT parameter to set /fastboot when rebooting.

Remove a minor warning message from udev that is triggered
by the udev_retry boot script.

Add SKIPTMPCLEAN as an optional parameter to skip cleaning /tmp at boot time.

Add a page to Chapter 7 documenting rc.site.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bootscripts/lfs/init.d/checkfs

    r103bbd6 rf874424  
    77# Authors     : Gerard Beekmans - gerard@linuxfromscratch.org
    88#               A. Luebke - luebke@users.sourceforge.net
     9#               DJ Lucas - dj@linuxfromscratch.org
    910# Update      : Bruce Dubbs - bdubbs@linuxfromscratch.org
    1011#
     
    3839### END INIT INFO
    3940
    40 . /lib/boot/functions
     41. /lib/lsb/init-functions
    4142
    4243case "${1}" in
    4344   start)
    4445      if [ -f /fastboot ]; then
    45          boot_mesg -n "/fastboot found, will not perform" ${INFO}
    46          boot_mesg " file system checks as requested."
    47          echo_ok
     46         msg="/fastboot found, will omit "
     47         msg="${msg} file system checks as requested.\n"
     48         log_info_msg "${msg}"
    4849         exit 0
    4950      fi
    5051
    51       boot_mesg "Mounting root file system in read-only mode..."
     52      log_info_msg "Mounting root file system in read-only mode... "
    5253      mount -n -o remount,ro / >/dev/null
    53       evaluate_retval
    5454
    5555      if [ ${?} != 0 ]; then
    56          echo_failure
    57          boot_mesg -n "FAILURE:\n\nCannot check root" ${FAILURE}
    58          boot_mesg -n " filesystem because it could not be mounted"
    59          boot_mesg -n " in read-only mode.\n\nAfter you"
    60          boot_mesg -n " press Enter, this system will be"
    61          boot_mesg -n " halted and powered off."
    62          boot_mesg -n "\n\nPress enter to continue..." ${INFO}
    63          boot_mesg "" ${NORMAL}
     56         log_failure_msg2
     57         msg="\n\nCannot check root "
     58         msg="${msg}filesystem because it could not be mounted "
     59         msg="${msg}in read-only mode.\n\n"
     60         msg="${msg}After you press Enter, this system will be "
     61         msg="${msg}halted and powered off.\n\n"
     62         log_failure_msg "${msg}"
     63
     64         log_info_msg "Press Enter to continue..."
    6465         wait_for_user
    6566         /etc/rc.d/init.d/halt stop
     67      else
     68         log_success_msg2
    6669      fi
    6770
    6871      if [ -f /forcefsck ]; then
    69          boot_mesg -n "/forcefsck found, forcing file" ${INFO}
    70          boot_mesg " system checks as requested."
    71          echo_ok
     72         msg="\n/forcefsck found, forcing file"
     73         msg="${msg} system checks as requested."
     74         log_success_msg "$msg"
    7275         options="-f"
    7376      else
     
    7578      fi
    7679
    77       boot_mesg "Checking file systems..."
    78       # Note: -a option used to be -p; but this fails e.g.
    79       # on fsck.minix
     80      log_info_msg "Checking file systems..."
     81      # Note: -a option used to be -p; but this fails e.g. on fsck.minix
    8082      fsck ${options} -a -A -C -T
    8183      error_value=${?}
    8284
    8385      if [ "${error_value}" = 0 ]; then
    84          echo_ok
     86         log_success_msg2
    8587      fi
    8688
    8789      if [ "${error_value}" = 1 ]; then
    88          echo_warning
    89          boot_mesg -n "WARNING:\n\nFile system errors" ${WARNING}
    90          boot_mesg -n " were found and have been corrected. "
    91          boot_mesg -n " You may want to double-check that"
    92          boot_mesg -n " everything was fixed properly."
    93          boot_mesg "" ${NORMAL}
     90         msg="\nWARNING:\n\nFile system errors "
     91         msg="${msg}were found and have been corrected.\n"
     92         msg="${msg}You may want to double-check that "
     93         msg="${msg}everything was fixed properly."
     94         log_warning_msg "$msg"
    9495      fi
    9596
    9697      if [ "${error_value}" = 2 -o "${error_value}" = 3 ]; then
    97          echo_warning
    98          boot_mesg -n "WARNING:\n\nFile system errors" ${WARNING}
    99          boot_mesg -n " were found and have been been"
    100          boot_mesg -n " corrected, but the nature of the"
    101          boot_mesg -n " errors require this system to be"
    102          boot_mesg -n " rebooted.\n\nAfter you press enter,"
    103          boot_mesg -n " this system will be rebooted"
    104          boot_mesg -n "\n\nPress Enter to continue..." ${INFO}
    105          boot_mesg "" ${NORMAL}
     98         msg="\nWARNING:\n\nFile system errors "
     99         msg="${msg}were found and have been been "
     100         msg="${msg}corrected, but the nature of the "
     101         msg="${msg}errors require this system to be rebooted.\n\n"
     102         msg="${msg}After you press enter, "
     103         msg="${msg}this system will be rebooted\n\n"
     104         log_failure_msg "$msg"
     105
     106         log_info_msg "Press Enter to continue..."
    106107         wait_for_user
    107108         reboot -f
     
    109110
    110111      if [ "${error_value}" -gt 3 -a "${error_value}" -lt 16 ]; then
    111          echo_failure
    112          boot_mesg -n "FAILURE:\n\nFile system errors" ${FAILURE}
    113          boot_mesg -n " were encountered that could not be"
    114          boot_mesg -n " fixed automatically.  This system"
    115          boot_mesg -n " cannot continue to boot and will"
    116          boot_mesg -n " therefore be halted until those"
    117          boot_mesg -n " errors are fixed manually by a"
    118          boot_mesg -n " System Administrator.\n\nAfter you"
    119          boot_mesg -n " press Enter, this system will be"
    120          boot_mesg -n " halted and powered off."
    121          boot_mesg -n "\n\nPress Enter to continue..." ${INFO}
    122          boot_mesg "" ${NORMAL}
     112         msg="\nFAILURE:\n\nFile system errors "
     113         msg="${msg}were encountered that could not be "
     114         msg="${msg}fixed automatically.  This system "
     115         msg="${msg}cannot continue to boot and will "
     116         msg="${msg}therefore be halted until those "
     117         msg="${msg}errors are fixed manually by a "
     118         msg="${msg}System Administrator.\n\n"
     119         msg="${msg}After you press Enter, this system will be "
     120         msg="${msg}halted and powered off.\n\n"
     121         log_failure_msg "$msg"
     122
     123         log_info_msg "Press Enter to continue..."
    123124         wait_for_user
    124         /etc/rc.d/init.d/halt stop
     125         /etc/rc.d/init.d/halt stop
    125126      fi
    126127
    127128      if [ "${error_value}" -ge 16 ]; then
    128          echo_failure
    129          boot_mesg -n "FAILURE:\n\nUnexpected Failure" ${FAILURE}
    130          boot_mesg -n " running fsck.  Exited with error"
    131          boot_mesg -n " code: ${error_value}."
    132          boot_mesg "" ${NORMAL}
     129         msg="\nFAILURE:\n\nUnexpected Failure "
     130         msg="${msg}running fsck.  Exited with error "
     131         msg="${msg} code: ${error_value}."
     132         log_failure_msg $msg
    133133         exit ${error_value}
    134134      fi
     135
     136      exit 0
    135137      ;;
    136138   *)
Note: See TracChangeset for help on using the changeset viewer.