mirror of
https://github.com/openwall/lkrg.git
synced 2023-12-13 21:30:29 +01:00
17 lines
572 B
Bash
Executable file
17 lines
572 B
Bash
Executable file
#!/bin/bash -eux
|
|
# mkosi.build - Compile and install compiled module and the source into DESTDIR.
|
|
|
|
KERNELRELEASE=$(ls -d /lib/modules/* | sort -V | tail -1)
|
|
KERNELRELEASE=${KERNELRELEASE##/lib/modules/}
|
|
export KERNELRELEASE
|
|
|
|
# No sysv banner on opensuse and centos9.
|
|
type banner >/dev/null 2>&1 && banner build $KERNELRELEASE >&2
|
|
|
|
# Allow manual run with make arguments, like 'clean'.
|
|
make -j$(nproc) $@
|
|
|
|
# Install if compiled.
|
|
[ -e lkrg.ko ] && [ -v DESTDIR ] &&
|
|
install -Dpm 644 lkrg.ko $DESTDIR/lib/modules/$KERNELRELEASE/extra/lkrg.ko &&
|
|
cp -av ./ $DESTDIR/lkrg/ || :
|