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:
James Barnett 2017-12-07 20:55:30 -05:00 committed by Jürgen Buchmüller
parent 24ab530c5e
commit 90b5c612ae
2 changed files with 35 additions and 0 deletions

View File

@ -143,6 +143,12 @@ _EOF
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.
#

View 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