mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
chore: T671: remove unused scripts and references to them
This commit is contained in:
parent
a690a02bdc
commit
5dcb6b7711
7
Makefile
7
Makefile
@ -14,13 +14,6 @@ iso: clean
|
|||||||
@./build-vyos-image iso
|
@./build-vyos-image iso
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
.PHONY: prepare-package-env
|
|
||||||
.ONESHELL:
|
|
||||||
prepare-package-env:
|
|
||||||
@set -e
|
|
||||||
@scripts/pbuilder-config
|
|
||||||
@scripts/pbuilder-setup
|
|
||||||
|
|
||||||
.PHONY: checkiso
|
.PHONY: checkiso
|
||||||
.ONESHELL:
|
.ONESHELL:
|
||||||
checkiso:
|
checkiso:
|
||||||
|
|||||||
@ -1,9 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/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
|
# 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.
|
# the magic word "UNIQUE_ID_firmware" which identifies firmware files.
|
||||||
|
|
||||||
|
|||||||
@ -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)
|
|
||||||
|
|
||||||
@ -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
|
|
||||||
@ -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
|
|
||||||
@ -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)
|
|
||||||
@ -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)
|
|
||||||
@ -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)
|
|
||||||
@ -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
|
|
||||||
@ -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()
|
|
||||||
@ -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:
|
|
||||||
|
|
||||||
@ -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
|
|
||||||
@ -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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user