diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/allarchconfig.sh | 16 | ||||
-rwxr-xr-x | scripts/bumpspecfile.py | 76 | ||||
-rwxr-xr-x | scripts/generate-perf-man.sh | 58 | ||||
-rwxr-xr-x | scripts/rawhide-rc.sh | 2 | ||||
-rw-r--r-- | scripts/rediffall.pl | 64 | ||||
-rwxr-xr-x | scripts/stable-update.sh | 15 |
6 files changed, 17 insertions, 214 deletions
diff --git a/scripts/allarchconfig.sh b/scripts/allarchconfig.sh deleted file mode 100755 index f80c23197..000000000 --- a/scripts/allarchconfig.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# Run from within a source tree. - -for i in configs/kernel-*.config -do - cp -f $i .config - Arch=`head -1 .config | cut -b 3-` - echo $Arch \($i\) - make ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true; - if [ -s .newoptions ]; then - cat .newoptions; - exit 1; - fi; - rm -f .newoptions; -done - diff --git a/scripts/bumpspecfile.py b/scripts/bumpspecfile.py deleted file mode 100755 index bc02ab300..000000000 --- a/scripts/bumpspecfile.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/python -# -# Uses git config options user.name and user.email, falls -# back to env vars $GIT_COMMITTER_NAME and $GIT_COMMITTER_EMAIL -# -import re -import sys -import time -import os -import string - -class Specfile: - def __init__(self,filename): - file=open(filename,"r") - self.lines=file.readlines() - self.vr="" - - def getNextVR(self,aspec): - # Get VR for changelog entry. - (ver,rel) = os.popen("LC_ALL=C rpm --specfile -q --qf '%%{version} %%{release}\n' --define 'dist %%{nil}' %s | head -1" % aspec).read().strip().split(' ') - pos = 0 - # general released kernel case, bump 1st field - fedora_build = rel.split('.')[pos] - if fedora_build == "0": - # this is a devel kernel, bump 2nd field - pos = 1 - elif rel.split('.')[-1] != fedora_build: - # this is a branch, must bump 3rd field - pos = 2 - fedora_build = rel.split('.')[pos] - if pos == 1 and len(rel.split('.')) > 4: - # uh... what? devel kernel in a branch? private build? just do no VR in clog... - print "Warning: not adding any VR to changelog, couldn't tell for sure which field to bump" - pos = -1 - next_fedora_build = int(fedora_build) + 1 - if pos == 0: - nextrel = str(next_fedora_build) - elif pos == 1: - nextrel = "0." + str(next_fedora_build) - elif pos == 2: - nextrel = rel.split('.')[0] + "." + rel.split('.')[1] + "." + str(next_fedora_build) - if pos >= 0: - for s in rel.split('.')[pos + 1:]: - nextrel = nextrel + "." + s - self.vr = " "+ver+'-'+nextrel - - def addChangelogEntry(self,entry): - user = os.popen("git config --get user.name").read().rstrip() - if (user == ""): - user = os.environ.get("GIT_COMMITTER_NAME","Unknown") - email = os.popen("git config --get user.email").read().rstrip() - if (email == ""): - email = os.environ.get("GIT_COMMITTER_EMAIL","unknown") - if (email == "unknown"): - email = os.environ.get("USER","unknown")+"@fedoraproject.org" - changematch=re.compile(r"^%changelog") - date=time.strftime("%a %b %d %Y", time.localtime(time.time())) - newchangelogentry="%changelog\n* "+date+" "+user+" <"+email+">"+self.vr+"\n"+entry+"\n\n" - for i in range(len(self.lines)): - if(changematch.match(self.lines[i])): - self.lines[i]=newchangelogentry - break - - def writeFile(self,filename): - file=open(filename,"w") - file.writelines(self.lines) - file.close() - -if __name__=="__main__": - aspec=(sys.argv[1]) - s=Specfile(aspec) - entry=(sys.argv[2]) - s.getNextVR(aspec) - s.addChangelogEntry(entry) - s.writeFile(aspec) - diff --git a/scripts/generate-perf-man.sh b/scripts/generate-perf-man.sh deleted file mode 100755 index f5332ad86..000000000 --- a/scripts/generate-perf-man.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# Small script to generate the perf-man tarball. The script relies on having -# LINUX_GIT set in your local .bashrc. By default the script will use the -# the kernel version of the upstream tree set in LINUX_GIT. Use --version=x.y -# to set a specific version. - -# [Default] eg. ./scritps/generate-perf-man -# eg. ./scripts/generate-perf-man --version=4.8 -function usage(){ - echo - echo "Helps generate the perf-man tarball " - echo "-h, --help " - echo - echo "./generate-perf-man.sh #Generates using upstream kernel version" - echo - echo "./generate-perf-man.sh --version=x.y #Generate using x.y version" -} - -if [ -f ~/.bashrc ]; then - source ~/.bashrc -fi - -if [ ! -d "$LINUX_GIT" ]; then - echo "Error: \$LINUX_GIT is not set to the upstream git tree." - exit 1 -fi - -BASEDIR=$(dirname "$(cd $(dirname $BASH_SOURCE[0]) && pwd)") -pushd "$LINUX_GIT" > /dev/null -KERNEL_VERSION=$( awk '/^VERSION =/ {print $3}' Makefile ) -KERNEL_PATCHLEVEL=$( awk '/^PATCHLEVEL =/ {print $3}' Makefile ) - -if [ ! -z "$@" ]; then - for opt in "$@"; do - case $opt in - --version=*.*) - version="${opt#*=}" - KERNEL_VERSION=$( awk -F. '{print $1}' <<< $version ) - KERNEL_PATCHLEVEL=$( awk -F. '{print $2}' <<< $version ) - ;; - -h | --help) - usage - exit 0 - ;; - *) - ;; - esac - done -fi -cd tools/kvm/kvm_stat/ -make man -mv kvm_stat.1 ../../perf/Documentation -cd ../../perf/Documentation/ -make -tar -czvf $BASEDIR/perf-man-${KERNEL_VERSION}.${KERNEL_PATCHLEVEL}.tar.gz *.1 -make clean -rm kvm_stat.1 -popd diff --git a/scripts/rawhide-rc.sh b/scripts/rawhide-rc.sh index 40f32a8fe..ba8b467b2 100755 --- a/scripts/rawhide-rc.sh +++ b/scripts/rawhide-rc.sh @@ -45,3 +45,5 @@ perl -p -i -e 's|%define gitrev.*|%define gitrev 0|' kernel.spec perl -p -i -e 's|%global baserelease.*|%global baserelease 0|' kernel.spec rpmdev-bumpspec -c "Linux v4.$BASE-rc$RC" kernel.spec + +echo "Don't forget to bump kernel-tools" diff --git a/scripts/rediffall.pl b/scripts/rediffall.pl deleted file mode 100644 index 29f12beb9..000000000 --- a/scripts/rediffall.pl +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/perl -w -# -# Script to rediff all patches in the spec -# Usage: perl -w rediffall.pl < kernel-2.4.spec -# -# $workdir is where the new rediff'ed patches are created -# $origdir is where the original patches and tarball are located -# -# Note that both $workdir and $origdir must be absolute path names. -# Suggestion: create a /kernel symbolic link to the top of your CVS tree. - -my $workdir = "/dev/shm/redifftree"; -my $origdir = "/home/davej/devel"; -my $kernver = "linux-2.6.17"; -my $datestrip = "s/^\\(\\(+++\\|---\\) [^[:blank:]]\\+\\)[[:blank:]].*/\\1/"; -my $patchindex = 0; -my @patchlist; - -# phase 1: create a tree -print "Extracting pristine source..\n"; -system("mkdir -p $workdir"); -system("rm -rf $workdir/*"); -chdir("$workdir"); -system("tar -jxvf $origdir/$kernver.tar.bz2 > /dev/null"); -system("cp -al $kernver linux-$patchindex"); - -# phase 2: read the spec from stdin and store all patches -print "Reading specfile..\n"; - -while (<>) { - my $line = $_; - if ($line =~ /^Patch([0-9]+)\: ([a-zA-Z0-9\-\_\.\+]+\.patch)/) { - $patchlist[$1] = $2; - } else { - if ($line =~ /^Patch([0-9]+)\: ([a-zA-Z0-9\-\_\.]+\.bz2)/) { - $patchlist[$1] = $2; - } - } - - if ($line =~ /^%patch([0-9]+) -p1/) { - # copy the tree, apply the patch, diff and remove the old tree - my $oldindex = $patchindex; - $patchindex = $1; - - print "rediffing patch number $patchindex: $patchlist[$patchindex]\n"; - - system("cp -al linux-$oldindex linux-$patchindex"); - chdir("linux-$patchindex"); - if ($patchlist[$patchindex] =~ /bz2/) { - system("bzcat $origdir/$patchlist[$patchindex] | patch -p1 &>/dev/null"); - } else { - system("cat $origdir/$patchlist[$patchindex] | patch -p1 &>/dev/null"); - } - chdir("$workdir"); - system("rm -f `find -name \"*orig\"`"); - if ($patchlist[$patchindex] =~ /bz2/) { - } else { - system("diff -urNp --exclude-from=/home/davej/.exclude linux-$oldindex linux-$patchindex | sed '$datestrip' > $patchlist[$patchindex]"); - } - system("rm -rf linux-$oldindex"); - } -}; - -1; diff --git a/scripts/stable-update.sh b/scripts/stable-update.sh index 23b172207..2cbda8a34 100755 --- a/scripts/stable-update.sh +++ b/scripts/stable-update.sh @@ -47,6 +47,21 @@ if [ ! -f patch-$1.xz ]; then fi fi +if [ ! -f "patch-$1.sign" ]; then + wget "https://cdn.kernel.org/pub/linux/kernel/v4.x/patch-$1.sign" + if [ ! $? -eq 0 ]; then + echo "Signature download failed" + exit 1 + fi +fi + +xzcat "patch-$1.xz" | gpg2 --verify "patch-$1.sign" - +if [ ! $? -eq 0 ]; then + echo "Patch file has invalid or untrusted signature!" + echo "See https://www.kernel.org/category/signatures.html" + exit 1 +fi + grep $1 sources &> /dev/null if [ ! $? -eq 0 ]; then # thl is not an allowed uploader, skip this |