modsign: do not install, if no keys present

also fixed inst_hook
master
Harald Hoyer 2013-07-24 10:34:19 +02:00
parent ad2565c8ff
commit 56b58c0a94
1 changed files with 13 additions and 4 deletions

View File

@ -8,7 +8,15 @@
# Peter Jones <pjones@redhat.com>

check() {
[ -x /usr/bin/keyctl ] || return 1
[[ -x /usr/bin/keyctl ]] || return 1

# do not include module in hostonly mode,
# if no keys are present
if [[ $hostonly ]]; then
x=$(echo /lib/modules/keys/*)
[[ "${x}" = "/lib/modules/keys/*" ]] && return 255
fi

return 0
}

@ -20,9 +28,10 @@ install() {
inst_dir /lib/modules/keys
inst_binary /usr/bin/keyctl

inst_hook initqueue/pre-trigger 01 "$moddir/load-modsign-keys.sh"
inst_hook pre-trigger 01 "$moddir/load-modsign-keys.sh"

for x in /lib/modules/keys/* ; do
[ "${x}" = "/lib/modules/keys/*" ] && break
inst_simple ${x}
[[ "${x}" = "/lib/modules/keys/*" ]] && break
inst_simple "${x}"
done
}