drop unused scripts
This commit is contained in:
parent
194fbcac9b
commit
8f7edd05f4
77
debian/bin/buildcheck.py
vendored
77
debian/bin/buildcheck.py
vendored
@ -1,77 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import itertools
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
from debian_linux.config_v2 import Config
|
||||
from debian_linux.kconfig import KconfigFile
|
||||
|
||||
|
||||
class CheckSecureBootConfig:
|
||||
def __init__(self, config, dir, *_):
|
||||
self.config = config
|
||||
self.dir = pathlib.Path(dir)
|
||||
|
||||
def __call__(self, out):
|
||||
fail = 0
|
||||
|
||||
if self.config.build.enable_signed \
|
||||
and not os.getenv('DEBIAN_KERNEL_DISABLE_SIGNED'):
|
||||
kconfig = KconfigFile()
|
||||
with (self.dir / '.config').open() as fh:
|
||||
kconfig.read(fh)
|
||||
|
||||
for name, value in [('EFI_STUB', True),
|
||||
('LOCK_DOWN_IN_EFI_SECURE_BOOT', True),
|
||||
('SYSTEM_TRUSTED_KEYS', '""')]:
|
||||
if name not in kconfig:
|
||||
out.write(f'Secure Boot: CONFIG_{name} is not defined\n')
|
||||
fail = 1
|
||||
elif kconfig[name].value != value:
|
||||
out.write(f'Secure Boot: CONFIG_{name} has wrong value:'
|
||||
f' {kconfig[name].value}\n')
|
||||
fail = 1
|
||||
|
||||
return fail
|
||||
|
||||
|
||||
class Main(object):
|
||||
|
||||
checks = {
|
||||
'setup': [CheckSecureBootConfig],
|
||||
'build': [],
|
||||
}
|
||||
|
||||
def __init__(self, dir, arch, featureset, flavour, phase):
|
||||
self.args = dir, arch, featureset, flavour
|
||||
self.phase = phase
|
||||
|
||||
config_dirs = [
|
||||
pathlib.Path('debian/config'),
|
||||
pathlib.Path('debian/config.local'),
|
||||
]
|
||||
top_config = Config.read_orig(config_dirs).merged
|
||||
arch_config = next(
|
||||
ac
|
||||
for ac in itertools.chain.from_iterable(
|
||||
kac.debianarchs for kac in top_config.kernelarchs)
|
||||
if ac.name == arch
|
||||
)
|
||||
fs_config = next(fsc for fsc in arch_config.featuresets
|
||||
if fsc.name == featureset)
|
||||
self.config = next(fc for fc in fs_config.flavours
|
||||
if fc.name == flavour)
|
||||
|
||||
def __call__(self):
|
||||
fail = 0
|
||||
|
||||
for c in self.checks[self.phase]:
|
||||
fail |= c(self.config, *self.args)(sys.stdout)
|
||||
|
||||
return fail
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(Main(*sys.argv[1:])())
|
28
debian/bin/check-patches.sh
vendored
28
debian/bin/check-patches.sh
vendored
@ -1,28 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
TMPDIR=$(mktemp -d)
|
||||
trap "rm -rf $TMPDIR" EXIT
|
||||
for patchdir in debian/patches*; do
|
||||
sed '/^#/d; /^[[:space:]]*$/d; /^X /d; s/^+ //; s,^,'"$patchdir"'/,' "$patchdir"/series
|
||||
done | sort -u > $TMPDIR/used
|
||||
find debian/patches* ! -path '*/series' -type f -name "*.diff" -o -name "*.patch" -printf "%p\n" | sort > $TMPDIR/avail
|
||||
echo "Used patches"
|
||||
echo "=============="
|
||||
cat $TMPDIR/used
|
||||
echo
|
||||
echo "Unused patches"
|
||||
echo "=============="
|
||||
grep -F -v -f $TMPDIR/used $TMPDIR/avail || test $? = 1
|
||||
echo
|
||||
echo "Patches without required headers"
|
||||
echo "================================"
|
||||
xargs grep -E -l '^(Subject|Description):' < $TMPDIR/used | xargs grep -E -l '^(From|Author|Origin):' > $TMPDIR/goodheaders || test $? = 1
|
||||
grep -F -v -f $TMPDIR/goodheaders $TMPDIR/used || test $? = 1
|
||||
echo
|
||||
echo "Patches without Origin or Forwarded header"
|
||||
echo "=========================================="
|
||||
xargs grep -E -L '^(Origin:|Forwarded: (no\b|not-needed|http))' < $TMPDIR/used || test $? = 1
|
||||
echo
|
||||
echo "Patches to be forwarded"
|
||||
echo "======================="
|
||||
xargs grep -E -l '^Forwarded: no\b' < $TMPDIR/used || test $? = 1
|
32
debian/bin/diff-gencontrol
vendored
32
debian/bin/diff-gencontrol
vendored
@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euE
|
||||
|
||||
REF_BASE=${1:-master}
|
||||
|
||||
REPO=$(git rev-parse --show-toplevel)
|
||||
COMMIT_BASE=$(git merge-base --fork-point "$REF_BASE")
|
||||
COMMIT_NEW=$(git stash create)
|
||||
|
||||
TMP=$(mktemp -d)
|
||||
trap "rm -rf '$TMP'" EXIT
|
||||
|
||||
function git {
|
||||
command git -c advice.detachedHead=false -c init.defaultBranch=main -C "$TMP" "$@"
|
||||
}
|
||||
|
||||
git init -q
|
||||
git remote add origin "$REPO"
|
||||
git fetch -q --depth 1 origin $COMMIT_BASE:base $COMMIT_NEW:new
|
||||
|
||||
git checkout -q base
|
||||
echo "Running gencontrol on ${COMMIT_BASE}"
|
||||
( cd "$TMP"; ./debian/bin/gencontrol.py )
|
||||
git stash push -q --all
|
||||
|
||||
git checkout -q new
|
||||
echo "Running gencontrol on uncommited changes"
|
||||
( cd "$TMP"; ./debian/bin/gencontrol.py )
|
||||
git stash push -q --all
|
||||
|
||||
# ^3 is the commit with untracked files
|
||||
git diff stash@{1}^3 stash@{0}^3
|
109
debian/bin/genpatch-lockdown
vendored
109
debian/bin/genpatch-lockdown
vendored
@ -1,109 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import io
|
||||
import os
|
||||
import os.path
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def main(repo, range='torvalds/master..dhowells/efi-lock-down'):
|
||||
patch_dir = 'debian/patches'
|
||||
lockdown_patch_dir = 'features/all/lockdown'
|
||||
series_name = 'series'
|
||||
|
||||
# Only replace patches in this subdirectory and starting with a digit
|
||||
# - the others are presumably Debian-specific for now
|
||||
lockdown_patch_name_re = re.compile(
|
||||
r'^' + re.escape(lockdown_patch_dir) + r'/\d')
|
||||
series_before = []
|
||||
series_after = []
|
||||
|
||||
old_series = set()
|
||||
new_series = set()
|
||||
|
||||
try:
|
||||
with open(os.path.join(patch_dir, series_name), 'r') as series_fh:
|
||||
for line in series_fh:
|
||||
name = line.strip()
|
||||
if lockdown_patch_name_re.match(name):
|
||||
old_series.add(name)
|
||||
elif len(old_series) == 0:
|
||||
series_before.append(line)
|
||||
else:
|
||||
series_after.append(line)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
with open(os.path.join(patch_dir, series_name), 'w') as series_fh:
|
||||
for line in series_before:
|
||||
series_fh.write(line)
|
||||
|
||||
# Add directory prefix to all filenames.
|
||||
# Add Origin to all patch headers.
|
||||
def add_patch(name, source_patch, origin):
|
||||
name = os.path.join(lockdown_patch_dir, name)
|
||||
path = os.path.join(patch_dir, name)
|
||||
try:
|
||||
os.unlink(path)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
with open(path, 'w') as patch:
|
||||
in_header = True
|
||||
for line in source_patch:
|
||||
if in_header and re.match(r'^(\n|[^\w\s]|Index:)', line):
|
||||
patch.write('Origin: %s\n' % origin)
|
||||
if line != '\n':
|
||||
patch.write('\n')
|
||||
in_header = False
|
||||
patch.write(line)
|
||||
series_fh.write(name)
|
||||
series_fh.write('\n')
|
||||
new_series.add(name)
|
||||
|
||||
# XXX No signature to verify
|
||||
|
||||
env = os.environ.copy()
|
||||
env['GIT_DIR'] = os.path.join(repo, '.git')
|
||||
args = ['git', 'format-patch', '--subject-prefix=', range]
|
||||
format_proc = subprocess.Popen(args,
|
||||
cwd=os.path.join(patch_dir,
|
||||
lockdown_patch_dir),
|
||||
env=env, stdout=subprocess.PIPE)
|
||||
with io.open(format_proc.stdout.fileno(), encoding='utf-8') as pipe:
|
||||
for line in pipe:
|
||||
name = line.strip('\n')
|
||||
with open(os.path.join(patch_dir, lockdown_patch_dir, name)) \
|
||||
as source_patch:
|
||||
patch_from = source_patch.readline()
|
||||
match = re.match(r'From ([0-9a-f]{40}) ', patch_from)
|
||||
assert match
|
||||
origin = ('https://git.kernel.org/pub/scm/linux/kernel/'
|
||||
'git/dhowells/linux-fs.git/commit?id=%s' %
|
||||
match.group(1))
|
||||
add_patch(name, source_patch, origin)
|
||||
|
||||
for line in series_after:
|
||||
series_fh.write(line)
|
||||
|
||||
for name in new_series:
|
||||
if name in old_series:
|
||||
old_series.remove(name)
|
||||
else:
|
||||
print('Added patch', os.path.join(patch_dir, name))
|
||||
|
||||
for name in old_series:
|
||||
print('Obsoleted patch', os.path.join(patch_dir, name))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if not (2 <= len(sys.argv) <= 3):
|
||||
sys.stderr.write('''\
|
||||
Usage: %s REPO [REVISION-RANGE]
|
||||
REPO is a git repo containing the REVISION-RANGE. The default range is
|
||||
torvalds/master..dhowells/efi-lock-down.
|
||||
''' % sys.argv[0])
|
||||
print('BASE is the base branch (default: torvalds/master).')
|
||||
sys.exit(2)
|
||||
main(*sys.argv[1:])
|
160
debian/bin/genpatch-rt
vendored
160
debian/bin/genpatch-rt
vendored
@ -1,160 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
import io
|
||||
import os
|
||||
import os.path
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
|
||||
def main(source, version, verify_signature):
|
||||
patch_dir = 'debian/patches-rt'
|
||||
series_name = 'series'
|
||||
old_series = set()
|
||||
new_series = set()
|
||||
|
||||
try:
|
||||
with open(os.path.join(patch_dir, series_name), 'r') as series_fh:
|
||||
for line in series_fh:
|
||||
name = line.strip()
|
||||
if name != '' and name[0] != '#':
|
||||
old_series.add(name)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
with open(os.path.join(patch_dir, series_name), 'w') as series_fh:
|
||||
# Add Origin to all patch headers.
|
||||
def add_patch(name, source_patch, origin):
|
||||
path = os.path.join(patch_dir, name)
|
||||
try:
|
||||
os.unlink(path)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
with open(path, 'w') as patch:
|
||||
in_header = True
|
||||
for line in source_patch:
|
||||
if in_header and re.match(r'^(\n|[^\w\s]|Index:)', line):
|
||||
patch.write('Origin: %s\n' % origin)
|
||||
if line != '\n':
|
||||
patch.write('\n')
|
||||
in_header = False
|
||||
patch.write(line)
|
||||
new_series.add(name)
|
||||
|
||||
if os.path.isdir(os.path.join(source, '.git')):
|
||||
# Export rebased branch from stable-rt git as patch series
|
||||
up_ver = re.sub(r'-rt\d+$', '', version)
|
||||
env = os.environ.copy()
|
||||
env['GIT_DIR'] = os.path.join(source, '.git')
|
||||
env['DEBIAN_KERNEL_KEYRING'] = 'rt-signing-key.pgp'
|
||||
|
||||
if verify_signature:
|
||||
# Validate tag signature
|
||||
gpg_wrapper = os.path.join(os.getcwd(),
|
||||
"debian/bin/git-tag-gpg-wrapper")
|
||||
verify_proc = subprocess.Popen(
|
||||
['git', '-c', 'gpg.program=%s' % gpg_wrapper,
|
||||
'tag', '-v', 'v%s-rebase' % version],
|
||||
env=env)
|
||||
if verify_proc.wait():
|
||||
raise RuntimeError("GPG tag verification failed")
|
||||
|
||||
args = ['git', 'format-patch',
|
||||
'v%s..v%s-rebase' % (up_ver, version)]
|
||||
format_proc = subprocess.Popen(args,
|
||||
cwd=patch_dir,
|
||||
env=env, stdout=subprocess.PIPE)
|
||||
with io.open(format_proc.stdout.fileno(), encoding='utf-8') \
|
||||
as pipe:
|
||||
for line in pipe:
|
||||
name = line.strip('\n')
|
||||
with open(os.path.join(patch_dir, name)) as source_patch:
|
||||
patch_from = source_patch.readline()
|
||||
match = re.match(r'From ([0-9a-f]{40}) ', patch_from)
|
||||
assert match
|
||||
origin = ('https://git.kernel.org/cgit/linux/kernel/'
|
||||
'git/rt/linux-stable-rt.git/commit?id=%s' %
|
||||
match.group(1))
|
||||
add_patch(name, source_patch, origin)
|
||||
series_fh.write(line)
|
||||
|
||||
else:
|
||||
# Get version and upstream version
|
||||
if version is None:
|
||||
match = re.search(r'(?:^|/)patches-(.+)\.tar\.[gx]z$', source)
|
||||
assert match, 'no version specified or found in filename'
|
||||
version = match.group(1)
|
||||
match = re.match(r'^(\d+\.\d+)(?:\.\d+|-rc\d+)?-rt\d+$', version)
|
||||
assert match, 'could not parse version string'
|
||||
up_ver = match.group(1)
|
||||
|
||||
if verify_signature:
|
||||
# Expect an accompanying signature, and validate it
|
||||
source_sig = re.sub(r'.[gx]z$', '.sign', source)
|
||||
unxz_proc = subprocess.Popen(['xzcat', source],
|
||||
stdout=subprocess.PIPE)
|
||||
verify_output = subprocess.check_output(
|
||||
['gpgv', '--status-fd', '1',
|
||||
'--keyring', 'debian/upstream/rt-signing-key.pgp',
|
||||
'--ignore-time-conflict', source_sig, '-'],
|
||||
stdin=unxz_proc.stdout,
|
||||
text=True)
|
||||
if unxz_proc.wait() or \
|
||||
not re.search(r'^\[GNUPG:\]\s+VALIDSIG\s',
|
||||
verify_output, re.MULTILINE):
|
||||
sys.stderr.write(verify_output)
|
||||
raise RuntimeError("GPG signature verification failed")
|
||||
|
||||
temp_dir = tempfile.mkdtemp(prefix='rt-genpatch', dir='debian')
|
||||
try:
|
||||
# Unpack tarball
|
||||
subprocess.check_call(['tar', '-C', temp_dir, '-xaf', source])
|
||||
source_dir = os.path.join(temp_dir, 'patches')
|
||||
assert os.path.isdir(source_dir), \
|
||||
'tarball does not contain patches directory'
|
||||
|
||||
# Copy patch series
|
||||
origin = ('https://www.kernel.org/pub/linux/kernel/projects/'
|
||||
'rt/%s/older/patches-%s.tar.xz' %
|
||||
(up_ver, version))
|
||||
with open(os.path.join(source_dir, 'series'), 'r') \
|
||||
as source_series_fh:
|
||||
for line in source_series_fh:
|
||||
name = line.strip()
|
||||
if name != '' and name[0] != '#':
|
||||
with open(os.path.join(source_dir, name)) \
|
||||
as source_patch:
|
||||
add_patch(name, source_patch, origin)
|
||||
series_fh.write(line)
|
||||
finally:
|
||||
shutil.rmtree(temp_dir)
|
||||
|
||||
for name in new_series:
|
||||
if name in old_series:
|
||||
old_series.remove(name)
|
||||
else:
|
||||
print('Added patch', os.path.join(patch_dir, name))
|
||||
|
||||
for name in old_series:
|
||||
print('Obsoleted patch', os.path.join(patch_dir, name))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Generate or update the rt featureset patch series')
|
||||
parser.add_argument(
|
||||
'source', metavar='SOURCE', type=str,
|
||||
help='tarball of patches or git repo containing the given RT-VERSION')
|
||||
parser.add_argument(
|
||||
'version', metavar='RT-VERSION', type=str, nargs='?',
|
||||
help='rt kernel version (optional for tarballs)')
|
||||
parser.add_argument(
|
||||
'--verify-signature', action=argparse.BooleanOptionalAction,
|
||||
default=True,
|
||||
help='verify signature on tarball (detached in .sign file) or git tag')
|
||||
args = parser.parse_args()
|
||||
main(args.source, args.version, args.verify_signature)
|
42
debian/bin/git-tag-gpg-wrapper
vendored
42
debian/bin/git-tag-gpg-wrapper
vendored
@ -1,42 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# Instead of calling gpg, call gpgv and provide a local keyring
|
||||
|
||||
debian_dir="$(readlink -f "$(dirname "$0")/..")"
|
||||
|
||||
# Parse the expected options. If the next two lines are combined, a
|
||||
# failure of getopt won't cause the script to exit.
|
||||
ordered_args="$(getopt -n "$0" -o "" -l "status-fd:" -l "keyid-format:" -l "verify" -- "$@")"
|
||||
eval "set -- $ordered_args"
|
||||
gpgv_opts=()
|
||||
while true; do
|
||||
case "$1" in
|
||||
--status-fd)
|
||||
gpgv_opts+=(--status-fd $2)
|
||||
shift 2
|
||||
;;
|
||||
--keyid-format)
|
||||
# ignore
|
||||
shift 2
|
||||
;;
|
||||
--verify)
|
||||
# ignore
|
||||
shift 1
|
||||
;;
|
||||
--)
|
||||
shift 1
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
keyring="$debian_dir/upstream/${DEBIAN_KERNEL_KEYRING:-signing-key.asc}"
|
||||
case "$keyring" in
|
||||
*.asc)
|
||||
keyring_armored="$keyring"
|
||||
keyring="$(mktemp)"
|
||||
trap 'rm -f "$keyring"' EXIT
|
||||
gpg --dearmor <"$keyring_armored" > "$keyring"
|
||||
;;
|
||||
esac
|
||||
gpgv "${gpgv_opts[@]}" --keyring "$keyring" -- "$@"
|
135
debian/bin/stable-update
vendored
135
debian/bin/stable-update
vendored
@ -1,135 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from debian_linux.debian import Changelog, VersionLinux
|
||||
|
||||
|
||||
def base_version(ver):
|
||||
# Assume base version is at least 3.0, thus only 2 components wanted
|
||||
match = re.match(r'^(\d+\.\d+)', ver)
|
||||
assert match
|
||||
return match.group(1)
|
||||
|
||||
|
||||
def add_update(ver, inc):
|
||||
base = base_version(ver)
|
||||
if base == ver:
|
||||
update = 0
|
||||
else:
|
||||
update = int(ver[len(base)+1:])
|
||||
update += inc
|
||||
if update == 0:
|
||||
return base
|
||||
else:
|
||||
return '{}.{}'.format(base, update)
|
||||
|
||||
|
||||
def next_update(ver):
|
||||
return add_update(ver, 1)
|
||||
|
||||
|
||||
def print_stable_log(log, cur_ver, new_ver):
|
||||
major_ver = re.sub(r'^(\d+)\..*', r'\1', cur_ver)
|
||||
while cur_ver != new_ver:
|
||||
next_ver = next_update(cur_ver)
|
||||
print(' https://www.kernel.org/pub/linux/kernel/v{}.x/ChangeLog-{}'
|
||||
.format(major_ver, next_ver),
|
||||
file=log)
|
||||
log.flush() # serialise our output with git's
|
||||
subprocess.check_call(['git', 'log', '--reverse',
|
||||
'--pretty= - %s',
|
||||
'v{}..v{}^'.format(cur_ver, next_ver)],
|
||||
stdout=log)
|
||||
cur_ver = next_ver
|
||||
|
||||
|
||||
def main(repo, new_ver):
|
||||
if os.path.exists(os.path.join(repo, '.git')):
|
||||
os.environ['GIT_DIR'] = os.path.join(repo, '.git')
|
||||
else:
|
||||
os.environ['GIT_DIR'] = repo
|
||||
|
||||
changelog = Changelog(version=VersionLinux)
|
||||
cur_pkg_ver = changelog[0].version
|
||||
cur_ver = cur_pkg_ver.linux_upstream_full
|
||||
|
||||
if base_version(new_ver) != base_version(cur_ver):
|
||||
print('{} is not on the same stable series as {}'
|
||||
.format(new_ver, cur_ver),
|
||||
file=sys.stderr)
|
||||
sys.exit(2)
|
||||
|
||||
new_pkg_ver = new_ver + '-1'
|
||||
if cur_pkg_ver.linux_revision_experimental:
|
||||
new_pkg_ver += '~exp1'
|
||||
|
||||
# Three possible cases:
|
||||
# 1. The current version has been released so we need to add a new
|
||||
# version to the changelog.
|
||||
# 2. The current version has not been released so we're changing its
|
||||
# version string.
|
||||
# (a) There are no stable updates included in the current version,
|
||||
# so we need to insert an introductory line, the URL(s) and
|
||||
# git log(s) and a blank line at the top.
|
||||
# (b) One or more stable updates are already included in the current
|
||||
# version, so we need to insert the URL(s) and git log(s) after
|
||||
# them.
|
||||
|
||||
changelog_intro = 'New upstream stable update:'
|
||||
|
||||
# Case 1
|
||||
if changelog[0].distribution != 'UNRELEASED':
|
||||
subprocess.check_call(['dch', '-v', new_pkg_ver, '-D', 'UNRELEASED',
|
||||
changelog_intro])
|
||||
|
||||
with open('debian/changelog', 'r') as old_log:
|
||||
with open('debian/changelog.new', 'w') as new_log:
|
||||
line_no = 0
|
||||
inserted = False
|
||||
intro_line = ' * {}\n'.format(changelog_intro)
|
||||
|
||||
for line in old_log:
|
||||
line_no += 1
|
||||
|
||||
# Case 2
|
||||
if changelog[0].distribution == 'UNRELEASED' and line_no == 1:
|
||||
print('{} ({}) UNRELEASED; urgency={}'
|
||||
.format(changelog[0].source, new_pkg_ver,
|
||||
changelog[0].urgency),
|
||||
file=new_log)
|
||||
continue
|
||||
|
||||
if not inserted:
|
||||
# Case 2(a)
|
||||
if line_no == 3 and line != intro_line:
|
||||
new_log.write(intro_line)
|
||||
print_stable_log(new_log, cur_ver, new_ver)
|
||||
new_log.write('\n')
|
||||
inserted = True
|
||||
# Case 1 or 2(b)
|
||||
elif line_no > 3 and line == '\n':
|
||||
print_stable_log(new_log, cur_ver, new_ver)
|
||||
inserted = True
|
||||
|
||||
# Check that we inserted before hitting the end of the
|
||||
# first version entry
|
||||
assert not (line.startswith(' -- ') and not inserted)
|
||||
|
||||
new_log.write(line)
|
||||
|
||||
os.rename('debian/changelog.new', 'debian/changelog')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) != 3:
|
||||
print('''\
|
||||
Usage: {} REPO VERSION
|
||||
REPO is the git repository to generate a changelog from
|
||||
VERSION is the stable version (without leading v)'''.format(sys.argv[0]),
|
||||
file=sys.stderr)
|
||||
sys.exit(2)
|
||||
main(*sys.argv[1:])
|
2
debian/bin/stable-update.sh
vendored
2
debian/bin/stable-update.sh
vendored
@ -1,2 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
exec "$(dirname "$0")/stable-update" "$@"
|
140
debian/bin/test-patches
vendored
140
debian/bin/test-patches
vendored
@ -1,140 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
shopt -s extglob
|
||||
|
||||
# Set defaults from the running kernel
|
||||
arch="$(dpkg --print-architecture)"
|
||||
kernelabi="$(uname -r)"
|
||||
ff="${kernelabi##+([^-])-?(@(trunk|?(rc)+([0-9])|0.@(bpo|deb+([0-9])).+([0-9]))-)}"
|
||||
if [ "x$ff" != "x$kernelabi" ]; then
|
||||
flavour="${ff#rt-}"
|
||||
if [ "x$flavour" != "x$ff" ]; then
|
||||
featureset="${ff%-$flavour}"
|
||||
else
|
||||
featureset=none
|
||||
fi
|
||||
else
|
||||
flavour=
|
||||
featureset=none
|
||||
fi
|
||||
|
||||
dbginfo=
|
||||
fuzz=0
|
||||
jobs=$(nproc)
|
||||
|
||||
eval "set -- $(getopt -n "$0" -o "f:gj:s:" -l "fuzz:" -- "$@")"
|
||||
while true; do
|
||||
case "$1" in
|
||||
-f) flavour="$2"; shift 2 ;;
|
||||
-g) dbginfo=y; shift 1 ;;
|
||||
-j) jobs="$2"; shift 2 ;;
|
||||
-s) featureset="$2"; shift 2 ;;
|
||||
--fuzz) fuzz="$2"; shift 2;;
|
||||
--) shift 1; break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo >&2 "Usage: $0 [<options>] <patch>..."
|
||||
cat >&2 <<EOF
|
||||
Options:
|
||||
-f <flavour> specify the 'flavour' of kernel to build, e.g. 686-pae
|
||||
-g enable debug info
|
||||
-j <jobs> specify number of compiler jobs to run in parallel
|
||||
(default: number of available processors)
|
||||
-s <featureset> specify an optional featureset to apply, e.g. rt
|
||||
--fuzz <num> set the maximum patch fuzz factor (default: 0)
|
||||
EOF
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ -z "$flavour" ]; then
|
||||
echo >&2 "You must specify a flavour to build with the -f option"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
profiles=nodoc,noudeb,pkg.linux.nosource,pkg.linux.mintools
|
||||
if [ -z "$dbginfo" ]; then
|
||||
profiles="$profiles,pkg.linux.nokerneldbg,pkg.linux.nokerneldbginfo"
|
||||
fi
|
||||
|
||||
# Check build-dependencies early if possible
|
||||
if [ -f debian/control ]; then
|
||||
dpkg-checkbuilddeps -P"$profiles"
|
||||
fi
|
||||
|
||||
# Append 'a~test' to Debian version; this should be less than any official
|
||||
# successor and easily recognisable
|
||||
version="$(dpkg-parsechangelog | sed 's/^Version: //; t; d')"
|
||||
if [ "${version%a~test}" = "$version" ]; then
|
||||
version="$version"a~test
|
||||
dch -v "$version" --distribution UNRELEASED "Testing patches $*"
|
||||
fi
|
||||
|
||||
# Ignore user's .quiltrc
|
||||
alias quilt='quilt --quiltrc -'
|
||||
|
||||
# Try to clean up any previous test patches
|
||||
if [ "$featureset" = none ]; then
|
||||
patchdir=debian/patches
|
||||
while patch="$(quilt top 2>/dev/null)" && \
|
||||
[ "${patch#test/}" != "$patch" ]; do
|
||||
quilt pop -f
|
||||
done
|
||||
while patch="$(quilt next 2>/dev/null)" && \
|
||||
[ "${patch#test/}" != "$patch" ]; do
|
||||
quilt delete -r "$patch"
|
||||
done
|
||||
else
|
||||
patchdir=debian/patches-${featureset}
|
||||
sed -i '/^test\//d' $patchdir/series
|
||||
fi
|
||||
|
||||
# Prepare a new directory for the patches
|
||||
rm -rf $patchdir/test/
|
||||
mkdir $patchdir/test
|
||||
|
||||
# Prepare a new directory for the config; override ABI name, featuresets, flavours
|
||||
rm -rf debian/config.local
|
||||
mkdir debian/config.local debian/config.local/"$arch"
|
||||
for other_fs in none rt; do
|
||||
if [ "$other_fs" != "$featureset" ]; then
|
||||
cat >debian/config.local/defines.toml <<EOF
|
||||
[[featureset]]
|
||||
name = '$other_fs'
|
||||
enable = false
|
||||
EOF
|
||||
fi
|
||||
done
|
||||
cat >debian/config.local/"$arch"/defines.toml <<EOF
|
||||
[[featureset]]
|
||||
name = '$featureset'
|
||||
|
||||
[[featureset.flavour]]
|
||||
name = '$flavour'
|
||||
EOF
|
||||
|
||||
# Regenerate control and included rules
|
||||
rm -f debian/control debian/rules.gen
|
||||
debian/rules debian/control-real && exit 1 || true
|
||||
test -f debian/control
|
||||
test -f debian/rules.gen
|
||||
|
||||
# Check build-dependencies now that we know debian/control exists
|
||||
dpkg-checkbuilddeps -P"$profiles"
|
||||
|
||||
# Clean up old build; apply existing patches for featureset
|
||||
debian/rules clean
|
||||
debian/rules source
|
||||
|
||||
# Apply the additional patches
|
||||
for patch in "$@"; do
|
||||
patch_abs="$(readlink -f "$patch")"
|
||||
(cd "debian/build/source_${featureset}" && \
|
||||
quilt import -P "test/$(basename "$patch")" "$patch_abs" && \
|
||||
quilt push --fuzz="$fuzz")
|
||||
done
|
||||
|
||||
# Build selected binaries
|
||||
dpkg-buildpackage -b -P"$profiles" -j"$jobs" -nc -uc
|
24
debian/bin/update-bug-taint-list
vendored
24
debian/bin/update-bug-taint-list
vendored
@ -1,24 +0,0 @@
|
||||
#!/bin/sh -eu
|
||||
|
||||
temp="$(mktemp)"
|
||||
trap 'rm -f "$temp"' EXIT
|
||||
|
||||
# Copy everything above the existing flag checks.
|
||||
sed -rne '/^ +_check /q; p' \
|
||||
< debian/templates/image.bug/include-1tainted >"$temp"
|
||||
|
||||
# Generate flag checks from the table in tainted-kernels.rst. We
|
||||
# could alternatively extract them from sysctl/kernel.rst or in the C
|
||||
# sources, but this is easy to find and parse and is likely to have
|
||||
# the most useful descriptions.
|
||||
sed -rne '/^Bit +Log +Number +Reason/,/^$/ {
|
||||
s/^ *([0-9]+) +.\/(.) +[0-9]+ +(.*)/ _check \1 \2 '\''\3'\''/p
|
||||
}' \
|
||||
< Documentation/admin-guide/tainted-kernels.rst >>"$temp"
|
||||
|
||||
# Copy everything below the existing flag checks.
|
||||
sed -rne '/^ +echo "\*\* Tainted:/,$p' \
|
||||
< debian/templates/image.bug/include-1tainted >>"$temp"
|
||||
|
||||
# Update the bug script in-place.
|
||||
cp "$temp" debian/templates/image.bug/include-1tainted
|
2
debian/rules.real
vendored
2
debian/rules.real
vendored
@ -161,7 +161,6 @@ endif
|
||||
echo 'DEBIAN_KERNEL_NO_CC_VERSION_CHECK = y' >> '$(DIR)/.kernelvariables'
|
||||
+$(MAKE_CLEAN) -C '$(SOURCE_DIR)' O='$(CURDIR)/$(DIR)' listnewconfig
|
||||
+yes "" | $(MAKE_CLEAN) -C '$(SOURCE_DIR)' O='$(CURDIR)/$(DIR)' oldconfig >/dev/null
|
||||
debian/bin/buildcheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR) setup
|
||||
@$(stamp)
|
||||
|
||||
$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR): SOURCE_DIR=$(BUILD_DIR)/source_$(FEATURESET)
|
||||
@ -170,7 +169,6 @@ $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(STAMPS_DIR)/setup_$(ARCH
|
||||
|
||||
$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR):
|
||||
+$(MAKE_CLEAN) -C '$(DIR)'
|
||||
debian/bin/buildcheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR) build
|
||||
@$(stamp)
|
||||
|
||||
$(STAMPS_DIR)/install_$(ARCH)_$(FEATURESET)_$(FLAVOUR): REAL_VERSION = $(ABINAME)$(LOCALVERSION)
|
||||
|
Loading…
Reference in New Issue
Block a user