From 36c7da470a2255f57c6e9cdf5ce9c642b8cbca4b Mon Sep 17 00:00:00 2001 From: r00t Date: Mon, 21 Nov 2016 03:41:22 -0500 Subject: [PATCH] check-in... --- TODO | 1 - bdisk/__main__.py | 20 -------------------- bdisk/bdisk.py | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 21 deletions(-) delete mode 100755 bdisk/__main__.py create mode 100755 bdisk/bdisk.py diff --git a/TODO b/TODO index f781a7a..cde076a 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,2 @@ -- maybe use ZConfig? https://pypi.python.org/pypi/ZConfig - templating via jinja2: -- for syslinux/isolinux configs diff --git a/bdisk/__main__.py b/bdisk/__main__.py deleted file mode 100755 index 69c8362..0000000 --- a/bdisk/__main__.py +++ /dev/null @@ -1,20 +0,0 @@ -import host -import prep -import bchroot - -# we need to: -# 1.) import the config- this gives us info about things like build paths, etc. host.parseConfig(host.getConfig()) should do this -# 2.) prep.dirChk -# 3.) prep.downloadTarball -# 4.) prep.unpackTarball -# 5.) prep.buildChroot -# 6.) prep.prepChroot -# 7.) prep.chrootCmd (TODO)- this should run the /root/pre-build.sh script -# 7.5) ....figure out a way to get those dirs to *un*mount... and only mount in 7. if they're not currently mounted. -# 8.) build.chrootClean (TODO) see jenny_craig in old bdisk. i can *probably* do this within the chroot for the most part as part of pre-build.sh -# 9.) build.genImg (TODO)- build the squashed image, etc. see will_it_blend in old bdisk -# 10.) build.genUEFI (TODO)- build the uefi binary/bootloading. see stuffy in old bdisk -# 11.) build.genISO (TODO)- build the .iso file (full boot). see yo_dj in old bdisk -# -# 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. diff --git a/bdisk/bdisk.py b/bdisk/bdisk.py new file mode 100755 index 0000000..6cce751 --- /dev/null +++ b/bdisk/bdisk.py @@ -0,0 +1,39 @@ +import host +import prep +import bchroot + +# we need to: +# 1.) import the config- this gives us info about things like build paths, etc. host.parseConfig(host.getConfig()) should do this +# 2.) prep.dirChk +# 3.) prep.downloadTarball +# 4.) prep.unpackTarball +# 5.) prep.buildChroot +# 6.) prep.prepChroot +# 7.) bchroot.chrootCmd (TODO)- this should run the /root/pre-build.sh script +# 7.5) ....figure out a way to get those dirs to *un*mount... and only mount in 7. if they're not currently mounted. +# 8.) build.chrootClean (TODO) see jenny_craig in old bdisk. i can *probably* do this within the chroot for the most part as part of pre-build.sh +# 9.) build.genImg (TODO)- build the squashed image, etc. see will_it_blend in old bdisk +# 10.) build.genUEFI (TODO)- build the uefi binary/bootloading. see stuffy in old bdisk +# 11.) build.genISO (TODO)- build the .iso file (full boot). see yo_dj in old bdisk +# +# 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. +if __name__ == '__main__': + # TODO: config for chrootdir, dlpath + conf = host.parseConfig(host.getConfig())[1] + prep.dirChk(conf) + if conf['build']['multiarch']: + for arch in ('x86_64', 'i686'): + #prep.unpackTarball(prep.downloadTarball(arch, '/var/tmp/bdisk'), '/var/tmp/chroot/' + arch) + prep.buildChroot(arch, '/var/tmp/chroot/' + arch, '/var/tmp/bdisk', conf['build']['basedir'] + '/extra') + prep.prepChroot(conf['build']['basedir'] + '/extra/templates', '/var/tmp/chroot/' + arch, conf['bdisk'], arch) + bchroot.chroot('/var/tmp/chroot/' + arch, 'bdisk.square-r00t.net') + bchroot.chrootUnmount('/var/tmp/chroot/' + arch) + else: + # TODO: implement specific-arch building or separate building instances + for arch in ('x86_64', 'i686'): + #prep.unpackTarball(prep.downloadTarball(arch, '/var/tmp/bdisk'), '/var/tmp/chroot/' + arch) + prep.buildChroot(arch, '/var/tmp/chroot/' + arch, '/var/tmp/bdisk', conf['build']['basedir'] + '/extra') + prep.prepChroot(conf['build']['basedir'] + '/extra/templates', '/var/tmp/chroot/' + arch, conf['bdisk'], arch) + bchroot.chroot('/var/tmp/chroot/' + arch, 'bdisk.square-r00t.net') + bchroot.chrootUnmount('/var/tmp/chroot/' + arch)