2016-11-26 22:05:53 -05:00
#!/bin/env python3
2016-11-21 03:41:22 -05:00
import host
import prep
import bchroot
2016-11-26 22:05:53 -05:00
import build
2016-12-01 12:47:23 -05:00
import datetime
2016-12-09 12:41:17 -05:00
import bSSL
import ipxe
2016-11-21 03:41:22 -05:00
# we need to:
# we also need to figure out how to implement "mentos" (old bdisk) like functionality, letting us reuse an existing chroot install if possible to save time for future builds.
# if not, though, it's no big deal.
2016-12-04 02:43:49 -05:00
# still on the todo: iPXE
2016-11-21 03:41:22 -05:00
if __name__ == ' __main__ ' :
2016-12-03 06:07:41 -05:00
print ( ' {0} : Starting. ' . format ( datetime . datetime . now ( ) ) )
2016-11-21 03:41:22 -05:00
conf = host . parseConfig ( host . getConfig ( ) ) [ 1 ]
prep . dirChk ( conf )
2016-12-03 06:07:41 -05:00
prep . buildChroot ( conf [ ' build ' ] , keep = False )
2016-12-01 23:42:27 -05:00
prep . prepChroot ( conf [ ' build ' ] , conf [ ' bdisk ' ] , conf [ ' user ' ] )
2016-11-26 22:05:53 -05:00
arch = conf [ ' build ' ] [ ' arch ' ]
for a in arch :
bchroot . chroot ( conf [ ' build ' ] [ ' chrootdir ' ] + ' /root. ' + a , ' bdisk.square-r00t.net ' )
bchroot . chrootUnmount ( conf [ ' build ' ] [ ' chrootdir ' ] + ' /root. ' + a )
2016-11-28 02:56:15 -05:00
prep . postChroot ( conf [ ' build ' ] )
2016-12-04 02:43:49 -05:00
bchroot . chrootTrim ( conf [ ' build ' ] )
2016-12-01 07:13:24 -05:00
build . genImg ( conf [ ' build ' ] , conf [ ' bdisk ' ] )
build . genUEFI ( conf [ ' build ' ] , conf [ ' bdisk ' ] )
2016-12-02 04:10:38 -05:00
fulliso = build . genISO ( conf )
2016-12-01 23:42:27 -05:00
build . displayStats ( fulliso )
2016-12-06 17:51:36 -05:00
if conf [ ' build ' ] [ ' ipxe ' ] :
bSSL . sslPKI ( conf )
2016-12-09 12:41:17 -05:00
iso = ipxe . buildIPXE ( conf )
build . displayStats ( iso )
2016-12-03 06:07:41 -05:00
print ( ' {0} : Finish. ' . format ( datetime . datetime . now ( ) ) )