diff options
-rwxr-xr-x | scripts/build-vyos-image | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/build-vyos-image b/scripts/build-vyos-image index afeed480..0f96cd68 100755 --- a/scripts/build-vyos-image +++ b/scripts/build-vyos-image @@ -1,6 +1,6 @@ #!/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 # it under the terms of the GNU General Public License version 2 or later as @@ -331,7 +331,14 @@ if __name__ == "__main__": 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 + # 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 vyos_data_dir = os.path.join(chroot_includes_dir, "usr/share/vyos") os.makedirs(vyos_data_dir, exist_ok=True) with open(os.path.join(vyos_data_dir, 'version.json'), 'w') as f: @@ -351,8 +358,11 @@ if __name__ == "__main__": 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 + # Switch to the build directory, this is crucial for the live-build work + # 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) ## Clean up earlier build state and artifacts |