diff --git a/Makefile b/Makefile index 0c181ff..d760e9f 100644 --- a/Makefile +++ b/Makefile @@ -99,6 +99,7 @@ HELPER_HOOKS_SHELL+=mandb HELPER_HOOKS_SHELL+=systemd-tmpfiles HELPER_HOOKS_SHELL+=gconf-install-schemas HELPER_HOOKS_SHELL+=info-dir +HELPER_HOOKS_SHELL+=kernel-modules MANPAGES+=bee.1 MANPAGES+=bee-check.1 diff --git a/hooks/kernel-modules.sh b/hooks/kernel-modules.sh new file mode 100755 index 0000000..65e1f98 --- /dev/null +++ b/hooks/kernel-modules.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +action=${1} +pkg=${2} +content=${3} +: ${content:=${BEE_METADIR}/${pkg}/CONTENT} + +if [ -z ${BEE_VERSION} ] ; then + echo >&2 "BEE-ERROR: cannot call $0 from the outside of bee .." + exit 1 +fi + +: ${DEPMOD:=depmod} + +if [ ! type -p ${DEPMOD} >/dev/null 2>&1 ; then + exit 0 +fi + +if [ ! -r "${BEE_METADIR}/${pkg}/META" ] ; then + exit 0 +fi + +. ${BEE_METADIR}/${pkg}/META + +if [ ! "${BEEMETAFORMAT:=0}" -ge 2 ] ; then + exit 0 +fi + +case "${action}" in + "post-install"|"post-remove") + for ver in $(grep -Po ':file=/lib/modules/\K([^/]+)(?=/)' ${content}|sort -u) ; do + echo "$DEPMOD $ver" + test -e /lib/modules/$ver/modules.builtin && $DEPMOD $ver + done + ;; +esac diff --git a/src/beelib.config.sh.in b/src/beelib.config.sh.in index e0b5d45..dfd244d 100644 --- a/src/beelib.config.sh.in +++ b/src/beelib.config.sh.in @@ -313,7 +313,7 @@ function config_verify_builtin_prefixes() { : ${EPREFIX:='${PREFIX}'} : ${BINDIR:='${EPREFIX}/bin'} : ${SBINDIR:='${EPREFIX}/sbin'} - : ${LIBEXECDIR:='${EPREFIX}/lib/${PKGNAME}'} + : ${LIBEXECDIR:='${EPREFIX}/libexec'} : ${SYSCONFDIR:=DEFAULT} : ${LOCALSTATEDIR:=DEFAULT} : ${SHAREDSTATEDIR:='${LOCALSTATEDIR}'} diff --git a/src/beesh.sh.in b/src/beesh.sh.in index 543910e..c720648 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -47,6 +47,8 @@ VERSION=${BEE_VERSION} # load libs . ${BEE_LIBEXECDIR}/bee/beelib.config.sh +umask 022 + function bee-cache() { ${BEE_LIBEXECDIR}/bee/bee.d/bee-cache "${@}" }