diff options
author | Daniil Baturin <daniil@baturin.org> | 2018-01-11 05:57:57 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2018-01-11 06:31:21 +0100 |
commit | 522ebc6250d5fd007c199396cbd046dd7134de8d (patch) | |
tree | 7539f67dd6adfe320e019b24ab3ab9cff7ee830d /scripts | |
parent | 81cacb0a31a45e1eb501dd7a004ad1074fc59b1d (diff) | |
download | vyos-build-522ebc6250d5fd007c199396cbd046dd7134de8d.tar.gz vyos-build-522ebc6250d5fd007c199396cbd046dd7134de8d.zip |
T519: make VyOS package mirror configurable.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build-config | 4 | ||||
-rw-r--r-- | scripts/defaults.py | 8 | ||||
-rwxr-xr-x | scripts/live-build-config | 11 |
3 files changed, 20 insertions, 3 deletions
diff --git a/scripts/build-config b/scripts/build-config index ae8501e8..56fc7a88 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2015 VyOS maintainers and contributors +# Copyright (C) 2018, 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 @@ -52,6 +52,7 @@ options = { 'debian-mirror': ('Debian repository mirror for ISO build', lambda: defaults.DEBIAN_MIRROR, None), 'debian-security-mirror': ('Debian security updated mirror', lambda: defaults.DEBIAN_SECURITY_MIRROR, None), 'pbuilder-debian-mirror': ('Debian repository mirror for pbuilder env bootstrap', lambda: defaults.DEBIAN_MIRROR, None), + 'vyos-mirror': ('VyOS package mirror', lambda: defaults.VYOS_MIRROR, None), 'build-type': ('Build type, release or development', lambda: 'development', lambda x: x in ['release', 'development']), 'version': ('Version number (release builds only)', None, None) } @@ -96,6 +97,7 @@ if args['build_type'] == 'development': args['distribution'] = defaults.DEBIAN_DISTRIBUTION args['build_dir'] = os.path.join(os.getcwd(), defaults.BUILD_DIR) args['pbuilder_config'] = defaults.PBUILDER_CONFIG +args['vyos_branch'] = defaults.VYOS_BRANCH # Check the build environment and dependencies env_check_retval = os.system("scripts/check-build-env") diff --git a/scripts/defaults.py b/scripts/defaults.py index 0792d6b2..e18e3f7c 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015 VyOS maintainers and contributors +# Copyright (C) 2018 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 @@ -32,3 +32,9 @@ PBUILDER_DIR = os.path.join(BUILD_DIR, 'pbuilder') LB_CONFIG_DIR = os.path.join(BUILD_DIR, 'config') CHROOT_INCLUDES_DIR = os.path.join(LB_CONFIG_DIR, 'includes.chroot') + +VYOS_MIRROR = 'http://dev.packages.vyos.net/repositories/current/vyos' + +VYOS_BRANCH = 'current' + +VYOS_REPO_FILE = 'config/archives/vyos.list.chroot' diff --git a/scripts/live-build-config b/scripts/live-build-config index e0924f93..1880be39 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2015 VyOS maintainers and contributors +# Copyright (C) 2018 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 @@ -60,6 +60,15 @@ lb config noauto \ with open(defaults.BUILD_CONFIG, 'r') as f: build_config = json.load(f) +# Add the additional repositories to package lists +print("Setting up additional APT entries") +vyos_repo_entry = "deb {0} {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) + +with open(os.path.join(defaults.BUILD_DIR, defaults.VYOS_REPO_FILE), 'w') as f: + f.write(vyos_repo_entry) + +# Configure live-build + lb_config_command = pystache.render(lb_config_tmpl, build_config) print("Configuring live-build") |