commit: 04ef8b27f6be4a81b05eddd7a48ad7fce320d775
parent 36bac3cd76cfb90dc19412cbc5333a9181ff9bfd
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 2 Feb 2025 15:32:50 +0100
Fix system datetime once bootstrapped
Otherwise autotools errors out like so:
checking whether build environment is sane... configure: error: newly created file is older than distributed files!
Diffstat:
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/init.sh b/init.sh
@@ -205,6 +205,10 @@ test -f /cacert-*.pem && {
mkdir -p $HOME
cd
+if [ "$(date +%Y)" = 1970 ]; then
+ /etc/setdate.sh
+fi
+
# No /dev/tty1, no getty (as seen in containers)
if ! test -e /dev/tty1
then
diff --git a/make-root.sh b/make-root.sh
@@ -136,6 +136,12 @@ nobody:x:65534:
nogroup:x:65533:
EOF
+cat >etc/setdate.sh <<EOF
+#!/bin/sh
+exec date -f %Y-%m-%dT%TZ $(date +%Y-%m-%dT%TZ)
+EOF
+chmod +x etc/setdate.sh
+
for i in fd stderr stdin stdout; do
ln -fs proc/self/$i dev/$i
done