mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
T3664: Add support for local packages, generate apt release pinning
* APT::Default-Release caused an issue when local packages present
This commit is contained in:
parent
4f7f3ee814
commit
fbe8ee6e19
@ -1,3 +0,0 @@
|
|||||||
Package: *
|
|
||||||
Pin: release n=current
|
|
||||||
Pin-Priority: 600
|
|
||||||
@ -447,14 +447,22 @@ if __name__ == "__main__":
|
|||||||
--security true \
|
--security true \
|
||||||
--backports true \
|
--backports true \
|
||||||
--apt-recommends false \
|
--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
|
--apt-indices false
|
||||||
"${@}"
|
"${@}"
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
|
||||||
lb_config_command = lb_config_tmpl.render(build_config)
|
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")
|
print("I: Configuring live-build")
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
@ -471,6 +479,11 @@ if __name__ == "__main__":
|
|||||||
print("I: dry-run, not starting image build")
|
print("I: dry-run, not starting image build")
|
||||||
sys.exit(0)
|
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
|
## Build the image
|
||||||
print("I: Starting image build")
|
print("I: Starting image build")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user