X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-autoinstaller.git/blobdiff_plain/a648e15e27104d03c7489c6c4c494022457ed06e..db71340c2668dc8de6a9412bcb526dc4336e8471:/files/usr/sbin/sipb-xen-make-iso?ds=inline diff --git a/files/usr/sbin/sipb-xen-make-iso b/files/usr/sbin/sipb-xen-make-iso index 82abba9..97b651e 100755 --- a/files/usr/sbin/sipb-xen-make-iso +++ b/files/usr/sbin/sipb-xen-make-iso @@ -6,13 +6,17 @@ import shutil import tempfile from subprocess import call -def make_debian_cd(basetree, passhash): - old_preseed = file(os.path.join(basetree, 'preseed.cfg')) +data_dir = '/srv/guest-installer' + +def make_debian_cd(name, passhashfile): + basetree = os.path.join(data_dir, name) tmptree = tempfile.mkdtemp('', 'auto-install.', '/tmp') cdtree = os.path.join(tmptree, 'cdrom') shutil.copytree(os.path.join(basetree, 'cdrom'), cdtree, symlinks=True) new_preseed = file(os.path.join(cdtree, 'preseed.cfg'), 'w') + old_preseed = file(os.path.join(basetree, 'preseed.cfg')) new_preseed.write(old_preseed.read()) + passhash = file(passhashfile).read() new_preseed.write('d-i passwd/root-password-crypted password '+passhash+'\n') new_preseed.close() output_iso = os.path.join(tmptree, 'install.iso')