summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-12-13 20:32:05 +0100
committerDaniel Baumann <daniel@debian.org>2012-12-13 20:32:18 +0100
commit414b89ed3fed62396f2e9ec242f7aeb9863ac1f3 (patch)
treeead027eac076803e9057c2ddc98c33df98538365
parent4e65bcbb5b2472227ca59e25fd72a4857324e508 (diff)
downloadvyos-live-build-414b89ed3fed62396f2e9ec242f7aeb9863ac1f3.tar.gz
vyos-live-build-414b89ed3fed62396f2e9ec242f7aeb9863ac1f3.zip
Updating removal of adjtime in a split out hook for wheezy.
-rwxr-xr-xfunctions/defaults.sh6
-rwxr-xr-xscripts/build/chroot_hacks3
-rwxr-xr-xshare/hooks/0120-remove-adjtime-configuration.chroot20
3 files changed, 24 insertions, 5 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 8d18d449f..70fdadaf5 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -631,7 +631,8 @@ Set_defaults ()
remove-python-py \
remove-udev-persistent-rules \
remove-linux-image-backups \
- remove-mdadm-configuration}"
+ remove-mdadm-configuration \
+ remote-adjtime-configuration}"
;;
kubuntu)
@@ -644,7 +645,8 @@ Set_defaults ()
remove-python-py \
remove-udev-persistent-rules \
remove-linux-image-backups \
- remove-mdadm-configuration}"
+ remove-mdadm-configuration \
+ remove-adjtime-configuration}"
;;
esac
diff --git a/scripts/build/chroot_hacks b/scripts/build/chroot_hacks
index f0e885b08..6fcd35e02 100755
--- a/scripts/build/chroot_hacks
+++ b/scripts/build/chroot_hacks
@@ -212,9 +212,6 @@ esac
# people might do in local hooks, and there might be no initrds at all.
find chroot/boot -name 'initrd*' -print0 | xargs -r -0 chmod go+r
-# Remove build systems clock drift
-echo "0.0 0 0.0" > chroot/etc/adjtime
-
# Remove cruft
rm -f chroot/boot/initrd*bak*
rm -f chroot/etc/apt/trusted.gpg~
diff --git a/share/hooks/0120-remove-adjtime-configuration.chroot b/share/hooks/0120-remove-adjtime-configuration.chroot
new file mode 100755
index 000000000..5625effb8
--- /dev/null
+++ b/share/hooks/0120-remove-adjtime-configuration.chroot
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+# Reset generated file
+
+if [ -e /run ]
+then
+ # wheezy
+
+cat > /etc/adjtime << EOF
+0.0 0 0.0
+0
+UTC
+EOF
+
+else
+ # squeeze
+ echo "0.0 0 0.0" > /etc/adjtime
+fi