]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Make sure custom installkernel scripts are not used
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 9 Sep 2023 09:31:26 +0000 (11:31 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 9 Sep 2023 13:35:00 +0000 (14:35 +0100)
The kernel has this horrible build system feature where distros
can ship /sbin/installkernel and it'll automatically be used by
make install. Let's make sure that doesn't happen as on Debian this
script puts the kernel under the wrong name causing mkosi build
failures.

mkosi.presets/system/mkosi.kernel.build

index 5938330d4b9ae833ca9dd2e937e6a699928390fe..a21585c4cab1bedc8cdbef844b1172d9dc9d508f 100755 (executable)
@@ -12,6 +12,11 @@ if [ -d "$SRCDIR"/mkosi.kernel/ ]; then
     cd "$SRCDIR"
     mkdir -p "$BUILDDIR"
 
+    # Prevent a distro's custom installkernel script from being used.
+    if [ -x /sbin/installkernel ]; then
+        mount --bind /dev/null /sbin/installkernel
+    fi
+
     # Ensure fast incremental builds by fixating these values which usually change for each build.
     export KBUILD_BUILD_TIMESTAMP="Fri Jun  5 15:58:00 CEST 2015"
     export KBUILD_BUILD_HOST="mkosi"