scripts / sign-module /
800ab27 2 years ago
1 contributor
19 lines | 0.52kb
#!/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