diff --git a/sbin/grub-sign b/sbin/grub-sign index c8757ef..368e4ad 100755 --- a/sbin/grub-sign +++ b/sbin/grub-sign @@ -5,7 +5,7 @@ # Licence: GNU-GPLv3 function sign(){ - for f in `find /boot -type f` + for f in $(find /boot -iname "efi" -prune -o -type f -print) do if gpg --detach-sign $f then diff --git a/sbin/grub-unsign b/sbin/grub-unsign index b0a5e00..e6934c2 100755 --- a/sbin/grub-unsign +++ b/sbin/grub-unsign @@ -21,7 +21,7 @@ case "$stat" in ;& 0|3) # Then remove the signatures. - find /boot -name '*.sig' -exec rm {} + + find /boot -iname "efi" -prune -o -name '*.sig' -exec rm {} + echo "GRUB2 unsigned. WARNING: If you want to deactivate GRUB2's signature feature, change the check_signatures variable in the headers file!" exit 0 diff --git a/sbin/grub-verify b/sbin/grub-verify index 0eb006c..9a2fc07 100755 --- a/sbin/grub-verify +++ b/sbin/grub-verify @@ -22,7 +22,7 @@ do error_files+=( "$i" ) fi all_files+=( "$i" ) -done < <(find /boot -type f -name "*.sig" -print0) +done < <(find /boot -iname "efi" -prune -o -type f -name "*.sig" -print0) echo "Checking missing signatures in /boot..." >&2 while IFS= read -r -d '' i @@ -31,7 +31,7 @@ do then missing_files+=( "$i" ) fi -done < <(find /boot -type f -not -name "*.sig" -print0) +done < <(find /boot -iname "efi" -prune -o -type f -not -name "*.sig" -print0) # Nothing to verify? Exit 2. if (( ${#all_files[@]} == 0 ))