summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJustin M. Forbes <jforbes@fedoraproject.org>2017-07-24 16:25:32 -0500
committerJustin M. Forbes <jforbes@fedoraproject.org>2017-07-24 16:25:32 -0500
commit3ff7c261fbea5db34bb9a494c82e0252f3d03c01 (patch)
tree63b819dd4bba6cc2dde96072e57dcb7832060a8f /scripts
parent884e6796ebde5335d93ffec1fb63d7fed736df57 (diff)
downloadkernel-3ff7c261fbea5db34bb9a494c82e0252f3d03c01.tar.gz
kernel-3ff7c261fbea5db34bb9a494c82e0252f3d03c01.tar.xz
kernel-3ff7c261fbea5db34bb9a494c82e0252f3d03c01.zip
Linux v4.12.3
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/allarchconfig.sh16
-rwxr-xr-xscripts/bumpspecfile.py76
-rwxr-xr-xscripts/generate-perf-man.sh6
-rwxr-xr-xscripts/rawhide-rc.sh4
-rw-r--r--scripts/rediffall.pl64
5 files changed, 164 insertions, 2 deletions
diff --git a/scripts/allarchconfig.sh b/scripts/allarchconfig.sh
new file mode 100755
index 000000000..f80c23197
--- /dev/null
+++ b/scripts/allarchconfig.sh
@@ -0,0 +1,16 @@
+#!/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
new file mode 100755
index 000000000..bc02ab300
--- /dev/null
+++ b/scripts/bumpspecfile.py
@@ -0,0 +1,76 @@
+#!/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
index 27691fafd..f5332ad86 100755
--- a/scripts/generate-perf-man.sh
+++ b/scripts/generate-perf-man.sh
@@ -47,8 +47,12 @@ if [ ! -z "$@" ]; then
esac
done
fi
-cd tools/perf/Documentation/
+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 5982403e7..40f32a8fe 100755
--- a/scripts/rawhide-rc.sh
+++ b/scripts/rawhide-rc.sh
@@ -19,6 +19,7 @@ fedpkg commit -c
RC=`grep "%global rcrev" kernel.spec| cut -d ' ' -f 3`
RC=$(($RC+1))
BASE=`grep "%define base_sublevel" kernel.spec| cut -d ' ' -f 3`
+OLDBASE=$BASE
# See comment in kernel.spec about the base numbering
BASE=$(($BASE+1))
@@ -28,10 +29,11 @@ mv sources.tmp sources
# Grab the tarball
if [ ! -f patch-4.$BASE-rc$RC.xz ]; then
- wget https://cdn.kernel.org/pub/linux/kernel/v4.x/testing/patch-4.$BASE-rc$RC.xz
+ wget -O patch-4.$BASE-rc$RC https://git.kernel.org/torvalds/p/v4.$BASE-rc$RC/v4.$OLDBASE
if [ ! $? -eq 0 ]; then
exit 1
fi
+ xz -9 patch-4.$BASE-rc$RC
fedpkg upload patch-4.$BASE-rc$RC.xz
fi
diff --git a/scripts/rediffall.pl b/scripts/rediffall.pl
new file mode 100644
index 000000000..29f12beb9
--- /dev/null
+++ b/scripts/rediffall.pl
@@ -0,0 +1,64 @@
+#!/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;