Changeset 218


Ignore:
Timestamp:
Oct 28, 2007, 1:08:34 AM (17 years ago)
Author:
price
Message:

Use temp directory, use DHCP, and live in sane paths.

The partial/ tree is gone now.
Files are in files/; the installer's persistent data
will go in subtrees like /srv/guest-installer/etch/.

Also, it magically takes only 15 minutes now.

Location:
trunk/packages/sipb-xen-guest-installer/sipb-xen-guest-installer
Files:
5 added
1 deleted
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-guest-installer/sipb-xen-guest-installer/files/srv/guest-installer/etch/preseed.cfg

    r215 r218  
    99
    1010#d-i netcfg/dhcp_timeout string 1
    11 
    12 d-i netcfg/use_dhcp boolean false
    13 # If you prefer to configure the network manually, uncomment this line and
    14 # the static network configuration below.
    15 d-i netcfg/disable_dhcp boolean true
    16 
    17 # Static network configuration.
    18 d-i netcfg/get_nameservers string 18.72.0.3
    19 # at bottom  #d-i netcfg/get_ipaddress string fillme
    20 d-i netcfg/get_netmask string 255.255.0.0
    21 d-i netcfg/get_gateway string 18.181.0.1
    22 d-i netcfg/confirm_static boolean true
     11d-i netcfg/use_dhcp boolean true
    2312
    2413# Any hostname and domain names assigned from dhcp take precedence over
     
    233222
    234223# sipb-xen: automatically filled-in values get appended here.
    235 # at bottom  #d-i netcfg/get_ipaddress string fillme
    236 # at bottom  #d-i netcfg/get_hostname string fillme
    237224# at bottom  #d-i passwd/root-password-crypted password [MD5 hash]
  • trunk/packages/sipb-xen-guest-installer/sipb-xen-guest-installer/files/usr/sbin/sipb-xen-make-iso

    r215 r218  
    33import sys
    44import os
     5import shutil
     6import tempfile
    57from subprocess import call
    68
    7 def make_debian_cd(basetree, guest_ip, guest_hostname, passhash, output_iso):
     9def make_debian_cd(basetree, passhash):
    810  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)
    1014  new_preseed = file(os.path.join(cdtree, 'preseed.cfg'), 'w')
    1115  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')
    1416  new_preseed.write('d-i passwd/root-password-crypted password '+passhash+'\n')
    1517  new_preseed.close()
     18  output_iso = os.path.join(tmptree, 'install.iso')
    1619  call('''mkisofs -r -V "SIPB-Xen_Custom_Install_CD" -cache-inodes -J -l
    1720           -b isolinux/isolinux.bin -c isolinux/boot.cat
    1821           -no-emul-boot -boot-load-size 4 -boot-info-table'''.split()
    1922       + ['-o', output_iso, cdtree])
     23  return output_iso
    2024
    2125if __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.