From: Zygo Blaxell Date: Sat, 14 Mar 2020 04:19:46 +0000 (-0400) Subject: zygo: build-kernel: support "NO_MODULES=1" to build bzimage without modules X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e511b300ebb7677ee90e2ee9a40dca660c7de1a;p=linux zygo: build-kernel: support "NO_MODULES=1" to build bzimage without modules zygo: build-kernel: support "extraversion" tag to rebuild bzimage without modules (cherry picked from commit a4c24c9f81885f70a4cc442a96fd03a5c15daef2) (cherry picked from commit 3a51996a107433b54e38dcfd6a3da25e4d707d6e) zygo: fixup build-kernel (cherry picked from commit bf16da36b115594ff8ab9db8e4417b00ee6ece41) (cherry picked from commit 464bb2f50fa6ee316eff09d4d76e984a12003f29) zygo: build-kernel: support no-modules builds instead of extraversion tag? (cherry picked from commit b7d9c895fe6923c387248c812ac4ebfc8619280b) (cherry picked from commit 793ee1c053f6854e4dcef9bb5c1c6446ef9c742c) (cherry picked from commit 5d10b7a3fc529dcdcf0e23a6bb87944c3cd813a6) --- diff --git a/zygo/build-kernel b/zygo/build-kernel index a347157dc3fd..ed2fd3ceffdc 100755 --- a/zygo/build-kernel +++ b/zygo/build-kernel @@ -14,11 +14,16 @@ PATH="/usr/bin:/bin" # KERNEL="${KERNEL-kernel}" -rm -fr ../root/lib/modules +EXTRAVERSION="-$(git rev-parse --short HEAD)" + +if [ -z "$NO_MODULES" ]; then + rm -fr ../root/lib/modules + + mkdir -vp \ + ../root/boot \ + ../root/lib/modules \ -mkdir -vp \ - ../root/boot \ - ../root/lib/modules \ +fi # make -j4 zImage modules dtbs # sudo make modules_install @@ -31,10 +36,12 @@ mkdir -vp \ 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 $? +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/