Changeset a44ae577 for bootscripts/lfs/init.d
- Timestamp:
- 09/07/2021 09:01:23 PM (3 years ago)
- Branches:
- 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, arm, bdubbs/gcc13, 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:
- 408fb782
- Parents:
- e7fb2ca
- Location:
- bootscripts/lfs/init.d
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
bootscripts/lfs/init.d/checkfs
re7fb2ca ra44ae577 62 62 log_failure_msg "${msg}" 63 63 64 log_info_msg "Press Enter to continue..." 64 log_info_msg "Press Enter to continue..." 65 65 wait_for_user 66 66 /etc/rc.d/init.d/halt stop … … 70 70 71 71 if [ -f /forcefsck ]; then 72 msg="/forcefsck found, forcing file" 72 msg="/forcefsck found, forcing file" 73 73 msg="${msg} system checks as requested." 74 74 log_success_msg "$msg" … … 109 109 log_failure_msg "$msg" 110 110 111 log_info_msg "Press Enter to continue..." 111 log_info_msg "Press Enter to continue..." 112 112 wait_for_user 113 113 reboot -f … … 126 126 log_failure_msg "$msg" 127 127 128 log_info_msg "Press Enter to continue..." 128 log_info_msg "Press Enter to continue..." 129 129 wait_for_user 130 130 /etc/rc.d/init.d/halt stop -
bootscripts/lfs/init.d/cleanfs
re7fb2ca ra44ae577 23 23 # Short-Description: Cleans temporary directories early in the boot process. 24 24 # Description: Cleans temporary directories /run, /var/lock, and 25 # optionally, /tmp. cleanfs also creates /run/utmp 25 # optionally, /tmp. cleanfs also creates /run/utmp 26 26 # and any files defined in /etc/sysconfig/createfiles. 27 27 # X-LFS-Provided-By: LFS … … 31 31 32 32 # Function to create files/directory on boot. 33 create_files() 33 create_files() 34 34 { 35 35 # Input to file descriptor 9 and output to stdin (redirection) … … 64 64 mknod "${name}" p 65 65 ;; 66 *) 67 log_warning_msg "\nUnknown device type: ${dtype}" 66 *) 67 log_warning_msg "\nUnknown device type: ${dtype}" 68 68 ;; 69 69 esac 70 70 ;; 71 71 *) 72 log_warning_msg "\nUnknown type: ${type}" 72 log_warning_msg "\nUnknown type: ${type}" 73 73 continue 74 74 ;; … … 88 88 case "${1}" in 89 89 start) 90 log_info_msg "Cleaning file systems:" 90 log_info_msg "Cleaning file systems:" 91 91 92 92 if [ "${SKIPTMPCLEAN}" = "" ]; then 93 log_info_msg2 " /tmp" 93 log_info_msg2 " /tmp" 94 94 cd /tmp && 95 95 find . -xdev -mindepth 1 ! -name lost+found -delete || failed=1 -
bootscripts/lfs/init.d/console
re7fb2ca ra44ae577 33 33 [ -r /etc/sysconfig/console ] && . /etc/sysconfig/console 34 34 35 is_true() 35 is_true() 36 36 { 37 37 [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] … … 44 44 # See if we need to do anything 45 45 if [ -z "${KEYMAP}" ] && [ -z "${KEYMAP_CORRECTIONS}" ] && 46 [ -z "${FONT}" ] && [ -z "${LEGACY_CHARSET}" ] && 47 ! is_true "${UNICODE}"; then 46 [ -z "${FONT}" ] && [ -z "${LEGACY_CHARSET}" ] && 47 ! is_true "${UNICODE}"; then 48 48 exit 0 49 49 fi … … 86 86 loadkeys ${KEYMAP} >/dev/null 2>&1 || 87 87 failed=1 88 88 89 89 [ -z "${KEYMAP_CORRECTIONS}" ] || 90 90 loadkeys ${KEYMAP_CORRECTIONS} >/dev/null 2>&1 || … … 98 98 # If any of the commands above failed, the trap at the 99 99 # top would set $failed to 1 100 ( exit $failed ) 100 ( exit $failed ) 101 101 evaluate_retval 102 102 103 103 exit $failed 104 ;; 104 ;; 105 105 106 *) 106 *) 107 107 echo "Usage: ${0} {start}" 108 exit 1 109 ;; 108 exit 1 109 ;; 110 110 esac 111 111 -
bootscripts/lfs/init.d/modules
re7fb2ca ra44ae577 38 38 egrep -qv '^($|#)' /etc/sysconfig/modules || exit 0 39 39 40 log_info_msg "Loading modules:" 40 log_info_msg "Loading modules:" 41 41 42 42 # Only try to load modules if the user has actually given us … … 55 55 # Print the module name if successful, otherwise take note. 56 56 if [ $? -eq 0 ]; then 57 log_info_msg2 " ${module}" 57 log_info_msg2 " ${module}" 58 58 else 59 59 failedmod="${failedmod} ${module}" … … 64 64 log_success_msg2 65 65 66 # Print a failure message with a list of any modules that 66 # Print a failure message with a list of any modules that 67 67 # may have failed to load. 68 68 if [ -n "${failedmod}" ]; then 69 log_failure_msg "Failed to load modules:${failedmod}" 69 log_failure_msg "Failed to load modules:${failedmod}" 70 70 exit 1 71 71 fi -
bootscripts/lfs/init.d/mountvirtfs
re7fb2ca ra44ae577 40 40 chmod 1777 /run/shm /run/lock 41 41 42 log_info_msg "Mounting virtual file systems: ${INFO}/run" 42 log_info_msg "Mounting virtual file systems: ${INFO}/run" 43 43 44 44 if ! mountpoint /proc >/dev/null; then … … 48 48 49 49 if ! mountpoint /sys >/dev/null; then 50 log_info_msg2 " ${INFO}/sys" 50 log_info_msg2 " ${INFO}/sys" 51 51 mount -o nosuid,noexec,nodev /sys || failed=1 52 52 fi 53 53 54 54 if ! mountpoint /dev >/dev/null; then 55 log_info_msg2 " ${INFO}/dev" 55 log_info_msg2 " ${INFO}/dev" 56 56 mount -o mode=0755,nosuid /dev || failed=1 57 57 fi 58 58 59 59 ln -sfn /run/shm /dev/shm 60 60 61 61 (exit ${failed}) 62 62 evaluate_retval -
bootscripts/lfs/init.d/network
re7fb2ca ra44ae577 44 44 stop) 45 45 # Unmount any network mounted file systems 46 umount --all --force --types nfs,cifs,nfs4 46 umount --all --force --types nfs,cifs,nfs4 47 47 48 48 # Reverse list -
bootscripts/lfs/init.d/rc
re7fb2ca ra44ae577 19 19 log_failure_msg 20 20 # $i is set when called 21 MSG="FAILURE:\n\nYou should not be reading this error message.\n\n" 21 MSG="FAILURE:\n\nYou should not be reading this error message.\n\n" 22 22 MSG="${MSG}It means that an unforeseen error took place in\n" 23 23 MSG="${MSG}${i},\n" 24 24 MSG="${MSG}which exited with a return value of ${error_value}.\n" 25 25 26 26 MSG="${MSG}If you're able to track this error down to a bug in one of\n" 27 27 MSG="${MSG}the files provided by the ${DISTRO_MINI} book,\n" … … 37 37 # $i is set when called 38 38 if [ ! -f ${i} ]; then 39 log_warning_msg "${i} is not a valid symlink." 39 log_warning_msg "${i} is not a valid symlink." 40 40 SCRIPT_STAT="1" 41 41 fi … … 103 103 104 104 if [ ! -d /etc/rc.d/rc${runlevel}.d ]; then 105 log_info_msg "/etc/rc.d/rc${runlevel}.d does not exist.\n" 105 log_info_msg "/etc/rc.d/rc${runlevel}.d does not exist.\n" 106 106 exit 1 107 107 fi … … 110 110 111 111 # Note: In ${LOGLEVEL:-7}, it is ':' 'dash' '7', not minus 7 112 if [ "$runlevel" == "S" ]; then 113 [ -r /etc/sysconfig/console ] && source /etc/sysconfig/console 114 dmesg -n "${LOGLEVEL:-7}" 112 if [ "$runlevel" == "S" ]; then 113 [ -r /etc/sysconfig/console ] && source /etc/sysconfig/console 114 dmesg -n "${LOGLEVEL:-7}" 115 115 fi 116 116 … … 226 226 if [ "${previous}" == "N" -a "${runlevel}" != "S" ]; then 227 227 cat $BOOTLOG >> /var/log/boot.log 228 228 229 229 # Mark the end of boot 230 230 echo "--------" >> /var/log/boot.log 231 231 232 232 # Remove the temporary file 233 233 rm -f $BOOTLOG 2> /dev/null -
bootscripts/lfs/init.d/setclock
re7fb2ca ra44ae577 14 14 15 15 ### BEGIN INIT INFO 16 # Provides: 16 # Provides: 17 17 # Required-Start: 18 18 # Should-Start: modules -
bootscripts/lfs/init.d/swap
re7fb2ca ra44ae577 49 49 50 50 status) 51 log_success_msg "Retrieving swap status." 51 log_success_msg "Retrieving swap status." 52 52 swapon -s 53 53 ;; -
bootscripts/lfs/init.d/udev
re7fb2ca ra44ae577 61 61 # If any LVM based partitions are on the system, ensure they 62 62 # are activated so they can be used. 63 if [ -x /sbin/vgchange ]; then /sbin/vgchange -a y >/dev/null; fi 63 if [ -x /sbin/vgchange ]; then /sbin/vgchange -a y >/dev/null; fi 64 64 65 log_success_msg2 65 log_success_msg2 66 66 ;; 67 67 -
bootscripts/lfs/init.d/udev_retry
re7fb2ca ra44ae577 8 8 # DJ Lucas - dj@linuxfromscratch.org 9 9 # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org 10 # Bryan Kadzban - 10 # Bryan Kadzban - 11 11 # 12 12 # Version : LFS 7.0 … … 40 40 # From Debian: "copy the rules generated before / was mounted 41 41 # read-write": 42 42 43 43 for file in ${rundir}/tmp-rules--*; do 44 44 dest=${file##*tmp-rules--} … … 48 48 done 49 49 50 # Re-trigger the uevents that may have failed, 50 # Re-trigger the uevents that may have failed, 51 51 # in hope they will succeed now 52 52 /bin/sed -e 's/#.*$//' /etc/sysconfig/udev_retry | /bin/grep -v '^$' | \
Note:
See TracChangeset
for help on using the changeset viewer.