timezone hook: use host-default if none present
authorGuido Trotter <ultrotter@google.com>
Fri, 7 Oct 2011 19:43:50 +0000 (15:43 -0400)
committerGuido Trotter <ultrotter@google.com>
Mon, 10 Oct 2011 17:43:28 +0000 (13:43 -0400)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

examples/hooks/timezone

index ff6c968..2214c7c 100755 (executable)
@@ -1,8 +1,11 @@
 #!/bin/sh
 #
-# This is an example script that sets the timezone to a given default
+# This is an example script that sets the timezone to a given default, or to the one of the host is none is configured
 
-cp confdata/timezone $TARGET/etc/
-chroot $TARGET dpkg-reconfigure --frontend noninteractive tzdata
+if [ -r confdata/timezone ]
+then   cp confdata/timezone $TARGET/etc/
+else   cp /etc/timezone $TARGET/etc/
+fi
 
+chroot $TARGET dpkg-reconfigure --frontend noninteractive tzdata