diff '--color=auto' -Nuar runit-rc-26fa/Makefile runit-rc-1818/Makefile --- runit-rc-26fa/Makefile 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/Makefile 2023-09-27 04:10:41.923166881 +0300 @@ -28,6 +28,7 @@ sv.d/misc \ sv.d/mount-all \ sv.d/net-lo \ + sv.d/netfs \ sv.d/random-seed \ sv.d/remount-root \ sv.d/swap \ @@ -162,7 +163,6 @@ $(LN) $(RCSVDIR)/random-seed $(DESTDIR)$(RCDIR)/shutdown/10-random-seed $(LN) $(RCSVDIR)/cleanup $(DESTDIR)$(RCDIR)/shutdown/20-cleanup $(LN) $(RCSVDIR)/udev $(DESTDIR)$(RCDIR)/shutdown/30-udev - $(LN) $(RCSVDIR)/hwclock $(DESTDIR)$(RCDIR)/shutdown/35-hwclock $(LN) $(RCSVDIR)/misc $(DESTDIR)$(RCDIR)/shutdown/40-misc $(LN) $(RCSVDIR)/swap $(DESTDIR)$(RCDIR)/shutdown/50-swap $(LN) $(RCSVDIR)/root $(DESTDIR)$(RCDIR)/shutdown/60-root diff '--color=auto' -Nuar runit-rc-26fa/script/functions runit-rc-1818/script/functions --- runit-rc-26fa/script/functions 2023-09-27 04:08:39.413126197 +0300 +++ runit-rc-1818/script/functions 2023-09-27 04:10:42.396500246 +0300 @@ -6,6 +6,7 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" . /etc/profile.d/locale.sh +. /etc/rc/rc.conf # width: calc_columns () { @@ -60,6 +61,14 @@ printf " ${C_OTHER}[${C_BUSY}busy${C_OTHER}]${C_CLEAR} " } +substat() { + printf " ${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} \n" +} + +ck_verbose() { + [[ "$VERBOSE" == "on" ]] +} + ck_daemon() { [[ ! -f /run/sv.d/started/$1 ]] } @@ -201,11 +210,7 @@ calc_columns # disable colors on broken terminals -if [[ -z "$TERM" || "$TERM" = "dumb" ]]; then - TERM_COLORS=$(tput colors -T linux 2>/dev/null) -else - TERM_COLORS=$(tput colors 2>/dev/null) -fi +TERM_COLORS=$(tput colors 2>/dev/null) if (( $? != 3 )); then case $TERM_COLORS in *[!0-9]*) USECOLOR="";; diff '--color=auto' -Nuar runit-rc-26fa/script/functions.in runit-rc-1818/script/functions.in --- runit-rc-26fa/script/functions.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/script/functions.in 2023-09-27 04:10:41.923166881 +0300 @@ -6,6 +6,7 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" . /etc/profile.d/locale.sh +. @RCDIR@/rc.conf # width: calc_columns () { @@ -60,6 +61,14 @@ printf " ${C_OTHER}[${C_BUSY}busy${C_OTHER}]${C_CLEAR} " } +substat() { + printf " ${C_OTHER}${PREFIX_REG} ${C_MAIN}${1}${C_CLEAR} \n" +} + +ck_verbose() { + [[ "$VERBOSE" == "on" ]] +} + ck_daemon() { [[ ! -f @RCRUNDIR@/started/$1 ]] } @@ -201,11 +210,7 @@ calc_columns # disable colors on broken terminals -if [[ -z "$TERM" || "$TERM" = "dumb" ]]; then - TERM_COLORS=$(tput colors -T linux 2>/dev/null) -else - TERM_COLORS=$(tput colors 2>/dev/null) -fi +TERM_COLORS=$(tput colors 2>/dev/null) if (( $? != 3 )); then case $TERM_COLORS in *[!0-9]*) USECOLOR="";; diff '--color=auto' -Nuar runit-rc-26fa/script/rc.conf runit-rc-1818/script/rc.conf --- runit-rc-26fa/script/rc.conf 2023-09-27 04:08:39.446459552 +0300 +++ runit-rc-1818/script/rc.conf 2023-09-27 04:10:42.423166915 +0300 @@ -27,8 +27,7 @@ # HAVE_CONTROLLER1_GROUPS="true" -# This switch controls whether or not /tmp will be cleaned. -# /tmp will only be cleaned if it is set to "y". Generally it is recommended to -# mount /tmp as tmpfs. +# Verbose mode +# Set to "on" to enable details -# CLEANTMP="n" +# VERBOSE="off" diff '--color=auto' -Nuar runit-rc-26fa/script/rc.conf.in runit-rc-1818/script/rc.conf.in --- runit-rc-26fa/script/rc.conf.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/script/rc.conf.in 2023-09-27 04:10:41.923166881 +0300 @@ -27,8 +27,7 @@ # HAVE_CONTROLLER1_GROUPS="true" -# This switch controls whether or not /tmp will be cleaned. -# /tmp will only be cleaned if it is set to "y". Generally it is recommended to -# mount /tmp as tmpfs. +# Verbose mode +# Set to "on" to enable details -# CLEANTMP="n" +# VERBOSE="off" diff '--color=auto' -Nuar runit-rc-26fa/sv.d/binfmt runit-rc-1818/sv.d/binfmt --- runit-rc-26fa/sv.d/binfmt 2023-09-27 04:08:38.956459237 +0300 +++ runit-rc-1818/sv.d/binfmt 2023-09-27 04:10:42.013166887 +0300 @@ -7,17 +7,12 @@ mountpoint -q /proc/sys/fs/binfmt_misc || \ mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc || return 1 - for files in /proc/sys/fs/binfmt_misc/*; do - [ "$files" = /proc/sys/fs/binfmt_misc/register ] && continue - [ "$files" = /proc/sys/fs/binfmt_misc/status ] && continue - echo -1 > "$files" - done - for path in /usr/lib/binfmt.d /etc/binfmt.d /run/binfmt.d; do [[ ! -d $path ]] && continue [[ -z "$(ls $path)" ]] && continue - grep -h "^:" $path/* | \ + grep "^:" $path/* | \ while read -r line; do + ck_verbose && substat "Registering $line" printf "%s" "$line" > /proc/sys/fs/binfmt_misc/register || return 1 done done @@ -33,13 +28,8 @@ add_daemon binfmt stat_done binfmt ;; - once) - stat_busy "Running binfmt" - mount_binfmt || stat_die binfmt - stat_done - ;; *) - echo "usage: $0 {start|once}" + echo "usage: $0 {start}" exit 1 ;; esac diff '--color=auto' -Nuar runit-rc-26fa/sv.d/binfmt.in runit-rc-1818/sv.d/binfmt.in --- runit-rc-26fa/sv.d/binfmt.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/binfmt.in 2023-09-27 04:10:41.923166881 +0300 @@ -7,17 +7,12 @@ mountpoint -q /proc/sys/fs/binfmt_misc || \ mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc || return 1 - for files in /proc/sys/fs/binfmt_misc/*; do - [ "$files" = /proc/sys/fs/binfmt_misc/register ] && continue - [ "$files" = /proc/sys/fs/binfmt_misc/status ] && continue - echo -1 > "$files" - done - for path in /usr/lib/binfmt.d /etc/binfmt.d /run/binfmt.d; do [[ ! -d $path ]] && continue [[ -z "$(ls $path)" ]] && continue - grep -h "^:" $path/* | \ + grep "^:" $path/* | \ while read -r line; do + ck_verbose && substat "Registering $line" printf "%s" "$line" > /proc/sys/fs/binfmt_misc/register || return 1 done done @@ -33,13 +28,8 @@ add_daemon binfmt stat_done binfmt ;; - once) - stat_busy "Running binfmt" - mount_binfmt || stat_die binfmt - stat_done - ;; *) - echo "usage: $0 {start|once}" + echo "usage: $0 {start}" exit 1 ;; esac diff '--color=auto' -Nuar runit-rc-26fa/sv.d/cgroups runit-rc-1818/sv.d/cgroups --- runit-rc-26fa/sv.d/cgroups 2023-09-27 04:08:39.396459520 +0300 +++ runit-rc-1818/sv.d/cgroups 2023-09-27 04:10:42.379833579 +0300 @@ -2,7 +2,6 @@ # sourcing our current rc.conf requires this to be a bash script . /usr/lib/rc/functions -. /etc/rc/rc.conf CGROUP_OPTS=nodev,noexec,nosuid HAVE_CONTROLLER1_GROUPS=${HAVE_CONTROLLER1_GROUPS:-true} diff '--color=auto' -Nuar runit-rc-26fa/sv.d/cgroups.in runit-rc-1818/sv.d/cgroups.in --- runit-rc-26fa/sv.d/cgroups.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/cgroups.in 2023-09-27 04:10:41.923166881 +0300 @@ -2,7 +2,6 @@ # sourcing our current rc.conf requires this to be a bash script . @RCLIBDIR@/functions -. @RCDIR@/rc.conf CGROUP_OPTS=nodev,noexec,nosuid HAVE_CONTROLLER1_GROUPS=${HAVE_CONTROLLER1_GROUPS:-true} diff '--color=auto' -Nuar runit-rc-26fa/sv.d/cleanup runit-rc-1818/sv.d/cleanup --- runit-rc-26fa/sv.d/cleanup 2023-09-27 04:08:38.993125928 +0300 +++ runit-rc-1818/sv.d/cleanup 2023-09-27 04:10:42.043166890 +0300 @@ -2,20 +2,21 @@ # sourcing our current rc.conf requires this to be a bash script . /usr/lib/rc/functions -. /etc/rc/rc.conf cleaning(){ install -m0664 -o root -g utmp /dev/null /run/utmp + ck_verbose && substat "Created /run/utmp" if [ ! -e /var/log/wtmp ]; then install -m0664 -o root -g utmp /dev/null /var/log/wtmp + ck_verbose && substat "Created /var/log/wtmp" fi if [ ! -e /var/log/btmp ]; then install -m0600 -o root -g utmp /dev/null /var/log/btmp + ck_verbose && substat "Created /var/log/btmp" fi rm -f /etc/nologin /forcefsck /forcequotacheck /fastboot - - [ "$CLEANTMP" = y ] && rm -rf /tmp/* + ck_verbose && substat "Removed /etc/nologin, /forcefsck, /forcequotacheck, /fastboot" } case "$1" in diff '--color=auto' -Nuar runit-rc-26fa/sv.d/cleanup.in runit-rc-1818/sv.d/cleanup.in --- runit-rc-26fa/sv.d/cleanup.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/cleanup.in 2023-09-27 04:10:41.926500215 +0300 @@ -2,20 +2,21 @@ # sourcing our current rc.conf requires this to be a bash script . @RCLIBDIR@/functions -. @RCDIR@/rc.conf cleaning(){ install -m0664 -o root -g utmp /dev/null /run/utmp + ck_verbose && substat "Created /run/utmp" if [ ! -e /var/log/wtmp ]; then install -m0664 -o root -g utmp /dev/null /var/log/wtmp + ck_verbose && substat "Created /var/log/wtmp" fi if [ ! -e /var/log/btmp ]; then install -m0600 -o root -g utmp /dev/null /var/log/btmp + ck_verbose && substat "Created /var/log/btmp" fi rm -f /etc/nologin /forcefsck /forcequotacheck /fastboot - - [ "$CLEANTMP" = y ] && rm -rf /tmp/* + ck_verbose && substat "Removed /etc/nologin, /forcefsck, /forcequotacheck, /fastboot" } case "$1" in diff '--color=auto' -Nuar runit-rc-26fa/sv.d/console-setup runit-rc-1818/sv.d/console-setup --- runit-rc-26fa/sv.d/console-setup 2023-09-27 04:08:39.009792606 +0300 +++ runit-rc-1818/sv.d/console-setup 2023-09-27 04:10:42.056500224 +0300 @@ -7,6 +7,7 @@ [ -r /etc/vconsole.conf ] && . /etc/vconsole.conf TTYS=${TTYS:-6} _index=0 + ck_verbose && [ -n "$FONT" ] && substat "Setting font to ${FONT}" while [ ${_index} -le $TTYS ]; do if [ -n "$FONT" ]; then setfont ${FONT_MAP:+-m $FONT_MAP} ${FONT_UNIMAP:+-u $FONT_UNIMAP} \ @@ -16,6 +17,7 @@ _index=$((_index + 1)) done if [ -n "$KEYMAP" ]; then + ck_verbose && substat "Setting keymap to ${KEYMAP}" loadkeys -q -u ${KEYMAP} fi } diff '--color=auto' -Nuar runit-rc-26fa/sv.d/console-setup.in runit-rc-1818/sv.d/console-setup.in --- runit-rc-26fa/sv.d/console-setup.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/console-setup.in 2023-09-27 04:10:41.926500215 +0300 @@ -7,6 +7,7 @@ [ -r /etc/vconsole.conf ] && . /etc/vconsole.conf TTYS=${TTYS:-6} _index=0 + ck_verbose && [ -n "$FONT" ] && substat "Setting font to ${FONT}" while [ ${_index} -le $TTYS ]; do if [ -n "$FONT" ]; then setfont ${FONT_MAP:+-m $FONT_MAP} ${FONT_UNIMAP:+-u $FONT_UNIMAP} \ @@ -16,6 +17,7 @@ _index=$((_index + 1)) done if [ -n "$KEYMAP" ]; then + ck_verbose && substat "Setting keymap to ${KEYMAP}" loadkeys -q -u ${KEYMAP} fi } diff '--color=auto' -Nuar runit-rc-26fa/sv.d/cryptsetup.in runit-rc-1818/sv.d/cryptsetup.in --- runit-rc-26fa/sv.d/cryptsetup.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/cryptsetup.in 2023-09-27 04:10:41.926500215 +0300 @@ -72,7 +72,7 @@ do_unlock() { local name=$1 device=$2 password=$3 options=$4 - printf "${C_MAIN}Unlocking $1${C_CLEAR}\n" + substat "Unlocking $1" if [[ ${options:0:2} =~ -. ]]; then do_unlock_device "$name" "$device" "$password" "$options" @@ -80,7 +80,6 @@ fi do_unlock_device "$name" "$device" "$password" "$options" - esac failed=$? if (( $failed )); then printf "${C_FAIL}Unlocking of $1 failed.${C_CLEAR}\n" diff '--color=auto' -Nuar runit-rc-26fa/sv.d/devfs runit-rc-1818/sv.d/devfs --- runit-rc-26fa/sv.d/devfs 2023-09-27 04:08:39.359792829 +0300 +++ runit-rc-1818/sv.d/devfs 2023-09-27 04:10:42.353166910 +0300 @@ -4,35 +4,15 @@ . /usr/lib/rc/functions mount_devfs(){ - mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid - - # seed /dev with some things that might be needed (for example, - # xudev doesn't do this compared to eudev), code from OpenRC - - # creating /dev/console, /dev/tty and /dev/tty1 to be able to write - # to $CONSOLE with/without bootsplash before udevd creates it - [ -c /dev/console ] || mknod -m 600 /dev/console c 5 1 - [ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1 - [ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0 - - # udevd will dup its stdin/stdout/stderr to /dev/null - # and we do not want a file which gets buffered in ram - [ -c /dev/null ] || mknod -m 666 /dev/null c 1 3 - - # so udev can add its start-message to dmesg - [ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11 - - # extra symbolic links not provided by default - [ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd - [ -e /dev/stdin ] || ln -snf /proc/self/fd/0 /dev/stdin - [ -e /dev/stdout ] || ln -snf /proc/self/fd/1 /dev/stdout - [ -e /dev/stderr ] || ln -snf /proc/self/fd/2 /dev/stderr - [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core - - mkdir -p /dev/pts /dev/shm + ck_verbose && substat "Mounting /dev" + mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid + mkdir -p /dev/{pts,shm} + ck_verbose && substat "Mounting /dev/pts" mountpoint -q /dev/pts || mount -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec + ck_verbose && substat "Mounting /dev/shm" mountpoint -q /dev/shm || mount -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev - mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev + ck_verbose && substat "Mounting /run" + mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev } case "$1" in diff '--color=auto' -Nuar runit-rc-26fa/sv.d/devfs.in runit-rc-1818/sv.d/devfs.in --- runit-rc-26fa/sv.d/devfs.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/devfs.in 2023-09-27 04:10:41.926500215 +0300 @@ -4,35 +4,15 @@ . @RCLIBDIR@/functions mount_devfs(){ - mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid - - # seed /dev with some things that might be needed (for example, - # xudev doesn't do this compared to eudev), code from OpenRC - - # creating /dev/console, /dev/tty and /dev/tty1 to be able to write - # to $CONSOLE with/without bootsplash before udevd creates it - [ -c /dev/console ] || mknod -m 600 /dev/console c 5 1 - [ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1 - [ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0 - - # udevd will dup its stdin/stdout/stderr to /dev/null - # and we do not want a file which gets buffered in ram - [ -c /dev/null ] || mknod -m 666 /dev/null c 1 3 - - # so udev can add its start-message to dmesg - [ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11 - - # extra symbolic links not provided by default - [ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd - [ -e /dev/stdin ] || ln -snf /proc/self/fd/0 /dev/stdin - [ -e /dev/stdout ] || ln -snf /proc/self/fd/1 /dev/stdout - [ -e /dev/stderr ] || ln -snf /proc/self/fd/2 /dev/stderr - [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core - - mkdir -p /dev/pts /dev/shm + ck_verbose && substat "Mounting /dev" + mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid + mkdir -p /dev/{pts,shm} + ck_verbose && substat "Mounting /dev/pts" mountpoint -q /dev/pts || mount -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec + ck_verbose && substat "Mounting /dev/shm" mountpoint -q /dev/shm || mount -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev - mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev + ck_verbose && substat "Mounting /run" + mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev } case "$1" in diff '--color=auto' -Nuar runit-rc-26fa/sv.d/dmesg runit-rc-1818/sv.d/dmesg --- runit-rc-26fa/sv.d/dmesg 2023-09-27 04:08:39.029792618 +0300 +++ runit-rc-1818/sv.d/dmesg 2023-09-27 04:10:42.069833558 +0300 @@ -7,6 +7,8 @@ if [[ -e /proc/sys/kernel/dmesg_restrict ]] && (( $(< /proc/sys/kernel/dmesg_restrict) == 1 )); then install -Tm 0600 <( dmesg ) /var/log/dmesg.log + ck_verbose && substat "dmesg_restrict is enabled" + ck_verbose && substat "dmesg log can only be read by root" else install -Tm 0644 <( dmesg ) /var/log/dmesg.log fi diff '--color=auto' -Nuar runit-rc-26fa/sv.d/dmesg.in runit-rc-1818/sv.d/dmesg.in --- runit-rc-26fa/sv.d/dmesg.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/dmesg.in 2023-09-27 04:10:41.926500215 +0300 @@ -7,6 +7,8 @@ if [[ -e /proc/sys/kernel/dmesg_restrict ]] && (( $(< /proc/sys/kernel/dmesg_restrict) == 1 )); then install -Tm 0600 <( dmesg ) /var/log/dmesg.log + ck_verbose && substat "dmesg_restrict is enabled" + ck_verbose && substat "dmesg log can only be read by root" else install -Tm 0644 <( dmesg ) /var/log/dmesg.log fi diff '--color=auto' -Nuar runit-rc-26fa/sv.d/hostname runit-rc-1818/sv.d/hostname --- runit-rc-26fa/sv.d/hostname 2023-09-27 04:08:39.046459296 +0300 +++ runit-rc-1818/sv.d/hostname 2023-09-27 04:10:42.083166892 +0300 @@ -17,7 +17,7 @@ case "$1" in start) - stat_busy "Starting hostname" + stat_busy "Setting hostname to $HOSTNAME" config add_daemon hostname stat_done diff '--color=auto' -Nuar runit-rc-26fa/sv.d/hostname.in runit-rc-1818/sv.d/hostname.in --- runit-rc-26fa/sv.d/hostname.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/hostname.in 2023-09-27 04:10:41.926500215 +0300 @@ -17,7 +17,7 @@ case "$1" in start) - stat_busy "Starting hostname" + stat_busy "Setting hostname to $HOSTNAME" config add_daemon hostname stat_done diff '--color=auto' -Nuar runit-rc-26fa/sv.d/hwclock runit-rc-1818/sv.d/hwclock --- runit-rc-26fa/sv.d/hwclock 2023-09-27 04:08:39.066459308 +0300 +++ runit-rc-1818/sv.d/hwclock 2023-09-27 04:10:42.099833560 +0300 @@ -1,26 +1,26 @@ #!/bin/bash . /usr/lib/rc/functions -. /etc/rc/rc.conf +HWCLOCK_PARAMS="--systz" HARDWARECLOCK=${HARDWARECLOCK:-UTC} case $HARDWARECLOCK in - UTC) HWCLOCK_PARAMS+=" --utc" ;; - localtime) HWCLOCK_PARAMS+=" --localtime" ;; + UTC) HWCLOCK_PARAMS+=" --utc --noadjfile" ;; + localtime) HWCLOCK_PARAMS+=" --localtime --noadjfile" ;; *) HWCLOCK_PARAMS="";; esac case "$1" in start) - stat_busy "Adjusting hwclock" - hwclock --systz $HWCLOCK_PARAMS --noadjfile || stat_die + stat_busy "Adjusting hwclock to ${HARDWARECLOCK}" + hwclock $HWCLOCK_PARAMS || stat_die add_daemon hwclock stat_done ;; stop) - stat_busy "Adjusting hwclock" - hwclock --systohc $HWCLOCK_PARAMS || stat_die + stat_busy "Adjusting hwclock to ${HARDWARECLOCK}" + hwclock --adjust $HWCLOCK_PARAMS || stat_die rm_daemon hwclock stat_done ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/hwclock.in runit-rc-1818/sv.d/hwclock.in --- runit-rc-26fa/sv.d/hwclock.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/hwclock.in 2023-09-27 04:10:41.926500215 +0300 @@ -1,26 +1,26 @@ #!/bin/bash . @RCLIBDIR@/functions -. @RCDIR@/rc.conf +HWCLOCK_PARAMS="--systz" HARDWARECLOCK=${HARDWARECLOCK:-UTC} case $HARDWARECLOCK in - UTC) HWCLOCK_PARAMS+=" --utc" ;; - localtime) HWCLOCK_PARAMS+=" --localtime" ;; + UTC) HWCLOCK_PARAMS+=" --utc --noadjfile" ;; + localtime) HWCLOCK_PARAMS+=" --localtime --noadjfile" ;; *) HWCLOCK_PARAMS="";; esac case "$1" in start) - stat_busy "Adjusting hwclock" - hwclock --systz $HWCLOCK_PARAMS --noadjfile || stat_die + stat_busy "Adjusting hwclock to ${HARDWARECLOCK}" + hwclock $HWCLOCK_PARAMS || stat_die add_daemon hwclock stat_done ;; stop) - stat_busy "Adjusting hwclock" - hwclock --systohc $HWCLOCK_PARAMS || stat_die + stat_busy "Adjusting hwclock to ${HARDWARECLOCK}" + hwclock --adjust $HWCLOCK_PARAMS || stat_die rm_daemon hwclock stat_done ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/misc runit-rc-1818/sv.d/misc --- runit-rc-26fa/sv.d/misc 2023-09-27 04:08:39.099792663 +0300 +++ runit-rc-1818/sv.d/misc 2023-09-27 04:10:42.126500228 +0300 @@ -6,14 +6,17 @@ # Check local filesystems fsck_all() { if [[ -f /forcefsck ]] || in_array forcefsck $(< /proc/cmdline); then + ck_verbose && substat "/forcefsck found, forcing fsck" FORCEFSCK="-f" elif [[ -f /fastboot ]] || in_array fastboot $(< /proc/cmdline); then + ck_verbose && substat "/fastboot found, canceling fsck" return 0 elif [[ -e /run/initramfs/root-fsck ]]; then + ck_verbose && substat "Ignoring mounted filesystems in fsck" IGNORE_MOUNTED="-M" fi - fsck -A -T -M -C${FSCK_FD} -a -t no${NETFS//,/,no},noopts=_netdev ${IGNORE_MOUNTED} -- ${FORCEFSCK} + fsck -A -T -C${FSCK_FD} -a -t no${NETFS//,/,no},noopts=_netdev ${IGNORE_MOUNTED} -- ${FORCEFSCK} } # Single-user login and/or automatic reboot after fsck (if needed) @@ -44,7 +47,7 @@ echo sulogin -p fi - echo "Automatic reboot in progress..." + echo "Automatic reboot in progress" umount -a mount -o remount,ro / reboot -f @@ -62,8 +65,10 @@ } kill_all(){ + ck_verbose && substat "Killing processes using SIGTERM" pkill --inverse -s0,1 -TERM sleep 1 + ck_verbose && substat "Killing processes using SIGKILL" pkill --inverse -s0,1 -KILL } diff '--color=auto' -Nuar runit-rc-26fa/sv.d/misc.in runit-rc-1818/sv.d/misc.in --- runit-rc-26fa/sv.d/misc.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/misc.in 2023-09-27 04:10:41.926500215 +0300 @@ -6,14 +6,17 @@ # Check local filesystems fsck_all() { if [[ -f /forcefsck ]] || in_array forcefsck $(< /proc/cmdline); then + ck_verbose && substat "/forcefsck found, forcing fsck" FORCEFSCK="-f" elif [[ -f /fastboot ]] || in_array fastboot $(< /proc/cmdline); then + ck_verbose && substat "/fastboot found, canceling fsck" return 0 elif [[ -e /run/initramfs/root-fsck ]]; then + ck_verbose && substat "Ignoring mounted filesystems in fsck" IGNORE_MOUNTED="-M" fi - fsck -A -T -M -C${FSCK_FD} -a -t no${NETFS//,/,no},noopts=_netdev ${IGNORE_MOUNTED} -- ${FORCEFSCK} + fsck -A -T -C${FSCK_FD} -a -t no${NETFS//,/,no},noopts=_netdev ${IGNORE_MOUNTED} -- ${FORCEFSCK} } # Single-user login and/or automatic reboot after fsck (if needed) @@ -44,7 +47,7 @@ echo sulogin -p fi - echo "Automatic reboot in progress..." + echo "Automatic reboot in progress" umount -a mount -o remount,ro / reboot -f @@ -62,8 +65,10 @@ } kill_all(){ + ck_verbose && substat "Killing processes using SIGTERM" pkill --inverse -s0,1 -TERM sleep 1 + ck_verbose && substat "Killing processes using SIGKILL" pkill --inverse -s0,1 -KILL } diff '--color=auto' -Nuar runit-rc-26fa/sv.d/mount-all runit-rc-1818/sv.d/mount-all --- runit-rc-26fa/sv.d/mount-all 2023-09-27 04:08:39.119792676 +0300 +++ runit-rc-1818/sv.d/mount-all 2023-09-27 04:10:42.143166896 +0300 @@ -3,10 +3,12 @@ # sourcing our current rc.conf requires this to be a bash script . /usr/lib/rc/functions +ck_verbose && MOUNT_VERBOSE="-v" + case "$1" in start) stat_busy "Starting mount-all" - mount -a -t "no${NETFS//,/,no}" -O no_netdev || stat_die mount-all + mount -a "${MOUNT_VERBOSE}" -t "no${NETFS//,/,no}" -O no_netdev || stat_die mount-all add_daemon mount-all stat_done mount-all ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/mount-all.in runit-rc-1818/sv.d/mount-all.in --- runit-rc-26fa/sv.d/mount-all.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/mount-all.in 2023-09-27 04:10:41.926500215 +0300 @@ -3,10 +3,12 @@ # sourcing our current rc.conf requires this to be a bash script . @RCLIBDIR@/functions +ck_verbose && MOUNT_VERBOSE="-v" + case "$1" in start) stat_busy "Starting mount-all" - mount -a -t "no${NETFS//,/,no}" -O no_netdev || stat_die mount-all + mount -a "${MOUNT_VERBOSE}" -t "no${NETFS//,/,no}" -O no_netdev || stat_die mount-all add_daemon mount-all stat_done mount-all ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/netfs runit-rc-1818/sv.d/netfs --- runit-rc-26fa/sv.d/netfs 1970-01-01 02:00:00.000000000 +0200 +++ runit-rc-1818/sv.d/netfs 2023-09-27 04:10:42.169833565 +0300 @@ -0,0 +1,34 @@ +#!/bin/bash + +# sourcing our current rc.conf requires this to be a bash script +. /usr/lib/rc/functions + +case "$1" in + start) + stat_busy "Mounting network filesystems" + mount -a -t "$NETFS" + rc=$? + mount -a -O _netdev + (( rc || $? )) && stat_die + add_daemon netfs + stat_done + ;; + stop) + stat_busy "Unmounting network filesystems" + umount -a -f -O _netdev + rc=$? + umount -a -f -t "$NETFS" + (( rc || $? )) && stat_die + rm_daemon netfs + stat_done + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" + exit 1 + ;; +esac diff '--color=auto' -Nuar runit-rc-26fa/sv.d/netfs.in runit-rc-1818/sv.d/netfs.in --- runit-rc-26fa/sv.d/netfs.in 1970-01-01 02:00:00.000000000 +0200 +++ runit-rc-1818/sv.d/netfs.in 2023-09-27 04:10:41.926500215 +0300 @@ -0,0 +1,34 @@ +#!/bin/bash + +# sourcing our current rc.conf requires this to be a bash script +. @RCLIBDIR@/functions + +case "$1" in + start) + stat_busy "Mounting network filesystems" + mount -a -t "$NETFS" + rc=$? + mount -a -O _netdev + (( rc || $? )) && stat_die + add_daemon netfs + stat_done + ;; + stop) + stat_busy "Unmounting network filesystems" + umount -a -f -O _netdev + rc=$? + umount -a -f -t "$NETFS" + (( rc || $? )) && stat_die + rm_daemon netfs + stat_done + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" + exit 1 + ;; +esac diff '--color=auto' -Nuar runit-rc-26fa/sv.d/net-lo runit-rc-1818/sv.d/net-lo --- runit-rc-26fa/sv.d/net-lo 2023-09-27 04:08:39.136459353 +0300 +++ runit-rc-1818/sv.d/net-lo 2023-09-27 04:10:42.156500231 +0300 @@ -5,7 +5,7 @@ case "$1" in start) - stat_busy "Starting net-lo" + stat_busy "Setting up loopback interface" ip link set up dev lo || stat_die add_daemon net-lo stat_done diff '--color=auto' -Nuar runit-rc-26fa/sv.d/net-lo.in runit-rc-1818/sv.d/net-lo.in --- runit-rc-26fa/sv.d/net-lo.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/net-lo.in 2023-09-27 04:10:41.926500215 +0300 @@ -5,7 +5,7 @@ case "$1" in start) - stat_busy "Starting net-lo" + stat_busy "Setting up loopback interface" ip link set up dev lo || stat_die add_daemon net-lo stat_done diff '--color=auto' -Nuar runit-rc-26fa/sv.d/root runit-rc-1818/sv.d/root --- runit-rc-26fa/sv.d/root 2023-09-27 04:08:38.936459225 +0300 +++ runit-rc-1818/sv.d/root 2023-09-27 04:10:41.999833553 +0300 @@ -36,7 +36,15 @@ mounts=("$target" "${mounts[@]}") done - if (( ${#mounts[*]} )); then + # There are differences between verbose and non-verbose method + # because iterating the array is considerably slower than the + # non-verbose method + if (( ${#mounts[*]} )) && ck_verbose; then + for ((i=0; i<${#mounts[*]}; i++)); do + substat "Unmounting ${mounts[i]}" + umount -r "${mounts[i]}" || return 1 + done + elif (( ${#mounts[*]} )); then umount -r "${mounts[@]}" || return 1 fi return 0 diff '--color=auto' -Nuar runit-rc-26fa/sv.d/root.in runit-rc-1818/sv.d/root.in --- runit-rc-26fa/sv.d/root.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/root.in 2023-09-27 04:10:41.926500215 +0300 @@ -36,7 +36,15 @@ mounts=("$target" "${mounts[@]}") done - if (( ${#mounts[*]} )); then + # There are differences between verbose and non-verbose method + # because iterating the array is considerably slower than the + # non-verbose method + if (( ${#mounts[*]} )) && ck_verbose; then + for ((i=0; i<${#mounts[*]}; i++)); do + substat "Unmounting ${mounts[i]}" + umount -r "${mounts[i]}" || return 1 + done + elif (( ${#mounts[*]} )); then umount -r "${mounts[@]}" || return 1 fi return 0 diff '--color=auto' -Nuar runit-rc-26fa/sv.d/swap runit-rc-1818/sv.d/swap --- runit-rc-26fa/sv.d/swap 2023-09-27 04:08:39.186459385 +0300 +++ runit-rc-1818/sv.d/swap 2023-09-27 04:10:42.213166901 +0300 @@ -3,16 +3,18 @@ # sourcing our current rc.conf requires this to be a bash script . /usr/lib/rc/functions +ck_verbose && SWAP_VERBOSE="-v" + case "$1" in start) stat_busy "Activating swap" - swapon -a || stat_die swap + swapon -a "${SWAP_VERBOSE}" || stat_die swap add_daemon swap stat_done swap ;; stop) stat_busy "Deactivating swap" - swapoff -a || stat_die swap + swapoff -a "${SWAP_VERBOSE}" || stat_die swap rm_daemon swap stat_done swap ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/swap.in runit-rc-1818/sv.d/swap.in --- runit-rc-26fa/sv.d/swap.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/swap.in 2023-09-27 04:10:41.926500215 +0300 @@ -3,16 +3,18 @@ # sourcing our current rc.conf requires this to be a bash script . @RCLIBDIR@/functions +ck_verbose && SWAP_VERBOSE="-v" + case "$1" in start) stat_busy "Activating swap" - swapon -a || stat_die swap + swapon -a "${SWAP_VERBOSE}" || stat_die swap add_daemon swap stat_done swap ;; stop) stat_busy "Deactivating swap" - swapoff -a || stat_die swap + swapoff -a "${SWAP_VERBOSE}" || stat_die swap rm_daemon swap stat_done swap ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/sysctl runit-rc-1818/sv.d/sysctl --- runit-rc-26fa/sv.d/sysctl 2023-09-27 04:08:39.206459398 +0300 +++ runit-rc-1818/sv.d/sysctl 2023-09-27 04:10:42.226500235 +0300 @@ -3,10 +3,12 @@ # sourcing our current rc.conf requires this to be a bash script . /usr/lib/rc/functions +! ck_verbose && QUIET="-q" + case "$1" in start) stat_busy "Loading sysctl settings" - sysctl --system || stat_die sysctl + sysctl "$QUIET" --system || stat_die sysctl add_daemon sysctl stat_done sysctl ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/sysctl.in runit-rc-1818/sv.d/sysctl.in --- runit-rc-26fa/sv.d/sysctl.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/sysctl.in 2023-09-27 04:10:41.926500215 +0300 @@ -3,10 +3,12 @@ # sourcing our current rc.conf requires this to be a bash script . @RCLIBDIR@/functions +! ck_verbose && QUIET="-q" + case "$1" in start) stat_busy "Loading sysctl settings" - sysctl --system || stat_die sysctl + sysctl "$QUIET" --system || stat_die sysctl add_daemon sysctl stat_done sysctl ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/sysfs runit-rc-1818/sv.d/sysfs --- runit-rc-26fa/sv.d/sysfs 2023-09-27 04:08:39.343126153 +0300 +++ runit-rc-1818/sv.d/sysfs 2023-09-27 04:10:42.339833576 +0300 @@ -4,9 +4,14 @@ . /usr/lib/rc/functions mount_sysfs(){ + ck_verbose && substat "Mounting /sys" mountpoint -q /sys || mount -t sysfs sys /sys -o nosuid,noexec,nodev + ck_verbose && substat "Mounting /sys/kernel/security" mountpoint -q /sys/kernel/security || mount -n -t securityfs securityfs /sys/kernel/security - [ -d /sys/firmware/efi ] && (mountpoint -q /sys/firmware/efi/efivars || mount -n -t efivarfs -o ro efivarfs /sys/firmware/efi/efivars) + if [ -d /sys/firmware/efi ]; then + ck_verbose && substat "Mounting /sys/firmware/efi" + (mountpoint -q /sys/firmware/efi/efivars || mount -n -t efivarfs -o ro efivarfs /sys/firmware/efi/efivars) + fi } case "$1" in diff '--color=auto' -Nuar runit-rc-26fa/sv.d/sysfs.in runit-rc-1818/sv.d/sysfs.in --- runit-rc-26fa/sv.d/sysfs.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/sysfs.in 2023-09-27 04:10:41.926500215 +0300 @@ -4,9 +4,14 @@ . @RCLIBDIR@/functions mount_sysfs(){ + ck_verbose && substat "Mounting /sys" mountpoint -q /sys || mount -t sysfs sys /sys -o nosuid,noexec,nodev + ck_verbose && substat "Mounting /sys/kernel/security" mountpoint -q /sys/kernel/security || mount -n -t securityfs securityfs /sys/kernel/security - [ -d /sys/firmware/efi ] && (mountpoint -q /sys/firmware/efi/efivars || mount -n -t efivarfs -o ro efivarfs /sys/firmware/efi/efivars) + if [ -d /sys/firmware/efi ]; then + ck_verbose && substat "Mounting /sys/firmware/efi" + (mountpoint -q /sys/firmware/efi/efivars || mount -n -t efivarfs -o ro efivarfs /sys/firmware/efi/efivars) + fi } case "$1" in diff '--color=auto' -Nuar runit-rc-26fa/sv.d/sysusers runit-rc-1818/sv.d/sysusers --- runit-rc-26fa/sv.d/sysusers 2023-09-27 04:08:39.223126075 +0300 +++ runit-rc-1818/sv.d/sysusers 2023-09-27 04:10:42.239833569 +0300 @@ -6,7 +6,7 @@ case "$1" in start) stat_busy "Starting sysusers" - esysusers + sysusers add_daemon sysusers stat_done ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/sysusers.in runit-rc-1818/sv.d/sysusers.in --- runit-rc-26fa/sv.d/sysusers.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/sysusers.in 2023-09-27 04:10:41.926500215 +0300 @@ -6,7 +6,7 @@ case "$1" in start) stat_busy "Starting sysusers" - esysusers + sysusers add_daemon sysusers stat_done ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/tmpfiles-dev runit-rc-1818/sv.d/tmpfiles-dev --- runit-rc-26fa/sv.d/tmpfiles-dev 2023-09-27 04:08:39.239792753 +0300 +++ runit-rc-1818/sv.d/tmpfiles-dev 2023-09-27 04:10:42.253166904 +0300 @@ -6,7 +6,7 @@ case "$1" in start) stat_busy "Starting tmpfiles-dev" - etmpfiles --prefix=/dev --create --boot || stat_die tmpfiles-dev + tmpfiles --prefix=/dev --create --boot || stat_die tmpfiles-dev add_daemon tmpfiles-dev stat_done tmpfiles-dev ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/tmpfiles-dev.in runit-rc-1818/sv.d/tmpfiles-dev.in --- runit-rc-26fa/sv.d/tmpfiles-dev.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/tmpfiles-dev.in 2023-09-27 04:10:41.926500215 +0300 @@ -6,7 +6,7 @@ case "$1" in start) stat_busy "Starting tmpfiles-dev" - etmpfiles --prefix=/dev --create --boot || stat_die tmpfiles-dev + tmpfiles --prefix=/dev --create --boot || stat_die tmpfiles-dev add_daemon tmpfiles-dev stat_done tmpfiles-dev ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/tmpfiles-setup runit-rc-1818/sv.d/tmpfiles-setup --- runit-rc-26fa/sv.d/tmpfiles-setup 2023-09-27 04:08:39.256459430 +0300 +++ runit-rc-1818/sv.d/tmpfiles-setup 2023-09-27 04:10:42.269833572 +0300 @@ -6,7 +6,7 @@ case "$1" in start) stat_busy "Starting tmpfiles-setup" - etmpfiles --exclude-prefix=/dev --create --remove --boot || stat_die tmpfiles-setup + tmpfiles --exclude-prefix=/dev --create --remove --boot || stat_die tmpfiles-setup add_daemon tmpfiles-setup stat_done tmpfiles-setup ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/tmpfiles-setup.in runit-rc-1818/sv.d/tmpfiles-setup.in --- runit-rc-26fa/sv.d/tmpfiles-setup.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/tmpfiles-setup.in 2023-09-27 04:10:41.926500215 +0300 @@ -6,7 +6,7 @@ case "$1" in start) stat_busy "Starting tmpfiles-setup" - etmpfiles --exclude-prefix=/dev --create --remove --boot || stat_die tmpfiles-setup + tmpfiles --exclude-prefix=/dev --create --remove --boot || stat_die tmpfiles-setup add_daemon tmpfiles-setup stat_done tmpfiles-setup ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/udev runit-rc-1818/sv.d/udev --- runit-rc-26fa/sv.d/udev 2023-09-27 04:08:39.273126108 +0300 +++ runit-rc-1818/sv.d/udev 2023-09-27 04:10:42.283166906 +0300 @@ -7,15 +7,12 @@ start) stat_busy "Starting udev daemon" udevd --daemon || stat_die udev - # Note: This is only needed for initialization, udev will - # be controlled by runit on stage 2. add_daemon udev stat_done udev ;; stop) stat_busy "Stopping udev" - # check whether udevd might still be running. - ! pgrep -f "udevd" >/dev/null 2>&1 || udevadm control --exit || stat_die udev + udevadm control --exit || stat_die udev rm_daemon udev stat_done udev ;; diff '--color=auto' -Nuar runit-rc-26fa/sv.d/udev.in runit-rc-1818/sv.d/udev.in --- runit-rc-26fa/sv.d/udev.in 2023-09-27 04:08:38.836459160 +0300 +++ runit-rc-1818/sv.d/udev.in 2023-09-27 04:10:41.926500215 +0300 @@ -7,15 +7,12 @@ start) stat_busy "Starting udev daemon" udevd --daemon || stat_die udev - # Note: This is only needed for initialization, udev will - # be controlled by runit on stage 2. add_daemon udev stat_done udev ;; stop) stat_busy "Stopping udev" - # check whether udevd might still be running. - ! pgrep -f "udevd" >/dev/null 2>&1 || udevadm control --exit || stat_die udev + udevadm control --exit || stat_die udev rm_daemon udev stat_done udev ;;