Do You know how to set timezone at boot time?

It seems for now hardocded to Etc/GMT.
We could have some pseudo debconf preseeding in that place like
following patch does.

Applied to current SVN, I use it like e.g :
$ make-live --bootappend="timezone=Europe/Paris"

I'm actually not really happy with that as we could go adding zillions
of new debconf
paramaters when using a preseed file with the "preseed/file=" keyword
seems saner.

Cheers

--
Mathieu
--- scripts/live	2007-06-28 21:38:52.000000000 +0200
+++ scripts/live.new	2007-06-28 21:39:34.000000000 +0200
@@ -194,6 +194,11 @@
 				export SHOWMOUNTS
 				;;
 
+		       timezone=*)
+			       TIMEZONE="${x#timezone=}"
+			       export TIMEZONE
+			       ;;
+
 			todisk=*)
 				TODISK=${x#todisk=}
 				export TODISK
--- scripts/live-bottom/02_timezone	2007-06-28 21:38:52.000000000 +0200
+++ scripts/live-bottom/02_timezone.new	2007-06-28 21:39:41.000000000 +0200
@@ -26,6 +26,20 @@
 
 # live-initramfs script
 
-cp -f /root/usr/share/zoneinfo/UTC /root/etc/localtime
+if [ -n "${TIMEZONE}" ]; then
+    area="$(echo ${TIMEZONE} | cut -f1 -d '/')"
+    zone="$(echo ${TIMEZONE} | cut -f2 -d '/')"
+    chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
+set tzdata/Areas $area
+set tzdata/Zones/$area $zone
+EOF
+    cp -f /root/usr/share/zoneinfo/${area}/${zone} /root/etc/localtime
+else
+    chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null <<EOF
+set tzdata/Areas Etc
+set tzdata/Zones/Etc UTC
+EOF
+    cp -f /root/usr/share/zoneinfo/UTC /root/etc/localtime
+fi   
 
 log_end_msg
_______________________________________________
Debian-live-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel

Reply via email to