From 734ee7c2486c92ac0c4e9e682f3e7ba2fe4b2fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 7 Apr 2019 22:58:05 +0200 Subject: [PATCH] Support a build without u2mfn module In R4.1 u2mfn module isn't needed anymore. QubesOS/qubes-issues#4280 (cherry picked from commit a5a4ae6735c328c7038a8c1a9a9e3d694a8a907b) --- kernel.spec.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kernel.spec.in b/kernel.spec.in index 96e4ffd..e8333f0 100644 --- a/kernel.spec.in +++ b/kernel.spec.in @@ -164,9 +164,11 @@ make clean $MAKE_ARGS rm -f source find . ! -type d -printf '%%P\n' > %my_builddir/obj-files -u2mfn_ver=`dkms status u2mfn|tail -n 1|cut -f 2 -d ' '|tr -d ':,:'` rm -rf %_builddir/u2mfn -cp -r /usr/src/u2mfn-$u2mfn_ver %_builddir/u2mfn +u2mfn_ver=`dkms status u2mfn|tail -n 1|cut -f 2 -d ' '|tr -d ':,:'` +if [ -n "$u2mfn_ver" ]; then + cp -r /usr/src/u2mfn-$u2mfn_ver %_builddir/u2mfn +fi %build @@ -185,7 +187,9 @@ export AFTER_LINK=\ make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y # Build u2mfn module -make -C %kernel_build_dir M=%_builddir/u2mfn modules +if [ -d "%_builddir/u2mfn" ]; then + make -C %kernel_build_dir M=%_builddir/u2mfn modules +fi %install @@ -220,7 +224,9 @@ dd if=/dev/zero of=%buildroot/boot/initramfs-%kernelrelease.img \ gzip -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease.gz make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot -make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot M=%_builddir/u2mfn +if [ -d "%_builddir/u2mfn" ]; then + make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot M=%_builddir/u2mfn +fi mkdir -p %buildroot/%src_install_dir