Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add /etc/grml/fai/config/scripts/GRMLBASE/18-timesetup, thanks to Tho…

…mas Lehmann
  • Loading branch information...
commit e0aadc7e5a3bb5ef50333ffd5586ae7c3abc978e 1 parent c7174a3
@mika mika authored
View
2  debian/changelog
@@ -5,6 +5,8 @@ grml-live (0.9.8) unstable; urgency=low
* Add libcap2-bin to GRML_FULL.
* Upgrade isolinux.bin to version from syslinux-common 2:3.73+dfsg-1.
[Testing: issue569]
+ * Integrate /etc/grml/fai/config/scripts/GRMLBASE/18-timesetup to
+ improve UTC handling. Thanks for the script, Thomas Lehmann!
-- Michael Prokop <mika@grml.org> Thu, 12 Feb 2009 14:20:39 +0100
View
33 etc/grml/fai/config/scripts/GRMLBASE/18-timesetup
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Filename: /etc/grml/fai/config/scripts/GRMLBASE/18-timesetup
+# Purpose: apply default time and timezone settings
+# Authors: (c) Thomas Lehmann <thomas.lehmann@kvt.de>
+# Bug-Reports: send to author and see http://grml.org/bugs/
+# License: This file is licensed under the GPL v2 or any later version.
+###############################################################################
+
+set -u
+set -e
+
+# tell if hwclock is running in UTC or local time
+if [ -n "$UTC" ] ; then
+ echo "Setting hwclock parameter UTC to $UTC"
+ sed -i "s|^UTC=.*$|UTC="$UTC"|" $target/etc/default/rcS
+fi
+
+# default timezone settings
+if [ -n "$TIMEZONE" ] ; then
+ echo "Setting default timezone to $TIMEZONE"
+ # update debconf
+ area=$(echo $TIMEZONE | cut -d '/' -f1)
+ zone=$(echo $TIMEZONE | cut -d '/' -f2)
+ echo "tzdata tzdata/Areas select $area" | $ROOTCMD debconf-set-selections
+ echo "tzdata tzdata/Zones/$area select $zone" | $ROOTCMD debconf-set-selections
+ # update files
+ echo $TIMEZONE > $target/etc/timezone
+ rm -f $target/etc/localtime
+ cp -f $target/usr/share/zoneinfo/$TIMEZONE $target/etc/localtime
+fi
+
+## END OF FILE ################################################################
+# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
Please sign in to comment.
Something went wrong with that request. Please try again.