some new features to test

This commit is contained in:
brent s. 2016-12-14 02:29:53 -05:00
parent 82b919958a
commit 13812309dc
2 changed files with 23 additions and 26 deletions

View File

@ -15,7 +15,6 @@ def buildIPXE(conf):
bdisk = conf['bdisk'] bdisk = conf['bdisk']
ipxe = conf['ipxe'] ipxe = conf['ipxe']
mini = ipxe['iso'] mini = ipxe['iso']
usb = ipxe['usb']
tempdir = conf['build']['tempdir'] tempdir = conf['build']['tempdir']
templates_dir = build['basedir'] + '/extra/templates' templates_dir = build['basedir'] + '/extra/templates'
ipxe_tpl = templates_dir + '/iPXE' ipxe_tpl = templates_dir + '/iPXE'
@ -23,13 +22,6 @@ def buildIPXE(conf):
srcdir = build['srcdir'] srcdir = build['srcdir']
embedscript = build['dlpath'] + '/EMBED' embedscript = build['dlpath'] + '/EMBED'
ipxe_src = srcdir + '/ipxe' ipxe_src = srcdir + '/ipxe'
img_path = build['isodir'] + '/'
ipxe_usb = '{0}-{1}-{2}.usb.img'.format(bdisk['uxname'], bdisk['ver'], build['buildnum'])
ipxe_mini = '{0}-{1}-{2}.mini.iso'.format(bdisk['uxname'], bdisk['ver'], build['buildnum'])
ipxe_emini = '{0}-{1}-{2}.mini.eiso'.format(bdisk['uxname'], bdisk['ver'], build['buildnum'])
usb_file = '{0}{1}'.format(img_path, ipxe_usb)
emini_file = '{0}{1}'.format(img_path, ipxe_emini)
mini_file = '{0}{1}'.format(img_path, ipxe_mini)
ipxe_git_uri = 'git://git.ipxe.org/ipxe.git' ipxe_git_uri = 'git://git.ipxe.org/ipxe.git'
patches_git_uri = 'https://github.com/eworm-de/ipxe.git' patches_git_uri = 'https://github.com/eworm-de/ipxe.git'
print('{0}: [IPXE] Prep/fetch sources...'.format( print('{0}: [IPXE] Prep/fetch sources...'.format(
@ -141,8 +133,6 @@ def buildIPXE(conf):
os.chdir(cwd) os.chdir(cwd)
# move the files to the results dir # move the files to the results dir
# TODO: grab ipxe.pxe here too. # TODO: grab ipxe.pxe here too.
if usb:
os.rename('{0}/src/bin/ipxe.usb'.format(ipxe_src), usb_file)
if mini: if mini:
os.rename('{0}/src/bin/ipxe.eiso'.format(ipxe_src), emini_file) os.rename('{0}/src/bin/ipxe.eiso'.format(ipxe_src), emini_file)
os.rename('{0}/src/bin/ipxe.iso'.format(ipxe_src), mini_file) os.rename('{0}/src/bin/ipxe.iso'.format(ipxe_src), mini_file)
@ -150,18 +140,14 @@ def buildIPXE(conf):
iso = {} iso = {}
stream = {} stream = {}
iso['name'] = [] iso['name'] = []
for t in ('usb', 'mini'): # TODO: do this programmatically based on config for t in ('usb'): # TODO: do this programmatically based on config
if t == 'usb': if t == 'usb':
imgname = 'USB' imgname = 'USB'
elif t == 'mini':
imgname = 'Mini'
iso['name'].append(t) iso['name'].append(t)
iso[t] = {} iso[t] = {}
shasum = False shasum = False
shasum = hashlib.sha256() shasum = hashlib.sha256()
if t == 'usb': if t == 'mini':
isopath = usb_file
elif t == 'mini':
isopath = mini_file isopath = mini_file
stream = False stream = False
if os.path.isfile(isopath): if os.path.isfile(isopath):
@ -180,3 +166,24 @@ def buildIPXE(conf):
elif t == 'mini': elif t == 'mini':
iso[t]['fmt'] = 'ISO' iso[t]['fmt'] = 'ISO'
return(iso) return(iso)

def genISO(conf, files):
build = conf['build']
bdisk = conf['bdisk']
ipxe = conf['ipxe']
mini = ipxe['iso']
usb = ipxe['usb']
iso = {}
srcdir = build['srcdir']
ipxe_src = srcdir + '/ipxe'
if mini:
# EFI prep

pass # create ISO here. hybrid, efi support

def tftpbootEnv(conf):
build = conf['build']
ipxe = conf['ipxe']
sync = conf['sync']
if sync['tftp']:
pass # TODO: generate a pxelinux.cfg in bdisk/tftp.py (to write) and sync in the ipxe chainloader here

View File

@ -421,16 +421,6 @@ group = root
; If it is undefined, it is assumed to be no. ; If it is undefined, it is assumed to be no.
iso = yes iso = yes


; Build a "mini-USB" image? Same concept as the ISO file but
; this can be dd'd onto a USB thumbdrive for the same effect.
; 0.) Only accepts (case-insensitive):
; yes|no
; true|false
; 1|0
; 1.) Requires actual git to be installed.
; If it is undefined, it is assumed to be no.
usb = yes

; What URI should iPXE's EMBED script use? ; What URI should iPXE's EMBED script use?
; If you require HTTP BASIC Authentication or HTTP Digest ; If you require HTTP BASIC Authentication or HTTP Digest
; Authentication (untested), you can format it via: ; Authentication (untested), you can format it via: