diff options
author | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2022-10-09 21:33:44 +0200 |
---|---|---|
committer | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2022-10-09 21:33:44 +0200 |
commit | fbe8ee6e1992d28795aee315f490f85da21297f1 (patch) | |
tree | d27d8243e3fd1d8ca8ccc488644836f0699ae7d6 /scripts | |
parent | 4f7f3ee8142bf612f613738ec6c47c0d057b30d0 (diff) | |
download | vyos-build-fbe8ee6e1992d28795aee315f490f85da21297f1.tar.gz vyos-build-fbe8ee6e1992d28795aee315f490f85da21297f1.zip |
T3664: Add support for local packages, generate apt release pinning
* APT::Default-Release caused an issue when local packages present
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build-vyos-image | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/build-vyos-image b/scripts/build-vyos-image index efe11af4..3d387a15 100755 --- a/scripts/build-vyos-image +++ b/scripts/build-vyos-image @@ -447,14 +447,22 @@ if __name__ == "__main__": --security true \ --backports true \ --apt-recommends false \ - --apt-options "--yes -oAPT::Default-Release="{{release_train}}" -oAPT::Get::allow-downgrades=true" \ + --apt-options "--yes -oAPT::Get::allow-downgrades=true" \ --apt-indices false "${@}" """) - lb_config_command = lb_config_tmpl.render(build_config) + ## Pin release for VyOS packages + apt_pin = f"""Package: * +Pin: release n={build_config['release_train']} +Pin-Priority: 600 +""" + + with open(f'../data/live-build-config/archives/vyos.pref.chroot', 'w') as f: + f.write(apt_pin) + print("I: Configuring live-build") if debug: @@ -471,6 +479,11 @@ if __name__ == "__main__": print("I: dry-run, not starting image build") sys.exit(0) + ## Add local packages + local_packages = glob.glob('../packages/*.deb') + if local_packages: + for f in local_packages: + shutil.copy(f, 'config/packages.chroot/' + os.path.basename(f)) ## Build the image print("I: Starting image build") |