Support a build without u2mfn module

In R4.1 u2mfn module isn't needed anymore.

QubesOS/qubes-issues#4280

(cherry picked from commit a5a4ae6735)
This commit is contained in:
Marek Marczykowski-Górecki 2019-04-07 22:58:05 +02:00
parent 8b4d479798
commit 734ee7c248
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -164,9 +164,11 @@ make clean $MAKE_ARGS
rm -f source rm -f source
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files 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 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 %build
@ -185,7 +187,9 @@ export AFTER_LINK=\
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
# Build u2mfn module # 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 %install
@ -220,7 +224,9 @@ dd if=/dev/zero of=%buildroot/boot/initramfs-%kernelrelease.img \
gzip -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease.gz 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
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 mkdir -p %buildroot/%src_install_dir