Merge branch 'master' of square-r00t.net:bdisk
This commit is contained in:
commit
9afa665a75
@ -8,12 +8,15 @@ import bSSL
|
|||||||
import ipxe
|
import ipxe
|
||||||
import bsync
|
import bsync
|
||||||
import bGPG
|
import bGPG
|
||||||
|
import os
|
||||||
|
|
||||||
# we need to:
|
# 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.
|
# 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 not, though, it's no big deal.
|
||||||
# still on the todo: iPXE
|
# still on the todo: iPXE
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
if os.getuid() != 0:
|
||||||
|
exit('{0}: ERROR: BDisk *must* be run as the root user or with sudo!'.format(datetime.datetime.now()))
|
||||||
print('{0}: Starting.'.format(datetime.datetime.now()))
|
print('{0}: Starting.'.format(datetime.datetime.now()))
|
||||||
conf = host.parseConfig(host.getConfig())[1]
|
conf = host.parseConfig(host.getConfig())[1]
|
||||||
prep.dirChk(conf)
|
prep.dirChk(conf)
|
||||||
|
@ -28,6 +28,7 @@ def getConfig(conf_file='/etc/bdisk/build.ini'):
|
|||||||
conf = False
|
conf = False
|
||||||
# define some defailt conf paths in case we're installed by
|
# define some defailt conf paths in case we're installed by
|
||||||
# a package manager. in order of the paths we should search.
|
# a package manager. in order of the paths we should search.
|
||||||
|
currentdir = os.path.abspath('{0}/../extra/dist.build.ini'.format(os.path.dirname(os.path.realpath(__file__))))
|
||||||
default_conf_paths = ['/etc/bdisk/build.ini',
|
default_conf_paths = ['/etc/bdisk/build.ini',
|
||||||
'/usr/share/bdisk/build.ini',
|
'/usr/share/bdisk/build.ini',
|
||||||
'/usr/share/bdisk/extra/build.ini',
|
'/usr/share/bdisk/extra/build.ini',
|
||||||
@ -36,7 +37,8 @@ def getConfig(conf_file='/etc/bdisk/build.ini'):
|
|||||||
'/usr/local/share/docs/bdisk/build.ini',
|
'/usr/local/share/docs/bdisk/build.ini',
|
||||||
'/opt/dev/bdisk/build.ini',
|
'/opt/dev/bdisk/build.ini',
|
||||||
'/opt/dev/bdisk/extra/build.ini',
|
'/opt/dev/bdisk/extra/build.ini',
|
||||||
'/opt/dev/bdisk/extra/dist.build.ini']
|
'/opt/dev/bdisk/extra/dist.build.ini',
|
||||||
|
currentdir]
|
||||||
# if we weren't given one/using the default...
|
# if we weren't given one/using the default...
|
||||||
if conf_file == '/etc/bdisk/build.ini':
|
if conf_file == '/etc/bdisk/build.ini':
|
||||||
if not os.path.isfile(conf_file):
|
if not os.path.isfile(conf_file):
|
||||||
|
Loading…
Reference in New Issue
Block a user