#!/bin/zsh # bash compatible declare -A mod mod[nv]=nvidia-current mod[vbox]=vboxdrv mod[default]="${mod[nv]} ${mod[vbox]}" test -n "$1" && test -z ${mod[$1]} && mod[$1]=${mod[default]} for c in ${mod[${1:-default}]}; do for modfile in $(dirname $(modinfo -n $c))/*.ko; do sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file \ sha256 \ /root/module-signing/MOK.priv \ /root/module-signing/MOK.der \ "$modfile" echo ${modfile##*/} done done