import tempfile
from subprocess import call
-def make_debian_cd(basetree, passhash):
- old_preseed = file(os.path.join(basetree, 'preseed.cfg'))
- tmptree = tempfile.mkdtemp('', 'auto-install.', '/tmp')
+data_dir = '/srv/guest-installer'
+
+def make_debian_cd(name, tmptree, passhashfile):
+ basetree = os.path.join(data_dir, name)
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')