firstboot: configure all installed templates

This commit is contained in:
Marek Marczykowski 2012-07-20 13:02:19 +02:00 committed by Joanna Rutkowska
parent 6a7982b7e0
commit 0e94886611

View File

@ -197,13 +197,14 @@ class moduleClass(Module):
def do_configure_template(self): def do_configure_template(self):
subprocess.check_call(['/bin/mkdir', '-p', '/mnt/template-root']) subprocess.check_call(['/bin/mkdir', '-p', '/mnt/template-root'])
subprocess.check_call(['/bin/mount', '-oloop', for template in os.listdir('/var/lib/qubes/vm-templates'):
'/var/lib/qubes/vm-templates/fedora-15-x64/root.img', subprocess.check_call(['/bin/mount', '-oloop',
'/mnt/template-root']) '/var/lib/qubes/vm-templates/%s/root.img' % template,
# Copy timezone setting from Dom0 to template '/mnt/template-root'])
subprocess.check_call(['cp', '/etc/localtime', '/mnt/template-root/etc']) # Copy timezone setting from Dom0 to template
subprocess.check_call(['cp', '/etc/ntp.conf', '/mnt/template-root/etc']) subprocess.check_call(['cp', '/etc/localtime', '/mnt/template-root/etc'])
subprocess.check_call(['/bin/umount', '/mnt/template-root']) subprocess.check_call(['cp', '/etc/ntp.conf', '/mnt/template-root/etc'])
subprocess.check_call(['/bin/umount', '/mnt/template-root'])
def do_create_appvms(self): def do_create_appvms(self):
self.run_command(['su', '-c', '/usr/bin/qvm-create work --label green', '-', self.qubes_user]) self.run_command(['su', '-c', '/usr/bin/qvm-create work --label green', '-', self.qubes_user])