]> git.hungrycats.org Git - linux/commitdiff
zygo: from zygo-5.6.x-zb64 (v5.6-rc1)
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 12 Aug 2018 22:21:54 +0000 (18:21 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sat, 6 Mar 2021 14:44:20 +0000 (09:44 -0500)
zygo: from zygo-5.0.x-zb64

zygo: from zygo-4.17.x-zb64

(cherry picked from commit c45b6fb9ce9315c056288bfb5a755fd7eec9a197)

zygo: make oldconfig for v4.18

(cherry picked from commit cc3d6d815e6415c1157435e3f63270e4137b6608)
(cherry picked from commit f44fa222fc6a7df75b02a77e1d663bd8bee67fc5)

zygo: make oldconfig for 4.19.1

(cherry picked from commit 9c6ad550267932f5a4992c5d1f46980793c6a9a6)

zygo: make oldconfig for 4.19.7

(cherry picked from commit 002c486977a9a83a1e1385ec6de2746668de02f9)
(cherry picked from commit 63f6b068f316598eade19e31a1095ad7dbc700ba)

zygo: make oldconfig for v4.20

(cherry picked from commit 9a1ea99f7eada69738307d2898161a82e27310e2)
(cherry picked from commit db51f3f667ac3d5fa0851e4a49fce64f2a46ebf6)
(cherry picked from commit e0d2aa5082fcad29770f5786ae2a41fd100bdcde)
(cherry picked from commit d117937ed23d27b41faf7a4c2d16ebe463459d21)
(cherry picked from commit fedf2d15fd89d82cd73d431cae24f9318be6f869)
(cherry picked from commit d70c0dcaa12a9f5e1f483367b5798136a2d4dff5)

zygo: add 'config-kernel' script to run 'make oldconfig' with KCONFIG_NOTIMESTAMP

(cherry picked from commit 4cc38d103bc42929ef42f3df5a344b27ab3fda45)

zygo: no .config
(cherry picked from commit 19241c180c3474423e9ec395494161ae87cc16dd)

zygo: build-kernel: lightweight build-and-deploy script inspired by Raspberry Pi and occasionally useful for bisection testing

(cherry picked from commit b43dc869686c996118ee7a879698013648f5dc22)

zygo: remove obsolete (and a little bit dangerous) cherry-pick scripts

(cherry picked from commit 3ec46e9b8830f60617d195b04c0df35890820dd5)

zygo: build-kernel: support no-modules builds instead of extraversion tag

zygo: build-kernel: support "extraversion" tag to rebuild bzimage without modules

zygo: fixup build-kernel

zygo: build-kernel: support no-modules builds instead of extraversion tag?

zygo: switch from kernel-package to bindeb-pkg (v2, no nested fakeroot)

(cherry picked from commit 9f0897f2bd10304eaece6c011725c3481595e4e0)

zygo: no nested fakeroot

23:54:06 O:   LD [M]  virt/lib/irqbypass.ko
23:54:07 E:  fakeroot -u debian/rules binary
23:54:07 E: fakeroot: FAKEROOTKEY set to 108604309
23:54:07 E: fakeroot: nested operation not yet supported
23:54:07 E: dpkg-buildpackage: error: fakeroot -u debian/rules binary subprocess returned exit status 1
23:54:08 E: make[1]: *** [scripts/package/Makefile:80: bindeb-pkg] Error 1
23:54:08 E: make: *** [Makefile:1365: bindeb-pkg] Error 2
23:54:08 I: Finished with exitcode 2
(cherry picked from commit 0ad8aded2bdba7c063ce7c9cbebdc4d11290155a)
(cherry picked from commit 93ab45f488366ca7a4c3c61ca8b7c47b9ad59336)

zygo/build-kernel [new file with mode: 0755]
zygo/config-kernel [new file with mode: 0755]
zygo/do [new file with mode: 0755]
zygo/make-kernel [new file with mode: 0755]
zygo/new-kernel [new file with mode: 0755]
zygo/rename-kernel [new file with mode: 0755]
zygo/reset-kernel [new file with mode: 0755]
zygo/trash [new file with mode: 0755]

diff --git a/zygo/build-kernel b/zygo/build-kernel
new file mode 100755 (executable)
index 0000000..ed2fd3c
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/bash
+# ...because not sure if dash does ${foo/re/rep}
+set -x
+
+move-to-cgroup kbuild $$
+
+deployTarget="$1"
+shift
+
+set -a
+# PATH="$PATH:$(realpath ../tools)/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin"
+# No ccache
+PATH="/usr/bin:/bin"
+
+# KERNEL="${KERNEL-kernel}"
+
+EXTRAVERSION="-$(git rev-parse --short HEAD)"
+
+if [ -z "$NO_MODULES" ]; then
+       rm -fr ../root/lib/modules
+
+       mkdir -vp \
+               ../root/boot \
+               ../root/lib/modules \
+
+fi
+
+# make -j4 zImage modules dtbs
+# sudo make modules_install
+# sudo cp arch/arm/boot/dts/*.dtb /boot/
+# sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
+# sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
+# sudo cp arch/arm/boot/zImage /boot/$KERNEL.img
+
+# mEnv="ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-"
+
+cpuCount="$(grep -c '^processor' /proc/cpuinfo || echo 1)"
+
+if [ -n "$NO_MODULES" ]; then
+       make -j$((cpuCount*2)) "$@" EXTRAVERSION="$EXTRAVERSION" bzImage || exit $?
+else
+       make -j$((cpuCount*2)) "$@" EXTRAVERSION="$EXTRAVERSION" bzImage modules || exit $?
+       make -j$((cpuCount*2)) "$@" EXTRAVERSION="$EXTRAVERSION" INSTALL_MOD_PATH="$(realpath ../root)" modules_install || exit $?
+fi
+
+rsync -avxHSPW arch/x86/boot/bzImage ../root/boot/vmlinuz
+# rsync -avxHSPW arch/arm/boot/dts/*.dtb ../root/boot/
+# rsync -avxHSPW arch/arm/boot/dts/overlays/*.dtb* ../root/boot/overlays/
+# rsync -avxHSPW arch/arm/boot/dts/overlays/README ../root/boot/overlays/
+
+[ -n "$deployTarget" ] && rsync -avxzHSP ../root/. "$deployTarget"
diff --git a/zygo/config-kernel b/zygo/config-kernel
new file mode 100755 (executable)
index 0000000..abe750f
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -x
+KCONFIG_NOTIMESTAMP=1 make -j oldconfig && git add -f .config && git commit
diff --git a/zygo/do b/zygo/do
new file mode 100755 (executable)
index 0000000..e85c08a
--- /dev/null
+++ b/zygo/do
@@ -0,0 +1,35 @@
+#!/bin/bash
+set -x
+
+set -aP
+ORIG_PATH="$PATH"
+PATH="$PWD/zygo:$ORIG_PATH"
+
+# Batch mode scheduling
+schedtool -v -B $$
+
+# Tag, here.
+EXTRAVERSION=-zb64-$(git rev-parse --short HEAD)
+
+# Rename the kernel directory
+rename-kernel "$EXTRAVERSION"
+
+# Reread $PWD
+cd .
+PATH="$PWD/zygo:$ORIG_PATH"
+
+# Reset kernel sources to git HEAD
+reset-kernel
+
+# Reset module sources from Debian
+new-kernel
+
+# Long ago it was "make oldconfig && make install"
+KCONFIG_NOTIMESTAMP=1 make oldconfig
+yes '' | make-kernel "$@"
+
+# Move all products to the same directory for pickup
+mv -vi ../modules/*.deb ../ &
+trash ../*.buildinfo &
+trash ../*.changes &
+wait
diff --git a/zygo/make-kernel b/zygo/make-kernel
new file mode 100755 (executable)
index 0000000..f9c0856
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -xP
+rev=9zb${PWD##*-9zb}
+
+# Reread $PWD
+cd .
+
+(
+       set -a
+       MAKEFLAGS="EXTRAVERSION=$EXTRAVERSION"
+       MODULE_LOC=$PWD/../modules 
+       INSTALLKERNEL=true
+       KBUILD_DIR=$PWD
+       set +a
+       procsOnln=$(getconf _NPROCESSORS_ONLN)
+       annotate-output make -j$((procsOnln * 4)) bindeb-pkg EXTRAVERSION="$EXTRAVERSION"
+) 2>&1 | tee make.log
diff --git a/zygo/new-kernel b/zygo/new-kernel
new file mode 100755 (executable)
index 0000000..c7f655d
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+set -xP
+cd ../modules || exit 1
+
+# Exception to naming convention
+trash drbd
+tar xjf /usr/src/drbd8.tar.bz2
+
+for x in *; do
+       if [ -d /usr/src/modules/"$x" ]; then
+               rsync -avx --delete /usr/src/modules/"$x"/. "$x"
+       elif [ -s /usr/src/"$x".tar.bz2 ]; then
+               trash "$x"
+               (cd .. && tar xjf /usr/src/"$x".tar.bz2)
+       elif [ -s /usr/src/"$x"-source.tar.bz2 ]; then
+               trash "$x"
+               (cd .. && tar xjf /usr/src/"$x"-source.tar.bz2)
+       elif [ -s /usr/src/"$x".tar.gz ]; then
+               trash "$x"
+               (cd .. && tar xzf /usr/src/"$x".tar.gz)
+       elif [ -s /usr/src/"$x".tar.xz ]; then
+               trash "$x"
+               (cd .. && tar xf /usr/src/"$x".tar.xz -I xz)
+       elif [ -s /usr/src/"$x"-source.tar.gz ]; then
+               trash "$x"
+               (cd .. && tar xzf /usr/src/"$x"-source.tar.gz)
+       elif [ -s /usr/src/"$x"-source.xz ]; then
+               trash "$x"
+               (cd .. && tar xf /usr/src/"$x"-source.xz -I xz)
+       else
+               echo "Can't figure out where module '$x' came from"
+       fi
+done
diff --git a/zygo/rename-kernel b/zygo/rename-kernel
new file mode 100755 (executable)
index 0000000..60af2d9
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash -x
+set -aP
+
+# Reread $PWD
+cd .
+
+for x in ../linux-source*/; do
+       [ -d "$x" ] || continue
+
+       x="${x%/}";
+       eval "$(
+               egrep '^(VERSION|PATCHLEVEL|SUBLEVEL|EXTRAVERSION)' "$x"/Makefile | sed -e 's/[: ()]//g'
+       )"
+
+       [ -z "$EXTRAVERSION" ] && EXTRAVERSION="$1"
+       [ -z "$EXTRAVERSION" ] && exit 1
+
+       # kname="linux-source-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION-9zb`date +%Y%m%d%H`"
+       kname="linux-source-$VERSION.$PATCHLEVEL"
+       mv -vi "$x" "../$kname"
+       ln -sfnv "$kname" ../LS
+done
+
diff --git a/zygo/reset-kernel b/zygo/reset-kernel
new file mode 100755 (executable)
index 0000000..ce49faa
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -x
+git clean -qdfx
+git reset --hard
diff --git a/zygo/trash b/zygo/trash
new file mode 100755 (executable)
index 0000000..d84ef39
--- /dev/null
@@ -0,0 +1,194 @@
+#!/usr/bin/perl
+# $Id: trash,v 1.1 1997/08/05 02:23:55 cvsconf Exp $
+
+# Trash utility suite
+# Zygo Blaxell, 96/05/29
+# Version 1.3
+# 'mkdir' command deals with symlinks correctly, and renames non-directories
+# aside.
+
+# Version 1.2
+# Fixed problems with exit status in 'trash' modes.
+
+# Version 1.1, 96/05/03
+# Fixed so it works on Solaris and Perl4
+
+# Version 1.0
+# Finally released...
+
+# Usage:  Name this file one of the following:
+
+# trash                - 'trash file' moves 'file' into a trash directory.
+# sneaky-trash - trashes file, then creates a symlink to it.
+# placebo-trash - trashes file, then creates a 0-length file with the
+#                same permissions.
+# untrash      - attempt to recover a file from trash directory.
+#                 note that if you trash a file with the same name
+#                twice, this may not work.
+# lstrash      - 'lstrash -RFC' lists contents of all existing trash 
+#                directories using 'ls -RFC' (or your own flags).
+
+# Environment variables:
+# TRASH_NO_AUTOCONFIG - don't try to use 'df' to find a good place to
+#                       make trash directories if this is set.
+# TRASH_PREFER - format: directory=value:directory=value:...
+#                example: /home/you/.trash=2:/tmp=-2:.trash=-1
+#                Sets preference values for directories.
+#                Autoconfigured preference values range from 0 to 1.
+#                Higher preference values will be used first.
+#                A preference value that is non-numeric (such as "off")
+#                will prevent the directory from ever being used.
+# TRASH_UMASK - override the default umask for the trashcan directory.
+#               The default umask is 077.
+
+# A 'trash directory' is a directory that holds the trash
+# files.  This software assumes that you have some other software that
+# will empty this trash directory.  If you don't, simply use 'rm -rf'
+# on the trash directory itself.  If you want software that deletes
+# the oldest files in a directory hierarchy when disk space drops below
+# a minimum threshold, try my program 'filereaper'.
+
+# CONFIGURATION
+# Edit the 'df' command between `` characters below to be the fastest
+# possible invocation for your system.  'df --no-sync -xnfs' for GNU df.
+
+# Trashcan directory privacy settings - use '077' to deny all access,
+#                                           '027' allow group read access
+#                                           '022' allow world read access
+
+$umask=umask($ENV{'TRASH_UMASK'} || 077);
+
+for $component (split(/\:+/o,$ENV{'TRASH_PREFER'})) {
+       ($dir,$pref)=($component =~ m:^([^=]+)=([^=]+)$:oi);
+       $dir =~ s:/+:/:go;
+       if (defined($pref)) {
+               if (!(-d $dir)) {
+                       print STDERR "Warning:  TRASH_PREFER refers to $dir, which is not a directory\n";
+                       $pref='no';
+               }
+               $free{$dir}=$pref;
+       } else {
+               print STDERR "Warning:  Couldn't grok $component in TRASH_PREFER variable\n";
+       }
+}
+
+$userid=getpwuid("$<") || ":$<:";
+$trashdir=".trash.$userid";
+
+# Automatic configuration - comment this out if you don't want it.
+unless ($ENV{'TRASH_NO_AUTOCONFIG'}) {
+       @df=split(/\n/o,`df -k`);
+       for (@df) {
+               ($fs,$blocks,$used,$avail,$cap,$mp)=split(' ',$_);
+               ($dir="$mp/tmp/$trashdir") =~ s:/+:/:go;
+               next if defined($free{$dir});
+               next unless $blocks =~ /^\d+$/o;
+                $created{$dir}=mkdir($dir,0755);
+                next if (-l $dir);
+                next if !(-d _);
+                next if !(-O _);
+               $free{$dir}=$avail;
+       }
+}
+
+foreach (keys(%free)) {
+       delete $free{$_} if ($free{$_} =~ m/^[^\d]*$/o);
+}
+
+@filesystems=sort { $free{$b} <=> $free{$a} } (keys(%free));
+print STDERR "Trash directories in preference order: @filesystems\n";
+
+($curdir=`pwd`) =~ s/\n$//o;
+$curdir='.' unless $curdir =~ m:^/:o;
+
+$attempts=0;
+$successes=0;
+if ($0 =~ /untrash$/oi) {
+       for $arg (@ARGV) {
+               $attempts++;
+               $arg="$curdir/$arg" unless $arg =~ m:^/:o;
+               $arg =~ s:/+$::o;
+               for $fs (@filesystems) {
+                       eval {
+                               $trasharg="$fs/$arg";
+                               $trasharg =~ s:/+:/:go;
+                               next unless ((-l $trasharg) || (-e _));
+                               print STDERR "$trasharg -> $arg\n";
+                               rename($trasharg,$arg) || (system("mv",$trasharg,$arg) && die "mv: exit status $?");
+                               $successes++;
+                               last;
+                       };
+                       print STDERR $@ if $@;
+                       last unless $@;
+               }
+       }
+} elsif ($0 =~ /lstrash$/io) {
+       exec("ls",@ARGV,@filesystems);
+} else {
+       for $arg (@ARGV) {
+               $attempts++;
+               unless ((-l $arg) || (-e _)) {
+                       print STDERR "$arg: not found: $!\n";
+                       next;
+               }
+               ($dev,$ino,$mode)=lstat(_);
+               $arg="$curdir/$arg" unless $arg =~ m:^/:o;
+               $arg =~ s:/+$::o;
+               for $fs (@filesystems) {
+                       eval {
+                               @argcomp=split(m:/+:o,$arg);
+                               pop(@argcomp) while $#argcomp>=0 && !length($argcomp[$#argcomp]);
+                               $argfile=pop(@argcomp);
+                               $argdir=join("/",@argcomp);
+                               $trashargdir="$fs/$argdir";
+                               $trasharg="$fs/$arg";
+                               $trasharg =~ s:/+:/:go;
+                               $trashargdir =~ s:/+:/:go;
+                               $trashnewarg=$trasharg;
+                               $trashnewarg =~ s/(\.(\d+))?$/".".($2+1)/oe while ((-l $trashnewarg) || (-e _));
+                               if ($trashnewarg ne $trasharg) {
+                                       print STDERR "$trasharg -> $trashnewarg\n";
+                                       rename($trasharg,$trashnewarg) || warn "rename: $trasharg -> $trashnewarg: $!";
+                               }
+                               eval {
+                                       unless (! (-l "$trashargdir") && (-d _)) {
+                                               $path_so_far=($fs =~ m:^/:o) ? '' : '.';
+                                               for (split(/\/+/o,$trashargdir)) {
+                                                       ($newdir="$path_so_far/$_") =~ s:/+:/:go;
+                                                       $path_so_far=$newdir;
+                                                       next if (! (-l $path_so_far) && (-d _));
+                                                       $trashnewpath=$path_so_far;
+                                                       $trashnewpath =~ s/(\.(\d+))?$/".".($2+1)/oe while ((-l $trashnewarg) || (-e _));
+                                                       if ($trashnewpath ne $path_so_far) {
+                                                               print STDERR "$path_so_far -> $trashnewpath\n";
+                                                               rename($path_so_far,$trashnewpath) || warn "rename: $path_so_far -> $trashnewpath: $!";
+                                                       }
+                                                       print STDERR "mkdir $newdir\n";
+                                                       mkdir($newdir,0700) || die "mkdir $newdir: $!" unless (-d "$newdir/");
+                                               }
+                                       }
+                               }; 
+                               print STDERR $@ if $@;
+                               next if $@;
+                               print STDERR "$arg -> $trasharg\n";
+                               rename($arg,$trasharg) || (system("mv",$arg,$trasharg) && die "mv: exit status $?");
+                               if ($0 =~ /sneaky-trash$/oi) {
+                                       print STDERR "$arg <- $trasharg\n";
+                                       symlink($trasharg,$arg) || die "symlink $trasharg <- $arg: $!";
+                               } elsif ($0 =~ /placebo-trash$/oi) {
+                                       print STDERR "touch $arg\n";
+                                       open(PLACEBO,">>$arg") || die "open $arg: $!";
+                                       close(PLACEBO);
+                                       chmod($mode,$arg) || die "chmod $arg: $!";
+                               }
+                               $successes++;
+                               last;
+                       };
+                       print STDERR $@ if $@;
+                       last unless $@;
+               }
+       }
+}
+
+exit(1) if $successes != $attempts;
+exit(0);