Merge pull request #278 from jsimpso/current

T4796: Fix some bugs in the build-vyos-image script
This commit is contained in:
Daniil Baturin 2022-11-07 16:43:58 +00:00 committed by GitHub
commit 1b94e4fce8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View File

@ -1,3 +1,10 @@
additional_repositories = [
"deb [arch=amd64] https://repo.saltproject.io/py3/debian/11/amd64/3004 bullseye main",
"deb [arch=amd64] http://repo.powerdns.com/debian bullseye-rec-48 main"
]
kernel_flavor = "amd64-vyos"
# Packages added to images for x86 by default # Packages added to images for x86 by default
packages = [ packages = [
"grub2", "grub2",
@ -6,5 +13,3 @@ packages = [
"vyos-intel-qat", "vyos-intel-qat",
"telegraf" "telegraf"
] ]
kernel_flavor = "amd64-vyos"

View File

@ -14,11 +14,6 @@ release_train = "current"
kernel_version = "5.15.77" kernel_version = "5.15.77"
additional_repositories = [
"deb [arch=amd64] https://repo.saltproject.io/py3/debian/11/amd64/3004 bullseye main",
"deb [arch=amd64] http://repo.powerdns.com/debian bullseye-rec-48 main"
]
website_url = "https://vyos.io" website_url = "https://vyos.io"
support_url = "https://support.vyos.io" support_url = "https://support.vyos.io"
bugtracker_url = "https://phabricator.vyos.net" bugtracker_url = "https://phabricator.vyos.net"

View File

@ -71,7 +71,7 @@ def merge_dicts(source, destination):
if key not in tmp: if key not in tmp:
tmp[key] = value tmp[key] = value
elif isinstance(source[key], dict): elif isinstance(source[key], dict):
tmp[key] = dict_merge(source[key], tmp[key]) tmp[key] = merge_dicts(source[key], tmp[key])
elif isinstance(source[key], list): elif isinstance(source[key], list):
tmp[key] = source[key] + tmp[key] tmp[key] = source[key] + tmp[key]
else: else:
@ -206,10 +206,6 @@ if __name__ == "__main__":
print("Use --build-type=release option if you want to set version number") print("Use --build-type=release option if you want to set version number")
sys.exit(1) sys.exit(1)
if not args['custom_apt_entry']:
args['custom_apt_entry'] = []
args['custom_apt_entry'] = args['custom_apt_entry'] + build_defaults['additional_repositories']
## Inject some useful hardcoded options ## Inject some useful hardcoded options
args['build_dir'] = defaults.BUILD_DIR args['build_dir'] = defaults.BUILD_DIR
args['pbuilder_config'] = os.path.join(defaults.BUILD_DIR, defaults.PBUILDER_CONFIG) args['pbuilder_config'] = os.path.join(defaults.BUILD_DIR, defaults.PBUILDER_CONFIG)
@ -385,6 +381,10 @@ if __name__ == "__main__":
f.write(vyos_repo_entry) f.write(vyos_repo_entry)
# Add custom APT entries # Add custom APT entries
if not args['custom_apt_entry']:
args['custom_apt_entry'] = []
if build_config['additional_repositories']:
args['custom_apt_entry'] = args['custom_apt_entry'] + build_config['additional_repositories']
if build_config['custom_apt_entry']: if build_config['custom_apt_entry']:
custom_apt_file = defaults.CUSTOM_REPO_FILE custom_apt_file = defaults.CUSTOM_REPO_FILE
entries = "\n".join(build_config['custom_apt_entry']) entries = "\n".join(build_config['custom_apt_entry'])
@ -397,7 +397,7 @@ if __name__ == "__main__":
# Add custom APT keys # Add custom APT keys
if has_nonempty_key(build_config, 'custom_apt_key'): if has_nonempty_key(build_config, 'custom_apt_key'):
key_dir = ARCHIVES_DIR key_dir = defaults.ARCHIVES_DIR
for k in build_config['custom_apt_key']: for k in build_config['custom_apt_key']:
dst_name = '{0}.key.chroot'.format(os.path.basename(k)) dst_name = '{0}.key.chroot'.format(os.path.basename(k))
shutil.copy(k, os.path.join(key_dir, dst_name)) shutil.copy(k, os.path.join(key_dir, dst_name))