[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#660093: clock-setup: Please support /etc/adjtime in addition to /etc/default

Package: clock-setup
Version: 0.110
Severity: normal
Tags: patch


This is similar to the patch for hwclock support last week, but
solves a different problem, namely supporting systemd in d-i,
and (potentially) allowing migration of the UTC setting in
/etc/default into the native configuration file for this option.

Many thanks,

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (550, 'unstable'), (500, 'testing'), (400, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From 8ca1790120e851c34e5dffa7adb20322ef6c970a Mon Sep 17 00:00:00 2001
From: Roger Leigh <rleigh@debian.org>
Date: Thu, 16 Feb 2012 10:41:03 +0000
Subject: [PATCH] 10clock-setup: Support /etc/adjtime

Set UTC or LOCAL in /etc/adjtime in addition to UTC= in /etc/default.
This is because /etc/adjtime is the configuration file for hwclock,
and the systemd init daemon uses the configuration file directly,
thus this change makes it possible for d-i to support installations
which use systemd in place of sysvinit.  This change does not affect
sysvinit users, because /etc/adjtime is updated when hwclock is run.
 finish-install.d/10clock-setup |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/finish-install.d/10clock-setup b/finish-install.d/10clock-setup
index 4bde2c4..4e52af5 100755
--- a/finish-install.d/10clock-setup
+++ b/finish-install.d/10clock-setup
@@ -101,9 +101,15 @@ fi
 db_get clock-setup/utc
 if [ "$RET" = true ]; then
 	sed -i -e 's:^UTC="no":UTC="yes":' -e 's:^UTC=no:UTC=yes:' $utcfile
+	if [ -e /target/etc/adjtime ]; then
+		sed -i -e 's:^LOCAL$:UTC:' /target/etc/adjtime
+	fi
 	sed -i -e 's:^UTC="yes":UTC="no":' -e 's:^UTC=yes:UTC=no:' $utcfile
+	if [ -e /target/etc/adjtime ]; then
+		sed -i -e 's:^UTC$:LOCAL:' /target/etc/adjtime
+	fi

Reply to: