From c0cae8b7fec0d5e8a7c8ff9418397587e967fd15 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 24 Dec 2015 16:06:34 -0500 Subject: Add configure script support for Debian mirror options. --- scripts/defaults.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts/defaults.py') diff --git a/scripts/defaults.py b/scripts/defaults.py index 96dfcc98..05f05973 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -2,3 +2,6 @@ import os BUILD_DIR = 'build' BUILD_CONFIG = os.path.join(BUILD_DIR, 'build-config.json') + +# The default mirror was chosen entirely at random +DEBIAN_MIRROR = 'http://ftp.nl.debian.org/debian/' -- cgit v1.2.3 From 595d17abea232345cf4475206363de7c379c3211 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 25 Dec 2015 18:28:27 -0500 Subject: Initial support for pbuilder. Note: pbuilder --create does not work well with relative build path, base.tgz creation fails. This led to the build_dir path being absolute. Perhaps we should make it more granular and only use absolute paths for pbuilder options. --- Makefile | 6 ++++++ scripts/build-config | 7 +++++++ scripts/defaults.py | 5 +++++ scripts/pbuilder-config | 35 +++++++++++++++++++++++++++++++++++ scripts/pbuilder-setup | 34 ++++++++++++++++++++++++++++++++++ scripts/pbuilder/hooks/C10shell | 6 ++++++ 6 files changed, 93 insertions(+) create mode 100755 scripts/pbuilder-config create mode 100755 scripts/pbuilder-setup create mode 100755 scripts/pbuilder/hooks/C10shell (limited to 'scripts/defaults.py') diff --git a/Makefile b/Makefile index ec9ea473..244229d2 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,12 @@ iso: prepare lb build 2>&1 | tee build.log @echo "VyOS ISO build successful" +.PHONY: prepare-package-env +.ONESHELL: +prepare-package-env: + @scripts/pbuilder-config + @scripts/pbuilder-setup + .PHONY: clean .ONESHELL: clean: diff --git a/scripts/build-config b/scripts/build-config index f04dcb3f..e001ef3d 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -51,6 +51,13 @@ if (args['debian_mirror'] != defaults.DEBIAN_MIRROR) and \ (args['pbuilder_debian_mirror'] == defaults.DEBIAN_MIRROR): args['pbuilder_debian_mirror'] = args['debian-mirror'] +# Populate some defaults that are not configurable, +# but that are handy to have in the options hash +args['distribution'] = defaults.DEBIAN_DISTRIBUTION +args['build_dir'] = os.path.join(os.getcwd(), defaults.BUILD_DIR) +args['pbuilder_config'] = defaults.PBUILDER_CONFIG + + # Save to file distutils.dir_util.mkpath(defaults.BUILD_DIR) diff --git a/scripts/defaults.py b/scripts/defaults.py index 05f05973..2dbaeb0c 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -5,3 +5,8 @@ BUILD_CONFIG = os.path.join(BUILD_DIR, 'build-config.json') # The default mirror was chosen entirely at random DEBIAN_MIRROR = 'http://ftp.nl.debian.org/debian/' + +DEBIAN_DISTRIBUTION = 'jessie' + +PBUILDER_CONFIG = os.path.join(BUILD_DIR, 'pbuilderrc') +PBUILDER_DIR = os.path.join(BUILD_DIR, 'pbuilder') diff --git a/scripts/pbuilder-config b/scripts/pbuilder-config new file mode 100755 index 00000000..5cda7b13 --- /dev/null +++ b/scripts/pbuilder-config @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +import sys +import os +import json + +import pystache + +import defaults +import util + +util.check_build_config() + +pbuilder_config_tmpl = """ + +BASETGZ={{build_dir}}/base.tgz +BUILDPLACE={{build_dir}}/pbuilder/ +MIRRORSITE={{pbuilder_debian_mirror}} +BUILDRESULT={{build_dir}}/pbuilder/result/ + +DISTRIBUTION={{distribution}} + +ARCHITECTURE={{architecture}} + +""" + +with open(defaults.BUILD_CONFIG, 'r') as f: + build_config = json.load(f) + +pbuilder_config = pystache.render(pbuilder_config_tmpl, build_config) + +print("Configuring pbuilder") + +with open(defaults.PBUILDER_CONFIG, 'w+') as f: + f.write(pbuilder_config) diff --git a/scripts/pbuilder-setup b/scripts/pbuilder-setup new file mode 100755 index 00000000..264db0b2 --- /dev/null +++ b/scripts/pbuilder-setup @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +import sys +import os +import json +import distutils.dir_util + +import pystache + +import defaults +import util + +util.check_build_config() + +pbuilder_create_cmd_tmpl= """ + sudo pbuilder --create \ + --configfile {{pbuilder_config}} +""" + +with open(defaults.BUILD_CONFIG, 'r') as f: + build_config = json.load(f) + +pbuilder_create_command = pystache.render(pbuilder_create_cmd_tmpl, build_config) + +print("Creating a pbuilder environment") +#os.chdir(defaults.BUILD_DIR) + +distutils.dir_util.mkpath(defaults.PBUILDER_DIR) + +result = os.system(pbuilder_create_command) +if result > 0: + print("pbuilder environment bootstrap failed") + sys.exit(1) + diff --git a/scripts/pbuilder/hooks/C10shell b/scripts/pbuilder/hooks/C10shell new file mode 100755 index 00000000..f56f9f7f --- /dev/null +++ b/scripts/pbuilder/hooks/C10shell @@ -0,0 +1,6 @@ +#!/bin/sh +# invoke shell if build fails. + +apt-get install -y --force-yes vim nano less bash +cd /tmp/buildd/*/debian/.. +/bin/bash < /dev/tty > /dev/tty 2> /dev/tty -- cgit v1.2.3 From 90ca7062c19e7237d9e4f3fe9f442db2a99a7048 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 26 Dec 2015 20:14:08 -0500 Subject: Add license headers to scripts. Some people rightfully complained about their absense already. --- scripts/build-config | 24 ++++++++++++++++++++++++ scripts/check-build-env | 20 ++++++++++++++++++++ scripts/check-config | 21 +++++++++++++++++++++ scripts/defaults.py | 18 ++++++++++++++++++ scripts/live-build-config | 20 ++++++++++++++++++++ scripts/pbuilder-config | 19 +++++++++++++++++++ scripts/pbuilder-setup | 19 +++++++++++++++++++ scripts/util.py | 19 +++++++++++++++++++ tools/gpl-header-template | 17 +++++++++++++++++ 9 files changed, 177 insertions(+) create mode 100644 tools/gpl-header-template (limited to 'scripts/defaults.py') diff --git a/scripts/build-config b/scripts/build-config index e001ef3d..d0d2fdac 100755 --- a/scripts/build-config +++ b/scripts/build-config @@ -1,4 +1,26 @@ #!/usr/bin/env python +# Copyright (C) 2015 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 +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: build-config +# Purpose: +# This script serves the same purpose as ./configure in traditional +# autoconf setups. +# It takes build configuration options from command line, checks them, +# builds a config dictionary, augments it with some default and/or +# computed values and saves it to build/build-config.json +# for other build scripts to read. import argparse import re @@ -21,6 +43,8 @@ def get_default_build_by(): return "{user}@{host}".format(user= getpass.getuser(), host=platform.node()) +# Options dict format: +# '$option_name_without_leading_dashes': { ('$help_string', $default_value_generator_thunk, $value_checker_thunk) } options = { 'architecture': ('Image target architecture (amd64 or i586)', lambda: 'amd64', lambda x: x in ['amd64', 'i586']), 'build-by': ('Builder identifier (e.g. jrandomhacker@example.net)', get_default_build_by, None), diff --git a/scripts/check-build-env b/scripts/check-build-env index 168c7199..6f08847f 100755 --- a/scripts/check-build-env +++ b/scripts/check-build-env @@ -1,4 +1,24 @@ #!/usr/bin/env python +# +# Copyright (C) 2015 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 +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: check-build-env +# Purpose: +# Checks if packages required for package and ISO image build +# are installed. + import os import sys diff --git a/scripts/check-config b/scripts/check-config index 3949869b..58a1a3f1 100755 --- a/scripts/check-config +++ b/scripts/check-config @@ -1,4 +1,25 @@ #!/usr/bin/env python +# +# Copyright (C) 2015 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 +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: check-config +# Purpose: +# Checks if the build config file (build/build-config.json) exists. +# This is to prevent accidental execution of plumbing make targets +# from going too far and failing with confusing errors. + import sys import os diff --git a/scripts/defaults.py b/scripts/defaults.py index 2dbaeb0c..beef4a7a 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -1,3 +1,21 @@ +# Copyright (C) 2015 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 +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: defaults.py +# Purpose: Various default values for use in build scripts. + + import os BUILD_DIR = 'build' diff --git a/scripts/live-build-config b/scripts/live-build-config index 59f0bbb2..bd9a7767 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -1,4 +1,24 @@ #!/usr/bin/env python +# +# Copyright (C) 2015 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 +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: live-build-config +# Purpose: +# Creates a live-build config command from template using the build config +# and executes it, to prepare the system for building the installation ISO. + import sys import os diff --git a/scripts/pbuilder-config b/scripts/pbuilder-config index 5cda7b13..06e14cbf 100755 --- a/scripts/pbuilder-config +++ b/scripts/pbuilder-config @@ -1,4 +1,23 @@ #!/usr/bin/env python +# +# Copyright (C) 2015 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 +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: pbuilder-config +# Purpose: +# Generates a pbuilderrc file for use by package build scripts. + import sys import os diff --git a/scripts/pbuilder-setup b/scripts/pbuilder-setup index 264db0b2..fbd49a4f 100755 --- a/scripts/pbuilder-setup +++ b/scripts/pbuilder-setup @@ -1,4 +1,23 @@ #!/usr/bin/env python +# +# Copyright (C) 2015 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 +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: pbuilder-setup +# Purpose: +# Bootstraps a Debian environment for use by pbuilder. + import sys import os diff --git a/scripts/util.py b/scripts/util.py index 740d4ccc..00377672 100644 --- a/scripts/util.py +++ b/scripts/util.py @@ -1,3 +1,22 @@ +# Copyright (C) 2015 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 +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: util.py +# Purpose: +# Various common functions for use in build scripts. + + import sys import os diff --git a/tools/gpl-header-template b/tools/gpl-header-template new file mode 100644 index 00000000..f3f82192 --- /dev/null +++ b/tools/gpl-header-template @@ -0,0 +1,17 @@ +# Copyright (C) 2015 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 +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: +# Purpose: + -- cgit v1.2.3 From cddc611ae3a6da15aaa2bded568209bb3eca27de Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 26 Jan 2016 16:10:52 -0500 Subject: Add a build step for generating version files. --- Makefile | 2 ++ scripts/defaults.py | 3 +++ scripts/make-version-file | 66 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100755 scripts/make-version-file (limited to 'scripts/defaults.py') diff --git a/Makefile b/Makefile index 0c6d7b5a..56e61d9b 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,8 @@ prepare: @scripts/live-build-config cp -r data/live-build-config/* build/config/ + @scripts/make-version-file + .PHONY: iso .ONESHELL: iso: prepare diff --git a/scripts/defaults.py b/scripts/defaults.py index beef4a7a..b9a3f255 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -28,3 +28,6 @@ DEBIAN_DISTRIBUTION = 'jessie' PBUILDER_CONFIG = os.path.join(BUILD_DIR, 'pbuilderrc') 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') diff --git a/scripts/make-version-file b/scripts/make-version-file new file mode 100755 index 00000000..fcc399f8 --- /dev/null +++ b/scripts/make-version-file @@ -0,0 +1,66 @@ +#!/usr/bin/python +# Copyright (C) 2016 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 +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# File: make-version-file +# Purpose: +# Creates version file in live-build chroot includes dir +# that is included in the image and used by 'show version' command +# and install/upgrade scripts. + +from __future__ import print_function +import os +import datetime +import json +import uuid + +import defaults +import util + +util.check_build_config() +with open(defaults.BUILD_CONFIG, 'r') as f: + build_config = json.load(f) + + +now = datetime.datetime.today() + +build_timestamp = now.strftime("%Y%m%d%H%M") + +# FIXME: use aware rather than naive object +build_date = now.strftime("%a %d %b %Y %H:%M UTC") + +# Assign a (hopefully) unique identifier to the build (UUID) +build_id = str(uuid.uuid4()) + +if build_config['build_type'] == 'development': + version = "999.{0}".format(build_timestamp) +else: + version = build_config['version'] + +version_data = { + 'version': version, + 'built_by': build_config['build_by'], + 'built_on': build_date, + 'build_id': build_id +} + + +with open(os.path.join(defaults.CHROOT_INCLUDES_DIR, 'opt/vyatta/etc/version.json'), 'w') as f: + json.dump(version_data, f) + +# For backwards compatibility with 'add system image' script from older versions +# we need a file in old format so that script can find out the version of the image +# for upgrade +with open(os.path.join(defaults.CHROOT_INCLUDES_DIR, 'opt/vyatta/etc/version'), 'w') as f: + print("Version: {0}".format(version), file=f) -- cgit v1.2.3 From 53a878bb2d18a450f4096403d80461dd566ef29e Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 21 Dec 2016 22:28:17 +0100 Subject: lb-config improvements: force firmware packages to be added to the image, and make security mirror configurable. XXX: need to find out how to make --security work too. --- data/live-build-config/archives/vyos.list.chroot | 1 - scripts/defaults.py | 1 + scripts/live-build-config | 4 +++- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/defaults.py') diff --git a/data/live-build-config/archives/vyos.list.chroot b/data/live-build-config/archives/vyos.list.chroot index 664b408c..2b117386 100644 --- a/data/live-build-config/archives/vyos.list.chroot +++ b/data/live-build-config/archives/vyos.list.chroot @@ -1,2 +1 @@ deb http://dev.packages.vyos.net/vyos current main -deb http://security.debian.org/ jessie/updates main diff --git a/scripts/defaults.py b/scripts/defaults.py index b9a3f255..0792d6b2 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -23,6 +23,7 @@ BUILD_CONFIG = os.path.join(BUILD_DIR, 'build-config.json') # The default mirror was chosen entirely at random DEBIAN_MIRROR = 'http://ftp.nl.debian.org/debian/' +DEBIAN_SECURITY_MIRROR = 'http://security.debian.org/' DEBIAN_DISTRIBUTION = 'jessie' diff --git a/scripts/live-build-config b/scripts/live-build-config index 52660571..6ac49bd7 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -49,7 +49,9 @@ lb config noauto \ --mirror-chroot {{debian_mirror}} \ --mirror-chroot-security {{debian_mirror}} \ --mirror-binary {{debian_mirror}} \ - --mirror-binary-security {{debian_mirror}} + --mirror-binary-security {{debian_security_mirror}} \ + --archive-areas "main contrib non-free" \ + --firmware-chroot true "${@}" """ -- cgit v1.2.3 From 522ebc6250d5fd007c199396cbd046dd7134de8d Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 11 Jan 2018 05:57:57 +0100 Subject: T519: make VyOS package mirror configurable. --- data/live-build-config/archives/vyos.list.chroot | 1 - scripts/build-config | 4 +++- scripts/defaults.py | 8 +++++++- scripts/live-build-config | 11 ++++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) delete mode 100644 data/live-build-config/archives/vyos.list.chroot (limited to 'scripts/defaults.py') diff --git a/data/live-build-config/archives/vyos.list.chroot b/data/live-build-config/archives/vyos.list.chroot deleted file mode 100644 index 2b117386..00000000 --- a/data/live-build-config/archives/vyos.list.chroot +++ /dev/null @@ -1 +0,0 @@ -deb http://dev.packages.vyos.net/vyos current main 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") -- cgit v1.2.3 From ab00043201c1c95ad4345e655c2299a39dc2fec5 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 12 Jan 2018 05:03:59 +0100 Subject: T520: use the load balanced Debian mirror by default. --- scripts/defaults.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/defaults.py') diff --git a/scripts/defaults.py b/scripts/defaults.py index e18e3f7c..bb6f0910 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -22,8 +22,8 @@ BUILD_DIR = 'build' BUILD_CONFIG = os.path.join(BUILD_DIR, 'build-config.json') # The default mirror was chosen entirely at random -DEBIAN_MIRROR = 'http://ftp.nl.debian.org/debian/' -DEBIAN_SECURITY_MIRROR = 'http://security.debian.org/' +DEBIAN_MIRROR = 'http://deb.debian.org/debian' +DEBIAN_SECURITY_MIRROR = 'http://deb.debian.org/debian-security' DEBIAN_DISTRIBUTION = 'jessie' -- cgit v1.2.3 From 17de291859b87bfb7d477adbe1a40d19f3f61ae0 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 20 May 2018 10:04:31 +0200 Subject: T561: split vyos and debian repos. --- scripts/defaults.py | 2 +- scripts/live-build-config | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts/defaults.py') diff --git a/scripts/defaults.py b/scripts/defaults.py index bb6f0910..93eadc30 100644 --- a/scripts/defaults.py +++ b/scripts/defaults.py @@ -33,7 +33,7 @@ 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_MIRROR = 'http://dev.packages.vyos.net/repositories/current' VYOS_BRANCH = 'current' diff --git a/scripts/live-build-config b/scripts/live-build-config index 5814bf89..b1a77b4c 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -65,16 +65,19 @@ debug = build_config['debug'] # 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']) +vyos_repo_entry = "deb {0}/vyos {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) +vyos_debian_repo_entry = "deb {0}/debian {1} main\n".format(build_config['vyos_mirror'], build_config['vyos_branch']) apt_file = os.path.join(build_config['build_dir'], defaults.VYOS_REPO_FILE) if debug: print("Adding these entries to {0}:".format(apt_file)) print("\t", vyos_repo_entry) + print("\t", vyos_debian_repo_entry) with open(apt_file, 'w') as f: f.write(vyos_repo_entry) + f.write(vyos_debian_repo_entry) # Configure live-build -- cgit v1.2.3