mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-28 08:22:56 +02:00
dkms: improve consistency of relative paths in kernel hooks
This commit is contained in:
parent
8f4c05bf76
commit
22e18e6794
3 changed files with 22 additions and 20 deletions
|
@ -8,7 +8,7 @@ PKGNAME="$1"
|
|||
VERSION="$2"
|
||||
ARCH=$(uname -m)
|
||||
|
||||
if [ ! -x /usr/sbin/dkms ]; then
|
||||
if [ ! -x /usr/bin/dkms ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@ -59,16 +59,16 @@ while [ $# -gt 1 ]; do
|
|||
# If adding a module, depmod is necessary unless dkms runs it
|
||||
do_depmod="yes"
|
||||
|
||||
status=$(dkms status -m ${module} -v ${modulever} -k ${VERSION})
|
||||
status=$(/usr/bin/dkms status -m ${module} -v ${modulever} -k ${VERSION})
|
||||
if [ $(echo "$status"|grep -c ": built") -eq 0 ]; then
|
||||
# Check if the module is still there.
|
||||
if [ ! -f usr/src/${module}-${modulever}/dkms.conf ]; then
|
||||
if [ ! -f /usr/src/${module}-${modulever}/dkms.conf ]; then
|
||||
echo "Skipping nonexistent DKMS module: ${module}-${modulever}."
|
||||
continue
|
||||
fi
|
||||
# Build the module
|
||||
echo -n "Building DKMS module: ${module}-${modulever}... "
|
||||
dkms build -q -m ${module} -v ${modulever} -k ${VERSION} -a ${ARCH}
|
||||
/usr/bin/dkms build -q -m ${module} -v ${modulever} -k ${VERSION} -a ${ARCH}
|
||||
rval=$?
|
||||
# If the module was skipped or failed, go to the next module.
|
||||
if [ $rval -eq 0 ]; then
|
||||
|
@ -80,14 +80,14 @@ while [ $# -gt 1 ]; do
|
|||
echo "FAILED!"
|
||||
continue
|
||||
fi
|
||||
status=$(dkms status -m ${module} -v ${modulever} -k ${VERSION})
|
||||
status=$(/usr/bin/dkms status -m ${module} -v ${modulever} -k ${VERSION})
|
||||
fi
|
||||
|
||||
# If the module is built (either pre-built or just now), install it
|
||||
if [ $(echo "$status"|grep -c ": built") -eq 1 ] &&
|
||||
[ $(echo "$status"|grep -c ": installed") -eq 0 ]; then
|
||||
echo -n "Installing DKMS module: ${module}-${modulever}... "
|
||||
dkms install -q -m ${module} -v ${modulever} -k ${VERSION} -a ${ARCH}
|
||||
/usr/bin/dkms install -q -m ${module} -v ${modulever} -k ${VERSION} -a ${ARCH}
|
||||
rval=$?
|
||||
# If the module failed installation, go to the next module.
|
||||
if [ $rval -eq 0 ]; then
|
||||
|
@ -101,16 +101,18 @@ while [ $# -gt 1 ]; do
|
|||
fi
|
||||
done
|
||||
|
||||
if [ -n "$do_depmod" ]; then
|
||||
echo -n "Generating kernel module dependency lists... "
|
||||
depmod -a ${VERSION}
|
||||
rval=$?
|
||||
if [ $rval -eq 0 ]; then
|
||||
if [ -z "$do_depmod" ] || [ ! -x /usr/bin/depmod ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -n "Generating kernel module dependency lists... "
|
||||
/usr/bin/depmod -a ${VERSION}
|
||||
rval=$?
|
||||
if [ $rval -eq 0 ]; then
|
||||
echo "done."
|
||||
else
|
||||
else
|
||||
echo "FAILED!"
|
||||
exit $rval
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
PKGNAME="$1"
|
||||
VERSION="$2"
|
||||
|
||||
if [ -x /usr/sbin/dkms ]; then
|
||||
if [ -x /usr/bin/dkms ]; then
|
||||
while read line; do
|
||||
name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
|
||||
vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
|
||||
arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
|
||||
echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
|
||||
dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
|
||||
done < <(dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
|
||||
/usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
|
||||
done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
|
||||
fi
|
||||
|
||||
rmdir \
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'dkms'
|
||||
pkgname=dkms
|
||||
version=2.8.3
|
||||
revision=1
|
||||
revision=2
|
||||
conf_files="/etc/dkms/framework.conf"
|
||||
depends="bash kmod gcc make coreutils linux-headers"
|
||||
short_desc="Dynamic Kernel Modules System"
|
||||
|
|
Loading…
Add table
Reference in a new issue