File kmp-post.sh of Package nvidia-gfx
%ifarch %ix86
arch=i386
%endif
%ifarch x86_64
arch=x86_64
%endif
flavor=%1
kver=$(make -sC /usr/src/linux-obj/$arch/$flavor kernelrelease)
RES=0
make -C /usr/src/linux-obj/$arch/$flavor \
modules \
M=/usr/src/kernel-modules/nvidia-%{-v*}-$flavor \
SYSSRC=/lib/modules/$kver/source \
SYSOUT=/usr/src/linux-obj/$arch/$flavor || RES=1
pushd /usr/src/kernel-modules/nvidia-%{-v*}-$flavor
make -f Makefile.kbuild \
nv-linux.o \
SYSSRC=/lib/modules/$kver/source \
SYSOUT=/usr/src/linux-obj/$arch/$flavor || RES=1
popd
install -m 755 -d /lib/modules/%2-$flavor/updates
install -m 644 /usr/src/kernel-modules/nvidia-%{-v*}-$flavor/nvidia.ko \
/lib/modules/%2-$flavor/updates
depmod %2-$flavor
#needed to move this to specfile after running weak-modules2 (boo#1145316)
#exit $RES