Add hook and trigger to handle hwdb.d files
Adds a hook to check if /usr/lib/udev/hwdb.d is being modified. If so, triggers 'udevadm hwdb --root=. --update'. Closes: #9858 [via git-merge-pr]
This commit is contained in:
parent
24ab530c5e
commit
90b5c612ae
2 changed files with 35 additions and 0 deletions
|
@ -142,6 +142,12 @@ _EOF
|
|||
_add_trigger info-files
|
||||
echo "export info_files=\"${info_files}\"" >> $tmpf
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# Handle files in hwdb directory
|
||||
#
|
||||
if [ -d "${PKGDESTDIR}/usr/lib/udev/hwdb.d" ]; then
|
||||
_add_trigger hwdb.d-dir
|
||||
fi
|
||||
#
|
||||
# (Un)Register a shell in /etc/shells.
|
||||
|
|
29
srcpkgs/xbps-triggers/files/hwdb.d-dir
Executable file
29
srcpkgs/xbps-triggers/files/hwdb.d-dir
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Updates hardware database
|
||||
#
|
||||
# Arguments: $ACTION = [run/targets]
|
||||
# $TARGET = [post-install/pre-remove]
|
||||
# $PKGNAME
|
||||
# $VERSION
|
||||
# $UPDATE = [yes/no]
|
||||
#
|
||||
ACTION="$1"
|
||||
TARGET="$2"
|
||||
PKGNAME="$3"
|
||||
VERSION="$4"
|
||||
UPDATE="$5"
|
||||
|
||||
case "$ACTION" in
|
||||
targets)
|
||||
echo "post-install pre-remove"
|
||||
;;
|
||||
run)
|
||||
usr/bin/udevadm hwdb --root=. --update
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
Reference in a new issue