mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
build: T3664: fix the chroot includes path
to account for the current working dir
This commit is contained in:
parent
63369b1ac4
commit
a45a1b3927
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# Copyright (C) 2022 VyOS maintainers and contributors
|
# Copyright (C) 2022-2024 VyOS maintainers and contributors
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License version 2 or later as
|
# it under the terms of the GNU General Public License version 2 or later as
|
||||||
@ -344,8 +344,15 @@ if __name__ == "__main__":
|
|||||||
BUG_REPORT_URL="{build_defaults['bugtracker_url']}"
|
BUG_REPORT_URL="{build_defaults['bugtracker_url']}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
chroot_includes_dir = os.path.join(defaults.BUILD_DIR, defaults.CHROOT_INCLUDES_DIR)
|
# Switch to the build directory, this is crucial for the live-build work
|
||||||
binary_includes_dir = os.path.join(defaults.BUILD_DIR, defaults.BINARY_INCLUDES_DIR)
|
# because the efective build config files etc. are there.
|
||||||
|
#
|
||||||
|
# All directory paths from this point must be relative to BUILD_DIR,
|
||||||
|
# not to the vyos-build repository root.
|
||||||
|
os.chdir(defaults.BUILD_DIR)
|
||||||
|
|
||||||
|
chroot_includes_dir = defaults.CHROOT_INCLUDES_DIR
|
||||||
|
binary_includes_dir = defaults.BINARY_INCLUDES_DIR
|
||||||
vyos_data_dir = os.path.join(chroot_includes_dir, "usr/share/vyos")
|
vyos_data_dir = os.path.join(chroot_includes_dir, "usr/share/vyos")
|
||||||
os.makedirs(vyos_data_dir, exist_ok=True)
|
os.makedirs(vyos_data_dir, exist_ok=True)
|
||||||
with open(os.path.join(vyos_data_dir, 'version.json'), 'w') as f:
|
with open(os.path.join(vyos_data_dir, 'version.json'), 'w') as f:
|
||||||
@ -366,11 +373,6 @@ if __name__ == "__main__":
|
|||||||
with open(os.path.join(chroot_includes_dir, 'usr/lib//os-release'), 'w') as f:
|
with open(os.path.join(chroot_includes_dir, 'usr/lib//os-release'), 'w') as f:
|
||||||
print(os_release, file=f)
|
print(os_release, file=f)
|
||||||
|
|
||||||
|
|
||||||
## Switch to the build directory, this is crucial for the live-build work work
|
|
||||||
## because the efective build config files etc. are there
|
|
||||||
os.chdir(defaults.BUILD_DIR)
|
|
||||||
|
|
||||||
## Clean up earlier build state and artifacts
|
## Clean up earlier build state and artifacts
|
||||||
print("I: Cleaning the build workspace")
|
print("I: Cleaning the build workspace")
|
||||||
os.system("lb clean")
|
os.system("lb clean")
|
||||||
@ -428,11 +430,12 @@ if __name__ == "__main__":
|
|||||||
if has_nonempty_key(build_config, "includes_chroot"):
|
if has_nonempty_key(build_config, "includes_chroot"):
|
||||||
for i in build_config["includes_chroot"]:
|
for i in build_config["includes_chroot"]:
|
||||||
file_path = os.path.join(chroot_includes_dir, i["path"])
|
file_path = os.path.join(chroot_includes_dir, i["path"])
|
||||||
|
if debug:
|
||||||
|
print(f"D: Creating chroot include file: {file_path}")
|
||||||
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
||||||
with open(file_path, 'w') as f:
|
with open(file_path, 'w') as f:
|
||||||
f.write(i["data"])
|
f.write(i["data"])
|
||||||
|
|
||||||
|
|
||||||
## Configure live-build
|
## Configure live-build
|
||||||
lb_config_tmpl = jinja2.Template("""
|
lb_config_tmpl = jinja2.Template("""
|
||||||
lb config noauto \
|
lb config noauto \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user