Skip to content

Commit bc116c0

Browse files
committed
add hook for kernel modules
1 parent 0e08cee commit bc116c0

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ HELPER_HOOKS_SHELL+=mandb
9999
HELPER_HOOKS_SHELL+=systemd-tmpfiles
100100
HELPER_HOOKS_SHELL+=gconf-install-schemas
101101
HELPER_HOOKS_SHELL+=info-dir
102+
HELPER_HOOKS_SHELL+=kernel-modules
102103

103104
MANPAGES+=bee.1
104105
MANPAGES+=bee-check.1

hooks/kernel-modules.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
#
3+
action=${1}
4+
pkg=${2}
5+
content=${3}
6+
: ${content:=${BEE_METADIR}/${pkg}/CONTENT}
7+
8+
if [ -z ${BEE_VERSION} ] ; then
9+
echo >&2 "BEE-ERROR: cannot call $0 from the outside of bee .."
10+
exit 1
11+
fi
12+
13+
: ${DEPMOD:=depmod}
14+
15+
if [ ! type -p ${DEPMOD} >/dev/null 2>&1 ; then
16+
exit 0
17+
fi
18+
19+
if [ ! -r "${BEE_METADIR}/${pkg}/META" ] ; then
20+
exit 0
21+
fi
22+
23+
. ${BEE_METADIR}/${pkg}/META
24+
25+
if [ ! "${BEEMETAFORMAT:=0}" -ge 2 ] ; then
26+
exit 0
27+
fi
28+
29+
case "${action}" in
30+
"post-install"|"post-remove")
31+
for ver in $(grep -Po ':file=/lib/modules/\K([^/]+)(?=/)' ${content}|sort -u) ; do
32+
echo "$DEPMOD $ver"
33+
test -e /lib/modules/$ver/modules.builtin && $DEPMOD $ver
34+
done
35+
;;
36+
esac

0 commit comments

Comments
 (0)