Make it possible to use local prebuilts
This commit is contained in:
parent
398e1f0326
commit
da8a437341
2 changed files with 28 additions and 8 deletions
28
image.py
28
image.py
|
@ -142,18 +142,30 @@ def cmd_build(verbose):
|
|||
|
||||
rootfs_mount = mount_rootfs_image(image_name)
|
||||
|
||||
extra_repos = {
|
||||
'main': {
|
||||
'Server': 'https://gitlab.com/kupfer/packages/prebuilts/-/raw/main/$repo',
|
||||
},
|
||||
'device': {
|
||||
'Server': 'https://gitlab.com/kupfer/packages/prebuilts/-/raw/main/$repo',
|
||||
},
|
||||
}
|
||||
|
||||
if os.path.exists('/prebuilts'):
|
||||
extra_repos = {
|
||||
'main': {
|
||||
'Server': 'file:///prebuilts/$repo',
|
||||
},
|
||||
'device': {
|
||||
'Server': 'file:///prebuilts/$repo',
|
||||
},
|
||||
}
|
||||
|
||||
create_chroot(
|
||||
rootfs_mount,
|
||||
packages=(['base', 'base-kupfer'] + devices[device] + flavours[flavour]),
|
||||
pacman_conf='/app/local/etc/pacman.conf',
|
||||
extra_repos={
|
||||
'main': {
|
||||
'Server': 'https://gitlab.com/kupfer/packages/prebuilts/-/raw/main/$repo',
|
||||
},
|
||||
'device': {
|
||||
'Server': 'https://gitlab.com/kupfer/packages/prebuilts/-/raw/main/$repo',
|
||||
},
|
||||
},
|
||||
extra_repos=extra_repos,
|
||||
)
|
||||
create_chroot_user(rootfs_mount)
|
||||
|
||||
|
|
|
@ -58,6 +58,13 @@ else:
|
|||
|
||||
atexit.register(at_exit)
|
||||
|
||||
prebuilts_mount = []
|
||||
if os.getenv('KUPFERBOOTSTRAP_PREBUILTS') != '':
|
||||
prebuilts_mount = [
|
||||
'-v',
|
||||
f'{os.getenv("KUPFERBOOTSTRAP_PREBUILTS")}:/prebuilts:z',
|
||||
]
|
||||
|
||||
subprocess.run([
|
||||
'docker',
|
||||
'run',
|
||||
|
@ -69,6 +76,7 @@ else:
|
|||
'--privileged',
|
||||
'-v',
|
||||
f'{os.getcwd()}:/src:z',
|
||||
] + prebuilts_mount + [
|
||||
'-v',
|
||||
f'{os.path.join(appdirs.user_cache_dir("kupfer"),"chroot")}:/chroot:z',
|
||||
'-v',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue