From 919b8f6e4243a530e9739accf47de9af4998e7d0 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Wed, 18 Mar 2020 14:31:28 +0100 Subject: [PATCH] Workaround for missing adjtime file The adjtime file used by hwclock in tinycore is /var/lib/hwclock/adjtime but for some reason (bug?) the file is not created when hwclock is invoked, causing hwclock to fail when using certain options, for example --systohc. We create the dir and the file to prevent that. Change-Id: I86d7adac22be1890b271fd65a4bc49a7ab0a77bf --- tinyipa/finalise-tinyipa.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tinyipa/finalise-tinyipa.sh b/tinyipa/finalise-tinyipa.sh index 60c5ee5..87e75eb 100755 --- a/tinyipa/finalise-tinyipa.sh +++ b/tinyipa/finalise-tinyipa.sh @@ -187,6 +187,16 @@ sudo sed -i '/# Main/a NOZSWAP=1' "$FINALDIR/etc/init.d/tc-config" # Place ipv6 modprobe config so the kernel support loads. sudo cp "$WORKDIR/build_files/modprobe.conf" "$FINALDIR/etc/modproble.conf" +# NOTE(rpittau): workaorund for hwclock +# The adjtime file used by hwclock in tinycore is /var/lib/hwclock/adjtime +# but for some reason (bug?) the file is not created when hwclock is +# invoked, causing hwclock to fail when using certain options, for example +# --systohc. +# We create the dir and the file to prevent that. +$CHROOT_CMD mkdir -p /var/lib/hwclock +$CHROOT_CMD touch /var/lib/hwclock/adjtime +$CHROOT_CMD chmod 640 /var/lib/hwclock/adjtime + if $PYOPTIMIZE_TINYIPA; then # Precompile all python if [[ $USE_PYTHON3 == "True" ]]; then