Skip to content

Commit

Permalink
Merge branch "donald/fixes"
Browse files Browse the repository at this point in the history
* donald/fixes:
  beesh: set umask to defined value
  add hook for kernel modules
  reset default of libexecdir
  • Loading branch information
donald committed Apr 22, 2016
2 parents 5e5a7de + c4d5f39 commit 1070fbd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions hooks/kernel-modules.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/beelib.config.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}'}
Expand Down
2 changes: 2 additions & 0 deletions src/beesh.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 "${@}"
}
Expand Down

0 comments on commit 1070fbd

Please sign in to comment.