mirror of
https://github.com/truenas/core-build.git
synced 2026-02-15 07:36:18 +00:00
Adapt existing build scripts to profiles, fixing typos, missing commas, etc while here.
This commit is contained in:
@@ -46,4 +46,4 @@ ports += {
|
||||
e("BUILD_TIMESTAMP=${BUILD_TIMESTAMP}"),
|
||||
e("REVISION=${GIT_REVISION}")
|
||||
]
|
||||
)
|
||||
}
|
||||
@@ -205,7 +205,7 @@ def import_function(filename, fname):
|
||||
def elapsed():
|
||||
timestamp = env('BUILD_STARTED', str(int(time.time())))
|
||||
td = int(timestamp)
|
||||
return str(datetime.timedelta(seconds=time.time() - td))
|
||||
return str(datetime.timedelta(seconds=time.time() - td)).split('.')[0] # XXX
|
||||
|
||||
|
||||
def info(fmt, *args):
|
||||
|
||||
@@ -90,7 +90,7 @@ else:
|
||||
"ctl",
|
||||
# "cxgbe/t4_firmware",
|
||||
# "cxgbe/t5_firmware",
|
||||
"syscons"
|
||||
"syscons",
|
||||
"netgraph/ether",
|
||||
"netgraph/socket"
|
||||
]
|
||||
|
||||
@@ -139,7 +139,7 @@ def installkernel(destdir, log):
|
||||
info('Installing kernel in {0}', log)
|
||||
info('Log file: {0}', log)
|
||||
|
||||
modules = ' '.join(dsl['kernel_module'])
|
||||
modules = ' '.join(config['kernel_modules'])
|
||||
sh(
|
||||
"env MAKEOBJDIRPREFIX=${OBJDIR}",
|
||||
"make",
|
||||
|
||||
@@ -63,8 +63,8 @@ def create_overlay():
|
||||
def create_poudriere_config():
|
||||
sh('mkdir -p ${DISTFILES_CACHE}')
|
||||
setfile('${POUDRIERE_ROOT}/etc/poudriere.conf', template('${BUILD_CONFIG}/templates/poudriere.conf', {
|
||||
'ports_repo': reposconf['repository']['ports']['path'],
|
||||
'ports_branch': reposconf['repository']['ports']['branch'],
|
||||
'ports_repo': config['repos'].where(name='ports')['path'],
|
||||
'ports_branch': config['repos'].where(name='ports')['branch'],
|
||||
}))
|
||||
|
||||
tree = e('${POUDRIERE_ROOT}/etc/poudriere.d/ports/p')
|
||||
@@ -83,11 +83,11 @@ def create_ports_list():
|
||||
sh('rm -rf', portoptions)
|
||||
|
||||
f = open(portslist, 'w')
|
||||
for port in installer_ports['ports'] + config['ports'].values():
|
||||
for port in installer_ports['ports'] + config['ports']:
|
||||
name = port['name'] if isinstance(port, dict) else port
|
||||
name_und = name.replace('/', '_')
|
||||
options_path = pathjoin(portoptions, name_und)
|
||||
f.write('{0}\n'.format(port['name']))
|
||||
f.write('{0}\n'.format(name))
|
||||
|
||||
sh('mkdir -p', options_path)
|
||||
if isinstance(port, dict) and 'options' in port:
|
||||
@@ -128,12 +128,12 @@ def merge_freenas_ports():
|
||||
|
||||
|
||||
def prepare_env():
|
||||
for cmd in jailconf.get('copy', []).values():
|
||||
for cmd in jailconf.get('copy', []):
|
||||
dest = os.path.join(e('${JAIL_DESTDIR}'), cmd['dest'][1:])
|
||||
sh('rm -rf ${dest}')
|
||||
sh('cp -a', cmd['source'], dest)
|
||||
|
||||
for cmd in jailconf.get('link', []).values():
|
||||
for cmd in jailconf.get('link', []):
|
||||
flags = '-o {0}'.format(cmd['flags']) if 'flags' in cmd else ''
|
||||
dest = os.path.join(e('${JAIL_DESTDIR}'), cmd['dest'][1:])
|
||||
sh('mkdir -p', os.path.dirname(dest))
|
||||
@@ -143,7 +143,7 @@ def prepare_env():
|
||||
def cleanup_env():
|
||||
sh('umount -f ${PORTS_OVERLAY}')
|
||||
sh('rm -rf ${PORTS_OVERLAY}')
|
||||
for cmd in jailconf.get('link', []).values():
|
||||
for cmd in jailconf.get('link', []):
|
||||
sh('umount -f', cmd['source'])
|
||||
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
|
||||
|
||||
import os
|
||||
from dsl import load_file
|
||||
from dsl import load_profile_config
|
||||
from utils import sh, sh_str, info, debug, e, setfile, appendfile
|
||||
|
||||
|
||||
dsl = load_file('${BUILD_CONFIG}/repos.pyd', os.environ)
|
||||
dsl = load_profile_config()
|
||||
manifest = {sh_str("git config --get remote.origin.url"): sh_str("git rev-parse --short HEAD")}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ def generate_manifest():
|
||||
appendfile('${BUILD_ROOT}/FreeBSD/repo-manifest', e('${k} ${v}'))
|
||||
|
||||
if __name__ == '__main__':
|
||||
for i in dsl['repository'].values():
|
||||
for i in dsl['repos']:
|
||||
info('Checkout: {0} -> {1}', i['name'], i['path'])
|
||||
debug('Repository URL: {0}', i['url'])
|
||||
debug('Local branch: {0}', i['branch'])
|
||||
|
||||
@@ -32,7 +32,6 @@ from utils import glob, e, info
|
||||
|
||||
|
||||
def main():
|
||||
info("Selected profile: {0}", e('${PROFILE}') or 'default')
|
||||
info("Available profiles:")
|
||||
for i in glob("${BUILD_PROFILES}/*"):
|
||||
dsl = load_file(e("${i}/config.pyd"), os.environ)
|
||||
@@ -40,7 +39,8 @@ def main():
|
||||
continue
|
||||
|
||||
profile = dsl["profile"]
|
||||
info('{0}', profile["name"])
|
||||
selected = e("${PROFILE}") == profile["name"]
|
||||
info('* {0}{1}', profile["name"], " [selected]" if selected else "")
|
||||
info('\tDescription: {0}', profile["description"])
|
||||
info('\tOwner: {0}', profile["owner"])
|
||||
info('\tStatus: {0}', profile["status"])
|
||||
|
||||
Reference in New Issue
Block a user