diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/check-build-env | 54 | ||||
-rwxr-xr-x | scripts/import-local-packages | 13 | ||||
-rwxr-xr-x | scripts/list-package-arch | 7 | ||||
-rwxr-xr-x | scripts/list-required-firmware | 75 | ||||
-rwxr-xr-x | scripts/pbuilder-config | 54 | ||||
-rwxr-xr-x | scripts/pbuilder-setup | 52 | ||||
-rwxr-xr-x | scripts/pbuilder/hooks/C10shell | 6 |
7 files changed, 0 insertions, 261 deletions
diff --git a/scripts/check-build-env b/scripts/check-build-env deleted file mode 100755 index 7377be64..00000000 --- a/scripts/check-build-env +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 -# -# 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 <http://www.gnu.org/licenses/>. -# -# File: check-build-env -# Purpose: -# Checks if packages required for package and ISO image build -# are installed. - - -import os -import sys - -import util - -deps = { - 'packages': [ - 'sudo', - 'make', - 'live-build', - 'pbuilder', - 'devscripts', - 'python3-pystache', - 'python3-git' - ], - 'binaries': [] -} - -print("Checking if packages required for VyOS image build are installed") - -checker = util.DependencyChecker(deps) - -missing = checker.get_missing_dependencies() -if not missing: - print("All dependencies are installed") - sys.exit(0) -else: - checker.print_missing_deps() - sys.exit(1) - -sys.exit(0) - diff --git a/scripts/import-local-packages b/scripts/import-local-packages deleted file mode 100755 index 70b4c365..00000000 --- a/scripts/import-local-packages +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -LOCAL_PKG_DIR=build/config/packages.chroot - -mkdir -p $LOCAL_PKG_DIR - -FILES=packages/*.deb -for f in $FILES -do - if [ -e "$f" ]; then - cp $f $LOCAL_PKG_DIR - fi -done diff --git a/scripts/list-package-arch b/scripts/list-package-arch deleted file mode 100755 index c9a88654..00000000 --- a/scripts/list-package-arch +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Execute this script from the vyos-build top directory -# Will generate a list of architectures in each repository -for a in $(echo vyos-build; ./scripts/build-packages -l | egrep -e '^ \* ' | sed 's/^ \* //'); do - n=$(curl https://raw.githubusercontent.com/vyos/${a}/sagitta/debian/control 2>/dev/null | grep "Architecture" | tr '\n' ',') - printf "%-24s %s \n" "${a}" "${n}" -done diff --git a/scripts/list-required-firmware b/scripts/list-required-firmware deleted file mode 100755 index 64280e03..00000000 --- a/scripts/list-required-firmware +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (C) 2020 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/>. -# - -import re -import os -import sys -import glob - - -SRC_DIR = sys.argv[1] -KERNEL_CONFIG = sys.argv[2] - -def load_config(path): - with open(KERNEL_CONFIG, 'r') as f: - config = f.read() - targets = re.findall(r'(.*)=(?:y|m)', config) - return targets - -def find_subdirs(config, path): - try: - with open(os.path.join(path, 'Makefile'), 'r') as f: - makefile = f.read() - except OSError: - # No Makefile - return [] - - dir_stmts = re.findall(r'obj-\$\((.*)\)\s+\+=\s+(.*)(?:\n|$)', makefile) - subdirs = [] - for ds in dir_stmts: - print("Processing make targets from {0} ({1})".format(ds[1], ds[0]), file=sys.stderr) - if ds[0] in config: - dirname = os.path.dirname(ds[1]) - if dirname: - subdirs.append(dirname) - else: - print("{0} is disabled in the config, ignoring {1}".format(ds[0], ds[1]), file=sys.stderr) - - return subdirs - -def find_firmware(file): - with open(file, 'r') as f: - source = f.read() - fws = re.findall(r'MODULE_FIRMWARE\((.*)\)', source) - return fws - -def walk_dir(config, path): - subdirs = find_subdirs(config, path) - - print("Looking for C files in {0}".format(path), file=sys.stderr) - c_files = glob.glob("{0}/*.c".format(path)) - for cf in c_files: - fws = find_firmware(cf) - if fws: - print("Referenced firmware: {0}".format(fws)) - - for d in subdirs: - d = os.path.join(path, d) - walk_dir(config, d) - -if __name__ == '__main__': - config = load_config(KERNEL_CONFIG) - walk_dir(config, SRC_DIR) diff --git a/scripts/pbuilder-config b/scripts/pbuilder-config deleted file mode 100755 index 06e14cbf..00000000 --- a/scripts/pbuilder-config +++ /dev/null @@ -1,54 +0,0 @@ -#!/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 <http://www.gnu.org/licenses/>. -# -# File: pbuilder-config -# Purpose: -# Generates a pbuilderrc file for use by package build scripts. - - -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 deleted file mode 100755 index a89348b8..00000000 --- a/scripts/pbuilder-setup +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 -# -# 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 <http://www.gnu.org/licenses/>. -# -# File: pbuilder-setup -# Purpose: -# Bootstraps a Debian environment for use by pbuilder. - - -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 deleted file mode 100755 index f56f9f7f..00000000 --- a/scripts/pbuilder/hooks/C10shell +++ /dev/null @@ -1,6 +0,0 @@ -#!/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 |