fix(make_chroot): Move timezone setup to general init function.

No idea why this was in the user setup function, move it a bit.
This commit is contained in:
Michael Marineau 2013-08-24 22:36:02 -04:00
parent 84a2619829
commit bf0a37a0f4

View File

@ -139,14 +139,6 @@ delete_existing() {
}
init_users () {
info "Set timezone..."
# date +%Z has trouble with daylight time, so use host's info.
rm -f "${FLAGS_chroot}/etc/localtime"
if [ -f /etc/localtime ] ; then
cp /etc/localtime "${FLAGS_chroot}/etc"
else
ln -sf /usr/share/zoneinfo/PST8PDT "${FLAGS_chroot}/etc/localtime"
fi
info "Adding user/group..."
# Add ourselves as a user inside the chroot.
bare_chroot groupadd -g 5000 eng
@ -202,6 +194,14 @@ EOF
# Fix bad group for some.
chown -R root:root "${FLAGS_chroot}/etc/"sudoers*
info "Setting timezone..."
rm -f "${FLAGS_chroot}/etc/localtime"
if [ -f /etc/localtime ] ; then
cp /etc/localtime "${FLAGS_chroot}/etc"
else
ln -sf /usr/share/zoneinfo/UTC "${FLAGS_chroot}/etc/localtime"
fi
info "Setting up hosts/resolv..."
# Copy config from outside chroot into chroot.
cp /etc/{hosts,resolv.conf} "$FLAGS_chroot/etc/"