updated- docs might have some bugs, but working
This commit is contained in:
parent
f26e03fda9
commit
2545d0742a
@ -12,12 +12,15 @@ def genGPG(conf):
|
||||
dlpath = build['dlpath']
|
||||
bdisk = conf['bdisk']
|
||||
gpghome = conf['gpg']['mygpghome']
|
||||
distkey = build['gpgkey']
|
||||
distkeys = []
|
||||
gpgkeyserver = []
|
||||
for a in conf['build']['arch']:
|
||||
keysrv = conf['src'][a]['gpgkeyserver']
|
||||
distkey = conf['src'][a]['gpgkey']
|
||||
if keysrv and (keysrv not in gpgkeyserver):
|
||||
gpgkeyserver.append(keysrv)
|
||||
if distkey not in distkeys:
|
||||
distkeys.append(distkey)
|
||||
templates_dir = '{0}/extra/templates'.format(build['basedir'])
|
||||
mykey = False
|
||||
pkeys = []
|
||||
@ -80,13 +83,9 @@ def genGPG(conf):
|
||||
gpg.signers = pkeys
|
||||
# Now we try to find and add the key for the base image.
|
||||
gpg.keylist_mode = gpgme.KEYLIST_MODE_EXTERN # remote (keyserver)
|
||||
if distkey: # testing
|
||||
#try:
|
||||
key = gpg.get_key(distkey)
|
||||
#except:
|
||||
# exit('{0}: ERROR: We cannot find key ID {1}!'.format(
|
||||
# datetime.datetime.now(),
|
||||
# distkey))
|
||||
if len(distkeys) > 0: # testing
|
||||
for k in distkeys:
|
||||
key = gpg.get_key(k)
|
||||
importkey = key.subkeys[0].fpr
|
||||
gpg.keylist_mode = gpgme.KEYLIST_MODE_LOCAL # local keyring (default)
|
||||
DEVNULL = open(os.devnull, 'w')
|
||||
@ -100,8 +99,8 @@ def genGPG(conf):
|
||||
'0x{0}'.format(importkey)]
|
||||
subprocess.call(cmd, stdout = DEVNULL, stderr = subprocess.STDOUT)
|
||||
sigkeys = []
|
||||
for k in gpg.get_key(importkey).subkeys:
|
||||
sigkeys.append(k.fpr)
|
||||
for i in gpg.get_key(importkey).subkeys:
|
||||
sigkeys.append(i.fpr)
|
||||
cmd = ['/usr/bin/gpg',
|
||||
'--batch',
|
||||
'--yes',
|
||||
|
@ -129,7 +129,6 @@ def parseConfig(confs):
|
||||
config_dict['src'] = {}
|
||||
for a in config_dict['build']['arch']:
|
||||
config_dict['src'][a] = config_dict['source_' + a]
|
||||
if config_dict['src'][a]['enabled']:
|
||||
if (validators.domain(config_dict['src'][a]['mirror']) or validators.ipv4(
|
||||
config_dict['src'][a]['mirror']) or validatords.ipv6(
|
||||
config_dict['src'][a]['mirror'])):
|
||||
|
@ -33,10 +33,8 @@ def downloadTarball(conf):
|
||||
mirror = locsrc['mirrorproto'] + '://' + locsrc['mirror']
|
||||
rlsdir = mirror + locsrc['mirrorpath']
|
||||
if locsrc['mirrorchksum'] != '':
|
||||
if not locsrc['chksumtype']:
|
||||
exit(("{0}: source_{1}:chksumtype is unset!".format(
|
||||
datetime.datetime.now(),
|
||||
a))
|
||||
if locsrc['chksumtype'] == '':
|
||||
exit("{0}: source_{1}:chksumtype is unset!".format(datetime.datetime.now(), a))
|
||||
hash_type = locsrc['chksumtype']
|
||||
hash_in = urlopen(mirror + locsrc['mirrorchksum'])
|
||||
hashsums = hash_in.read()
|
||||
@ -84,7 +82,7 @@ def downloadTarball(conf):
|
||||
tarball_hash = hashfunc(open(tarball_path[a], 'rb').read()).hexdigest()
|
||||
break
|
||||
if not tarball_hash:
|
||||
exit(("{0}: source_{1}:chksumtype '{2}' is not supported on this machine!".format(
|
||||
exit("{0}: source_{1}:chksumtype '{2}' is not supported on this machine!".format(
|
||||
datetime.datetime.now(),
|
||||
a,
|
||||
hash_type))
|
||||
|
@ -514,7 +514,7 @@ What group the HTTP files should be owned as. This is most likely going to be ei
|
||||
. Group must exist on build system
|
||||
|
||||
|======================
|
||||
^s|Can be one of: ^.^m|group name ^.^m|https://linux.die.net/man/5/group[UID]
|
||||
^s|Can be one of: ^.^m|groupname ^.^m|https://linux.die.net/man/5/group[GID]
|
||||
|======================
|
||||
|
||||
=== `[tftp]`
|
||||
@ -546,7 +546,7 @@ What group the TFTP files should be owned as. This is most likely going to be ei
|
||||
. Group must exist on build system
|
||||
|
||||
|======================
|
||||
^s|Can be one of: ^.^m|group name ^.^m|https://linux.die.net/man/5/group[UID]
|
||||
^s|Can be one of: ^.^m|groupname ^.^m|https://linux.die.net/man/5/group[GID]
|
||||
|======================
|
||||
|
||||
=== `[ipxe]`
|
||||
|
Loading…
Reference in New Issue
Block a user