]> git.hungrycats.org Git - linux/commitdiff
zygo: build-kernel: support "NO_MODULES=1" to build bzimage without modules
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sat, 14 Mar 2020 04:19:46 +0000 (00:19 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Tue, 7 Apr 2020 03:25:25 +0000 (23:25 -0400)
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)
(cherry picked from commit 29c86e1afb4005835bf9ffc8a54cd4a0ba964927)

zygo/build-kernel

index a347157dc3fd4b390782862c09f21860d9ceaed6..ed2fd3ceffdc49405295d1e8b08750038051d612 100755 (executable)
@@ -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/