]> git.hungrycats.org Git - linux/commitdiff
zygo: from zygo-misc-next-zb64 (v7.1.0-rc4)
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 12 Aug 2018 22:21:54 +0000 (18:21 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 18 Sep 2026 21:36:33 +0000 (17:36 -0400)
zygo: from zygo-misc-next-zb64 (v6.10-rc6)

zygo: from zygo-5.6.x-zb64 (v5.6-rc1)

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: OK maybe 96 kernel jobs at once is a bit excessive

(cherry picked from commit 024c282a872f25b471b45cb14ba27dd7d6f5f0ec)
(cherry picked from commit 838da32fd5848271ee85de80017600cbc151e0ff)

zygo: preserve build artifacts between builds

(cherry picked from commit 2461e8c8918b0c06b0beed09a4463ecc32e9fa52)

zygo: make-kernel: build the modules again in 2020

zygo: make-kernel: build the modules in parallel with separate make.logs

zygo: make-kernel: modules need fakeroot

zygo: make-kernel: target is binary_modules
(cherry picked from commit 4e1a4954d9df12a200ee9227effffaab4c6f324f)

zygo: make-kernel: time the builds

(cherry picked from commit 2101cdfaa8b0c9b49546536c229d3fe2154b99d1)

zygo: make-kernel: apparently if we don't override KSRC, we don't override anything

(cherry picked from commit b9c11139ef2b3856f60a8dbfab5930985e9f0c4a)
(cherry picked from commit 89644f0e49db957f72459a0096f655d5a0d5fa73)
(cherry picked from commit b4a02ecc4f10ea8a0600e43839ced832eccb302e)

zygo: build-kernel: add misc-next tag

zygo: config-kernel: allow hungry-linux-build to write a boilerplate log message

(cherry picked from commit de6b66e03298f9f94313edfeabb6c75d4d15ff76)

zygo: config-kernel: allow hungry-linux-build to write a boilerplate log message (without the syntax error)

(cherry picked from commit de6b66e03298f9f94313edfeabb6c75d4d15ff76)
(cherry picked from commit 410ffb7082eaa660f1965cd1c24bd5daa5d2920c)

zygo: build-kernel: make scripts_gdb too, mod install in parallel

(cherry picked from commit 7775826a46b978c75a636dc51c27e4d7146ab2c8)
(cherry picked from commit 7087329f2d9a148ce2d1950a7b851f6d3b5ccfa6)

zygo: add base revision to EXTRAVERSION

(cherry picked from commit edbe6107713844b9137a2965cca3a1456c5d8127)

zygo: do search $HOME/bin, no ccache but some utilities there

(cherry picked from commit bb009bb0659f3d6c667ae97f1a2007a1f9c2417e)
(cherry picked from commit b8fa6961cb4cfb3e143f1ec039d63cd938f377cb)

zygo: move make-kernel to $HOME/bin

zygo: build-kernel: time the build

zygo: KCONFIG_NOTIMESTAMP was removed 11 years ago, 4 years before first appearance here

(cherry picked from commit 19527daac75885771b12a8d30a6c63290233f080)

zygo: build-kernel: use nproc for -j, parallelism will be done elsewhere

Signed-off-by: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
(cherry picked from commit 96b4ea3861608f60a9ba5d488d9a88614ab002a1)

zygo/build-kernel [new file with mode: 0755]
zygo/config-kernel [new file with mode: 0755]
zygo/do [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..878a93d
--- /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="$HOME/bin:/usr/bin:/bin"
+
+# KERNEL="${KERNEL-kernel}"
+
+EXTRAVERSION="-$(git rev-parse --short HEAD)-misc-next-$(top-non-zygo)"
+
+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="$(nproc)"
+
+if [ -n "$NO_MODULES" ]; then
+       time make -j$((cpuCount)) "$@" EXTRAVERSION="$EXTRAVERSION" bzImage scripts_gdb || exit $?
+else
+       time make -j$((cpuCount)) "$@" EXTRAVERSION="$EXTRAVERSION" bzImage modules scripts_gdb \
+               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..9917fdb
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -x
+if make -j oldconfig && git add -f .config; then
+       if [ -n "$1" ]; then
+               git commit -m"$1"
+       else
+               git commit
+       fi
+fi
diff --git a/zygo/do b/zygo/do
new file mode 100755 (executable)
index 0000000..a8dbe45
--- /dev/null
+++ b/zygo/do
@@ -0,0 +1,36 @@
+#!/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
+# Now done from build system
+# reset-kernel
+
+# Reset module sources from Debian
+new-kernel
+
+# Long ago it was "make oldconfig && make install"
+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/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);