- Timestamp:
- Oct 28, 2007, 1:08:34 AM (17 years ago)
- Location:
- trunk/packages/sipb-xen-guest-installer/sipb-xen-guest-installer/files/usr
- Files:
-
- 2 added
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-guest-installer/sipb-xen-guest-installer/files/usr/sbin/sipb-xen-make-iso
r215 r218 3 3 import sys 4 4 import os 5 import shutil 6 import tempfile 5 7 from subprocess import call 6 8 7 def make_debian_cd(basetree, guest_ip, guest_hostname, passhash, output_iso):9 def make_debian_cd(basetree, passhash): 8 10 old_preseed = file(os.path.join(basetree, 'preseed.cfg')) 9 cdtree = os.path.join(basetree, 'cdrom') 11 tmptree = tempfile.mkdtemp('', 'auto-install.', '/tmp') 12 cdtree = os.path.join(tmptree, 'cdrom') 13 shutil.copytree(os.path.join(basetree, 'cdrom'), cdtree, symlinks=True) 10 14 new_preseed = file(os.path.join(cdtree, 'preseed.cfg'), 'w') 11 15 new_preseed.write(old_preseed.read()) 12 new_preseed.write('d-i netcfg/get_ipaddress string '+guest_ip+'\n')13 new_preseed.write('d-i netcfg/get_hostname string '+guest_hostname+'\n')14 16 new_preseed.write('d-i passwd/root-password-crypted password '+passhash+'\n') 15 17 new_preseed.close() 18 output_iso = os.path.join(tmptree, 'install.iso') 16 19 call('''mkisofs -r -V "SIPB-Xen_Custom_Install_CD" -cache-inodes -J -l 17 20 -b isolinux/isolinux.bin -c isolinux/boot.cat 18 21 -no-emul-boot -boot-load-size 4 -boot-info-table'''.split() 19 22 + ['-o', output_iso, cdtree]) 23 return output_iso 20 24 21 25 if __name__ == '__main__': 22 make_debian_cd(*sys.argv[1:])26 print make_debian_cd(*sys.argv[1:])
Note: See TracChangeset
for help on using the changeset viewer.