source: trunk/packages/sipb-xen-guest-installer/files/usr/sbin/sipb-xen-make-iso @ 620

Last change on this file since 620 was 484, checked in by price, 17 years ago

update sx-make-iso to black-mesa's version

The modtime on black-mesa of this new version is late October.

The script is overtaken by events anyway, but just keeping things clean.

  • Property svn:executable set to *
File size: 1.0 KB
RevLine 
[201]1#!/usr/bin/env python
2
3import sys
4import os
[218]5import shutil
6import tempfile
[201]7from subprocess import call
8
[221]9data_dir = '/srv/guest-installer'
10
[484]11def make_debian_cd(name, tmptree, passhashfile):
[221]12  basetree = os.path.join(data_dir, name)
[218]13  cdtree = os.path.join(tmptree, 'cdrom')
14  shutil.copytree(os.path.join(basetree, 'cdrom'), cdtree, symlinks=True)
[201]15  new_preseed = file(os.path.join(cdtree, 'preseed.cfg'), 'w')
[221]16  old_preseed = file(os.path.join(basetree, 'preseed.cfg'))
[201]17  new_preseed.write(old_preseed.read())
[221]18  passhash = file(passhashfile).read()
[201]19  new_preseed.write('d-i passwd/root-password-crypted password '+passhash+'\n')
20  new_preseed.close()
[218]21  output_iso = os.path.join(tmptree, 'install.iso')
[201]22  call('''mkisofs -r -V "SIPB-Xen_Custom_Install_CD" -cache-inodes -J -l
23           -b isolinux/isolinux.bin -c isolinux/boot.cat
24           -no-emul-boot -boot-load-size 4 -boot-info-table'''.split()
25       + ['-o', output_iso, cdtree])
[218]26  return output_iso
[201]27
28if __name__ == '__main__':
[218]29  print make_debian_cd(*sys.argv[1:])
Note: See TracBrowser for help on using the repository browser.