summaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit69
1 files changed, 42 insertions, 27 deletions
diff --git a/rc.sysinit b/rc.sysinit
index 17b8f6a..6b93bae 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -17,7 +17,7 @@ printhl "Parabola GNU/Linux-Libre\n"
printhl "${C_H2}https://parabolagnulinux.org"
printsep
-# mount the api filesystems
+# mount the API filesystems
# /proc, /sys, /run, /dev, /run/lock, /dev/pts, /dev/shm
mountpoint -q /proc || mount -t proc proc /proc -o nosuid,noexec,nodev
mountpoint -q /sys || mount -t sysfs sys /sys -o nosuid,noexec,nodev
@@ -34,7 +34,7 @@ if [[ ! -e /run/initramfs/root-fsck ]]; then
# remount root ro to allow for fsck later on, we remount now to
# make sure nothing can open files rw on root which would block a remount
findmnt / --options ro &>/dev/null ||
- status "Mounting Root Read-Only" mount -o remount,ro /
+ status "Mounting root read-only" mount -o remount,ro /
fi
run_hook sysinit_start
@@ -48,26 +48,27 @@ case $HARDWARECLOCK in
esac
if [[ $HWCLOCK_PARAMS ]]; then
- stat_busy "Adjusting system time and setting kernel timezone"
-
- # Adjust the system time for timezone offset if rtc is not in UTC
- # 1. Make creation time on device nodes sane (FS#8665)
- # 2. Filesystem checks can depend on system time
- # 3. This also sets the kernel time zone, used by e.g. vfat
- # If TIMEZONE is not set in rc.conf, the timezone stored in /etc/localtime
- # is used. If HARDWARECLOCK is not set in rc.conf, the value in
- # /var/lib/hwclock/adjfile is used (in this case /var can not be a separate
- # partition).
+ stat_busy "Adjusting system time and setting kernel time zone"
+
+ # Adjust the system time for time zone offset if rtc is not in UTC, as
+ # filesystem checks can depend on system time. This also sets the kernel
+ # time zone, used by e.g. vfat.
+ # If TIMEZONE is not set in rc.conf, the time zone stored in /etc/localtime
+ # is used. If HARDWARECLOCK is not set in rc.conf, the value in
+ # /etc/adjfile is used.
+
[[ $TIMEZONE ]] && export TZ=$TIMEZONE
+
hwclock $HWCLOCK_PARAMS && stat_done || stat_fail
+
unset TZ
fi
-# Start/trigger UDev, load MODULES and settle UDev
+# Start/trigger udev, load MODULES, and settle udev
udevd_modprobe sysinit
# this must be done after udev has loaded the KMS modules
-status 'Configuring Virtual Consoles' /usr/lib/systemd/systemd-vconsole-setup
+status 'Configuring virtual consoles' /usr/lib/systemd/systemd-vconsole-setup
# bring up the loopback interface
[[ -d /sys/class/net/lo ]] &&
@@ -77,11 +78,11 @@ status 'Configuring Virtual Consoles' /usr/lib/systemd/systemd-vconsole-setup
[[ $USEDMRAID = [Yy][Ee][Ss] && -x $(type -P dmraid) ]] &&
status "Activating FakeRAID arrays" dmraid -i -ay
-# BTRFS devices detection
+# Btrfs devices detection
[[ $USEBTRFS = [Yy][Ee][Ss] && -x $(type -P btrfs) ]] &&
- status "Activating BTRFS volumes" btrfs device scan
+ status "Activating Btrfs volumes" btrfs device scan
-# Activate LVM2 groups if any
+# Activate LVM2 groups, if any
activate_vgs
# Set up non-root encrypted partition mappings
@@ -96,7 +97,7 @@ fi
# Check filesystems
run_hook sysinit_prefsck
if [[ -x $(type -P fsck) ]]; then
- stat_busy "Checking Filesystems"
+ stat_busy "Checking filesystems"
fsck_all >|"${FSCK_OUT:-/dev/stdout}" 2>|"${FSCK_ERR:-/dev/stdout}"
declare -r fsckret=$?
(( fsckret <= 1 )) && stat_done || stat_fail
@@ -108,25 +109,25 @@ run_hook sysinit_postfsck
# Single-user login and/or automatic reboot if needed
fsck_reboot $fsckret
-status "Remounting Root and API filesystems" \
+status "Remounting root and API filesystems" \
/usr/lib/systemd/systemd-remount-fs
-# now mount all the local filesystems
+# Now mount all the local filesystems
run_hook sysinit_premount
-status "Mounting Local Filesystems" \
+status "Mounting local filesystems" \
mount_all
run_hook sysinit_postmount
-# enable monitoring of lvm2 groups, now that the filesystems are mounted rw
+# Enable monitoring of LVM2 groups, now that the filesystems are mounted rw
[[ $USELVM = [Yy][Ee][Ss] && -x $(type -P lvm) && -d /sys/block ]] &&
status "Activating monitoring of LVM2 groups" \
vgchange --monitor y >/dev/null
-status "Activating Swap" swapon -a
+status "Activating swap" swapon -a
-[[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE"
+[[ $TIMEZONE ]] && status "Configuring time zone" set_timezone "$TIMEZONE"
-status 'Initializing Random Seed' /usr/lib/systemd/systemd-random-seed load
+status 'Initializing random seed' /usr/lib/systemd/systemd-random-seed load
# Remove leftover files
remove_leftover
@@ -135,11 +136,11 @@ if [[ -s /etc/hostname ]]; then
HOSTNAME=$(< /etc/hostname)
fi
if [[ $HOSTNAME ]]; then
- stat_busy "Setting Hostname: $HOSTNAME"
+ stat_busy "Setting hostname: $HOSTNAME"
echo "$HOSTNAME" >| /proc/sys/kernel/hostname && stat_done || stat_fail
fi
-stat_busy "Saving dmesg Log"
+stat_busy "Saving dmesg log"
if [[ -e /proc/sys/kernel/dmesg_restrict ]] &&
(( $(< /proc/sys/kernel/dmesg_restrict) == 1 )); then
install -Tm 0600 <( dmesg ) /var/log/dmesg.log
@@ -148,6 +149,20 @@ stat_busy "Saving dmesg Log"
fi
(( $? == 0 )) && stat_done || stat_fail
+if [[ -f /etc/adjtime ]]; then
+ ( read ; read ; read ADJTIME) < /etc/adjtime
+
+ if [[ $ADJTIME == 'LOCAL' ]]; then
+ if [[ $HARDWARECLOCK == 'UTC' ]]; then
+ printf "${C_FAIL}/etc/rc.conf says the RTC is in UTC, but /etc/adjtime says it is in localtime.\n${C_OTHER}."
+ fi
+ else
+ if [[ $HARDWARECLOCK == 'LOCALTIME' ]]; then
+ printf "${C_FAIL}/etc/rc.conf says the RTC is in localtime, but hwclock (/etc/adjtime) thinks it is in UTC.\n${C_OTHER}."
+ fi
+ fi
+fi
+
run_hook sysinit_end
# End of file