updated- docs might have some bugs, but working

This commit is contained in:
brent s. 2017-03-07 18:38:20 -05:00
parent f26e03fda9
commit 2545d0742a
4 changed files with 43 additions and 47 deletions

View File

@ -12,12 +12,15 @@ def genGPG(conf):
dlpath = build['dlpath'] dlpath = build['dlpath']
bdisk = conf['bdisk'] bdisk = conf['bdisk']
gpghome = conf['gpg']['mygpghome'] gpghome = conf['gpg']['mygpghome']
distkey = build['gpgkey'] distkeys = []
gpgkeyserver = [] gpgkeyserver = []
for a in conf['build']['arch']: for a in conf['build']['arch']:
keysrv = conf['src'][a]['gpgkeyserver'] keysrv = conf['src'][a]['gpgkeyserver']
distkey = conf['src'][a]['gpgkey']
if keysrv and (keysrv not in gpgkeyserver): if keysrv and (keysrv not in gpgkeyserver):
gpgkeyserver.append(keysrv) gpgkeyserver.append(keysrv)
if distkey not in distkeys:
distkeys.append(distkey)
templates_dir = '{0}/extra/templates'.format(build['basedir']) templates_dir = '{0}/extra/templates'.format(build['basedir'])
mykey = False mykey = False
pkeys = [] pkeys = []
@ -80,13 +83,9 @@ def genGPG(conf):
gpg.signers = pkeys gpg.signers = pkeys
# Now we try to find and add the key for the base image. # Now we try to find and add the key for the base image.
gpg.keylist_mode = gpgme.KEYLIST_MODE_EXTERN # remote (keyserver) gpg.keylist_mode = gpgme.KEYLIST_MODE_EXTERN # remote (keyserver)
if distkey: # testing if len(distkeys) > 0: # testing
#try: for k in distkeys:
key = gpg.get_key(distkey) key = gpg.get_key(k)
#except:
# exit('{0}: ERROR: We cannot find key ID {1}!'.format(
# datetime.datetime.now(),
# distkey))
importkey = key.subkeys[0].fpr importkey = key.subkeys[0].fpr
gpg.keylist_mode = gpgme.KEYLIST_MODE_LOCAL # local keyring (default) gpg.keylist_mode = gpgme.KEYLIST_MODE_LOCAL # local keyring (default)
DEVNULL = open(os.devnull, 'w') DEVNULL = open(os.devnull, 'w')
@ -100,8 +99,8 @@ def genGPG(conf):
'0x{0}'.format(importkey)] '0x{0}'.format(importkey)]
subprocess.call(cmd, stdout = DEVNULL, stderr = subprocess.STDOUT) subprocess.call(cmd, stdout = DEVNULL, stderr = subprocess.STDOUT)
sigkeys = [] sigkeys = []
for k in gpg.get_key(importkey).subkeys: for i in gpg.get_key(importkey).subkeys:
sigkeys.append(k.fpr) sigkeys.append(i.fpr)
cmd = ['/usr/bin/gpg', cmd = ['/usr/bin/gpg',
'--batch', '--batch',
'--yes', '--yes',

View File

@ -129,7 +129,6 @@ def parseConfig(confs):
config_dict['src'] = {} config_dict['src'] = {}
for a in config_dict['build']['arch']: for a in config_dict['build']['arch']:
config_dict['src'][a] = config_dict['source_' + a] 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( if (validators.domain(config_dict['src'][a]['mirror']) or validators.ipv4(
config_dict['src'][a]['mirror']) or validatords.ipv6( config_dict['src'][a]['mirror']) or validatords.ipv6(
config_dict['src'][a]['mirror'])): config_dict['src'][a]['mirror'])):

View File

@ -33,10 +33,8 @@ def downloadTarball(conf):
mirror = locsrc['mirrorproto'] + '://' + locsrc['mirror'] mirror = locsrc['mirrorproto'] + '://' + locsrc['mirror']
rlsdir = mirror + locsrc['mirrorpath'] rlsdir = mirror + locsrc['mirrorpath']
if locsrc['mirrorchksum'] != '': if locsrc['mirrorchksum'] != '':
if not locsrc['chksumtype']: if locsrc['chksumtype'] == '':
exit(("{0}: source_{1}:chksumtype is unset!".format( exit("{0}: source_{1}:chksumtype is unset!".format(datetime.datetime.now(), a))
datetime.datetime.now(),
a))
hash_type = locsrc['chksumtype'] hash_type = locsrc['chksumtype']
hash_in = urlopen(mirror + locsrc['mirrorchksum']) hash_in = urlopen(mirror + locsrc['mirrorchksum'])
hashsums = hash_in.read() hashsums = hash_in.read()
@ -84,7 +82,7 @@ def downloadTarball(conf):
tarball_hash = hashfunc(open(tarball_path[a], 'rb').read()).hexdigest() tarball_hash = hashfunc(open(tarball_path[a], 'rb').read()).hexdigest()
break break
if not tarball_hash: 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(), datetime.datetime.now(),
a, a,
hash_type)) hash_type))

View File

@ -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 . 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]` === `[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 . 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]` === `[ipxe]`