aboutsummaryrefslogtreecommitdiff
path: root/libraries/digimend-kernel-drivers
diff options
context:
space:
mode:
authorAndrew Clemons <andrew.clemons@gmail.com>2022-02-04 22:12:27 +1300
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-02-04 17:53:46 +0700
commit423422a22c7060ca6da6b6e2ae368e46926d1b73 (patch)
tree0537b02e8f7d34e0ab1b1f5ee65deb22220e1d15 /libraries/digimend-kernel-drivers
parent55fd03a3444fa9b57225f773fc1e9b4bd8e41dfe (diff)
libraries/digimend-kernel-drivers: Allow building for other kernels.
Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries/digimend-kernel-drivers')
-rw-r--r--libraries/digimend-kernel-drivers/digimend-kernel-drivers.SlackBuild29
-rw-r--r--libraries/digimend-kernel-drivers/doinst.sh5
2 files changed, 24 insertions, 10 deletions
diff --git a/libraries/digimend-kernel-drivers/digimend-kernel-drivers.SlackBuild b/libraries/digimend-kernel-drivers/digimend-kernel-drivers.SlackBuild
index 0cf7d36d24a50..6ddf1132f202e 100644
--- a/libraries/digimend-kernel-drivers/digimend-kernel-drivers.SlackBuild
+++ b/libraries/digimend-kernel-drivers/digimend-kernel-drivers.SlackBuild
@@ -26,10 +26,14 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=digimend-kernel-drivers
VERSION=${VERSION:-10}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
+KERNEL=${KERNEL:-$(uname -r)}
+KERNELPATH=${KERNELPATH:-/lib/modules/$KERNEL/build}
+PKG_VERS=${VERSION}_$(echo $KERNEL | tr - _)
+
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
@@ -42,7 +46,7 @@ fi
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
- echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ echo "$PRGNAM-$PKG_VERS-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
@@ -79,21 +83,26 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-make
-make install DESTDIR=$PKG
+# don't run depmod here
+sed -i '/depmod -a$/d' Makefile
+# don't run udevadm here
+sed -i '/^install:/s/ udev_rules_install / udev_rules_install_files /' Makefile
+make KVERSION=$KERNEL
+make install DESTDIR=$PKG KVERSION=$KERNEL
-mkdir -p $PKG/lib/modules/$(uname -r)/kernel/drivers/hid/
-cp hid*.ko $PKG/lib/modules/$(uname -r)/kernel/drivers/hid/
+mkdir -p $PKG/lib/modules/$KERNEL/kernel/drivers/hid/
+cp hid*.ko $PKG/lib/modules/$KERNEL/kernel/drivers/hid/
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a COPYING README.md $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+mkdir -p $PKG/usr/doc/$PRGNAM-$PKG_VERS
+cp -a COPYING README.md $PKG/usr/doc/$PRGNAM-$PKG_VERS
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKG_VERS/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKG_VERS-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/libraries/digimend-kernel-drivers/doinst.sh b/libraries/digimend-kernel-drivers/doinst.sh
new file mode 100644
index 0000000000000..893d0a386ef0c
--- /dev/null
+++ b/libraries/digimend-kernel-drivers/doinst.sh
@@ -0,0 +1,5 @@
+chroot . /sbin/depmod -a @KERNEL@
+
+if [ -x /sbin/udevadm ]; then
+ /sbin/udevadm control --reload
+fi