From: Zygo Blaxell Date: Mon, 27 Jan 2020 17:24:46 +0000 (-0500) Subject: zygo: build-kernel: lightweight build-and-deploy script inspired by Raspberry Pi... X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c0626791bff409d3459e44efb45c46c9f94506b;p=linux zygo: build-kernel: lightweight build-and-deploy script inspired by Raspberry Pi and occasionally useful for bisection testing (cherry picked from commit b43dc869686c996118ee7a879698013648f5dc22) --- diff --git a/zygo/build-kernel b/zygo/build-kernel new file mode 100755 index 000000000000..a347157dc3fd --- /dev/null +++ b/zygo/build-kernel @@ -0,0 +1,44 @@ +#!/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}" + +rm -fr ../root/lib/modules + +mkdir -vp \ + ../root/boot \ + ../root/lib/modules \ + +# 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)" + +EXTRAVERSION="-$(git rev-parse --short HEAD)" + +make -j$((cpuCount*2)) "$@" EXTRAVERSION="$EXTRAVERSION" bzImage modules || exit $? +make -j$((cpuCount*2)) "$@" EXTRAVERSION="$EXTRAVERSION" INSTALL_MOD_PATH="$(realpath ../root)" modules_install || exit $? + +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"