From f63f157199f3f1f2e8bf2d54dba80e887b65d958 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 11 Jan 2014 17:23:49 -0600 Subject: [PATCH] create-vmachine: Set the time zone in the VM --- create-vmachine.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/create-vmachine.sh b/create-vmachine.sh index 49c7e89..c67c4f1 100755 --- a/create-vmachine.sh +++ b/create-vmachine.sh @@ -16,6 +16,7 @@ fi : ${DOMXML_TMPL:=/etc/libvirt/qemu/_template.xml} : ${MOUNTPOINT:=/mnt/new_vmachine} : ${PORTAGE_PROFILE:="default/linux/amd64/13.0"} +: ${VM_TZ:=America/Chicago} quit() { @@ -95,6 +96,11 @@ tar -xjpf "${STAGE_TBZ}" -C "${MOUNTPOINT}" echo "Setting hostname..." sed -i "s/localhost/${VMNAME}/" "${MOUNTPOINT}"/etc/conf.d/hostname +echo "Setting time zone..." +rm -f "${MOUNTPOINT}"/etc/localtime +ln -s /usr/share/zoneinfo/${VM_TZ} "${MOUNTPOINT}"/etc/localtime +echo ${VM_TZ} > "${MOUNTPOINT}"/etc/timezone + echo "Configuring network..." echo 'config_eth0="dhcp"' > "${MOUNTPOINT}"/etc/conf.d/net ln -s net.lo "${MOUNTPOINT}"/etc/init.d/net.eth0