initramfs: sync time with NTP
Using the Busybox NTP client, we can set the system clock in early userspace. This will ensure the system clock is correct before anything, even systemd, is started from the real rootfs. Obviously, this requires the DHCP server to specify NTP server addresses in the client lease.master
parent
711a8aa948
commit
ca71b88227
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Busybox version: 1.35.0
|
||||
# Tue Mar 8 23:49:30 2022
|
||||
# Tue Mar 15 14:06:30 2022
|
||||
#
|
||||
CONFIG_HAVE_DOT_CONFIG=y
|
||||
|
||||
|
@ -928,7 +928,7 @@ CONFIG_FEATURE_IP_ROUTE_DIR="/etc/iproute2"
|
|||
# CONFIG_NSLOOKUP is not set
|
||||
# CONFIG_FEATURE_NSLOOKUP_BIG is not set
|
||||
# CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS is not set
|
||||
# CONFIG_NTPD is not set
|
||||
CONFIG_NTPD=y
|
||||
# CONFIG_FEATURE_NTPD_SERVER is not set
|
||||
# CONFIG_FEATURE_NTPD_CONF is not set
|
||||
# CONFIG_FEATURE_NTP_AUTH is not set
|
||||
|
|
|
@ -29,5 +29,11 @@ renew|bound)
|
|||
printf 'nameserver %s\n' "${ns}" >> /etc/resolv.conf
|
||||
done
|
||||
fi
|
||||
if [ -n "${ntpsrv}" ] && [ -x /usr/sbin/ntpd ]; then
|
||||
for ts in ${ntpsrv}; do
|
||||
/usr/sbin/ntpd -n -q -p "${ts}" || continue
|
||||
break
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
|
Reference in New Issue