From 0e9488661172f8447b66400f35fa431f7e653592 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 20 Jul 2012 13:02:19 +0200 Subject: [PATCH] firstboot: configure all installed templates --- firstboot/modules/qubes_setup.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/firstboot/modules/qubes_setup.py b/firstboot/modules/qubes_setup.py index d6b4a33..7932134 100644 --- a/firstboot/modules/qubes_setup.py +++ b/firstboot/modules/qubes_setup.py @@ -197,13 +197,14 @@ class moduleClass(Module): def do_configure_template(self): subprocess.check_call(['/bin/mkdir', '-p', '/mnt/template-root']) - subprocess.check_call(['/bin/mount', '-oloop', - '/var/lib/qubes/vm-templates/fedora-15-x64/root.img', - '/mnt/template-root']) - # Copy timezone setting from Dom0 to template - subprocess.check_call(['cp', '/etc/localtime', '/mnt/template-root/etc']) - subprocess.check_call(['cp', '/etc/ntp.conf', '/mnt/template-root/etc']) - subprocess.check_call(['/bin/umount', '/mnt/template-root']) + for template in os.listdir('/var/lib/qubes/vm-templates'): + subprocess.check_call(['/bin/mount', '-oloop', + '/var/lib/qubes/vm-templates/%s/root.img' % template, + '/mnt/template-root']) + # Copy timezone setting from Dom0 to template + subprocess.check_call(['cp', '/etc/localtime', '/mnt/template-root/etc']) + subprocess.check_call(['cp', '/etc/ntp.conf', '/mnt/template-root/etc']) + subprocess.check_call(['/bin/umount', '/mnt/template-root']) def do_create_appvms(self): self.run_command(['su', '-c', '/usr/bin/qvm-create work --label green', '-', self.qubes_user])