From fbe8ee6e1992d28795aee315f490f85da21297f1 Mon Sep 17 00:00:00 2001 From: sarthurdev <965089+sarthurdev@users.noreply.github.com> Date: Sun, 9 Oct 2022 21:33:44 +0200 Subject: T3664: Add support for local packages, generate apt release pinning * APT::Default-Release caused an issue when local packages present --- scripts/build-vyos-image | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'scripts') 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") -- cgit v1.2.3