diff options
Diffstat (limited to 'scripts/live-build-config')
-rwxr-xr-x | scripts/live-build-config | 60 |
1 files changed, 56 insertions, 4 deletions
diff --git a/scripts/live-build-config b/scripts/live-build-config index 59f0bbb2..b1a77b4c 100755 --- a/scripts/live-build-config +++ b/scripts/live-build-config @@ -1,4 +1,24 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# +# 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 +# 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 <http://www.gnu.org/licenses/>. +# +# 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 @@ -14,7 +34,9 @@ util.check_build_config() lb_config_tmpl = """ lb config noauto \ --architectures {{architecture}} \ - --bootappend-live "boot=live components hostname=vyos username=live" \ + --bootappend-live "boot=live components hostname=vyos username=live nopersistence noautologin nonetworking union=overlay" \ + --linux-flavours {{architecture}}-vyos \ + --linux-packages linux-image-4.14.26 \ --bootloader syslinux \ --binary-images iso-hybrid \ --debian-installer false \ @@ -22,18 +44,48 @@ lb config noauto \ --iso-application "VyOS" \ --iso-publisher "{{build_by}}" \ --iso-volume "VyOS" \ - --debootstrap-options "--variant=minbase --exclude=isc-dhcp-client,isc-dhcp-common,ifupdown" \ + --debootstrap-options "--variant=minbase --exclude=isc-dhcp-client,isc-dhcp-common,ifupdown --include=apt-transport-https" \ + --mirror-bootstrap {{debian_mirror}} \ + --mirror-chroot {{debian_mirror}} \ + --mirror-chroot-security {{debian_security_mirror}} \ + --mirror-binary {{debian_mirror}} \ + --mirror-binary-security {{debian_security_mirror}} \ + --archive-areas "main contrib non-free" \ + --firmware-chroot true \ + --updates true \ + --security true \ + --apt-indices false "${@}" """ with open(defaults.BUILD_CONFIG, 'r') as f: build_config = json.load(f) +debug = build_config['debug'] + +# Add the additional repositories to package lists +print("Setting up additional APT entries") +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 + lb_config_command = pystache.render(lb_config_tmpl, build_config) print("Configuring live-build") -os.chdir(defaults.BUILD_DIR) +os.chdir(defaults.BUILD_DIR) result = os.system(lb_config_command) if result > 0: print("live-build config failed") |