diff options
-rw-r--r-- | Makefile | 7 | ||||
-rwxr-xr-x | packages/linux-kernel/build-linux-firmware.sh | 4 | ||||
-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 | ||||
-rwxr-xr-x | tools/get_latest_iso.py | 31 | ||||
-rw-r--r-- | tools/gpl-header-template | 17 | ||||
-rw-r--r-- | tools/submod-mk | 84 | ||||
-rwxr-xr-x | tools/switch-remote | 35 |
13 files changed, 0 insertions, 439 deletions
@@ -14,13 +14,6 @@ iso: clean @./build-vyos-image iso exit 0 -.PHONY: prepare-package-env -.ONESHELL: -prepare-package-env: - @set -e - @scripts/pbuilder-config - @scripts/pbuilder-setup - .PHONY: checkiso .ONESHELL: checkiso: diff --git a/packages/linux-kernel/build-linux-firmware.sh b/packages/linux-kernel/build-linux-firmware.sh index 39cb243b..2b1fa7b7 100755 --- a/packages/linux-kernel/build-linux-firmware.sh +++ b/packages/linux-kernel/build-linux-firmware.sh @@ -1,9 +1,5 @@ #!/bin/bash -# This script will use "list-required-firmware" to scan the kernel source repository -# in combination with its configuration file which drivers are compiled. Some of those -# drivers require proprietary firmware. -# # All selected drivers are then precomfiled "make drivers/foo/bar.i" and we grep for # the magic word "UNIQUE_ID_firmware" which identifies firmware files. 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 10ac02d3..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}/current/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 diff --git a/tools/get_latest_iso.py b/tools/get_latest_iso.py deleted file mode 100755 index 4a2ea9a8..00000000 --- a/tools/get_latest_iso.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -from lxml import html -from urllib.parse import unquote -import requests - -BASE_URL = 'https://downloads.vyos.io/' -PAGE_URL = BASE_URL+'?dir=rolling/current/amd64' - - -def download(): - page = requests.get(PAGE_URL) - tree = html.fromstring(page.content) - path = '//*[@id="directory-listing"]/li/a[1]/@href' - isos = [x for x in tree.xpath(path) if os.path.splitext(x)[1] == '.iso'] - latest_iso_url = os.path.join(BASE_URL, isos[-1]) - filename = unquote(os.path.basename(latest_iso_url)) - print(filename) - if os.path.exists(filename): - print("{} already exists".format(filename)) - sys.exit(0) - r = requests.get(latest_iso_url) - with open(filename, 'wb') as fd: - for chunk in r.iter_content(chunk_size=128): - fd.write(chunk) - - -if __name__ == '__main__': - download() diff --git a/tools/gpl-header-template b/tools/gpl-header-template deleted file mode 100644 index 63be9d9a..00000000 --- a/tools/gpl-header-template +++ /dev/null @@ -1,17 +0,0 @@ -# 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 <http://www.gnu.org/licenses/>. -# -# File: -# Purpose: - diff --git a/tools/submod-mk b/tools/submod-mk deleted file mode 100644 index eb61da18..00000000 --- a/tools/submod-mk +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# -# **** License **** -# -# Copyright (C) 2013 Vyatta, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 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/>. -# -# **** End License **** - -progname=${0##*/} -shopt -s nullglob -shopt -s extglob -cd packages - -info=echo -trace= -noclean="-nc" -build="debuild -i -b -uc -us" - -declare -a submodule -declare -a debs -for debian in !(installer|linux-kernel-di-i386-2.6)/debian ; do - smod=${debian%/*} - debs=( ${smod}_*.deb ) - if [ ${#debs[@]} -eq 0 ] ; then - submodule+=( $smod ) - fi -done - -while [ $# -gt 0 ] ; do - case "$1" in - -h | --help ) - cat <<-EOF -Usage: $progname [Options] [ SUBMODULE... ] -Options: - -n | --do-nothing DonĀ“t actually remove or build anything, - just show what would be done - -q | --quiet Quiet, don't print progress info - -c | --clean Clean build - -b | --binary Skip source package build (default) - -s | --source Build binary and source packages - -S | --signed-source Build and sign packages - -If no SUBMODULE(s) given, build all checked-out submodules w/o debs. -EOF - exit 0;; - -n | --do-nothing ) - trace=echo - shift;; - -q | --quiet ) - info='#' - shift;; - -c | --clean ) - noclean= - shift;; - -b | --binary ) - shift ;; # default - -s | --source ) - build="git buildpackage -uc -us" - shift;; - -S | --signed-source ) - build="git buildpackage" - shift;; - * ) - submodule=( $@ ) - break;; - esac -done - -for (( i=0; i<${#submodule[@]}; i++)) ; do - eval $info P: ${submodule[i]} - ( cd ${submodule[i]} && eval $trace $build $noclean ) || exit $? -done diff --git a/tools/switch-remote b/tools/switch-remote deleted file mode 100755 index 328b735c..00000000 --- a/tools/switch-remote +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -HTTPS_BASE_URL="https://github.com/vyos" -SSH_BASE_URL="git@github.com:vyos" - -REMOTE=`git config remote.origin.url` - -# extract vyatta-foo.git -BASENAME=`echo $REMOTE | sed -re 's!.*/(.*)$!\1!'` -echo "Changing remote for $BASENAME" - -# Print usage if no arguments given -if [ -z "$1" ]; then - echo "Switches remote URL to SSH or HTTPS" - echo "Use \"$0 ssh\" to switch to SSH" - echo "Use \"$0 https\" to switch to HTTPS" -fi - -case $1 in - ssh) - echo "New remote: $SSH_BASE_URL/$BASENAME" - git config remote.origin.url $SSH_BASE_URL/$BASENAME - ;; - https) - echo "New remote: $HTTPS_BASE_URL/$BASENAME" - git config remote.origin.url $HTTPS_BASE_URL/$BASENAME - ;; - *) - echo "Wrong option, use \"ssh\" or \"https\"" - ;; -esac - - - - |