Created
June 9, 2024 15:03
-
-
Save Bryan2333/79c69ecaf8d0c7f6648fa41e08b5b447 to your computer and use it in GitHub Desktop.
给UKI签名
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
set uki "$argv[3]" | |
if test -z "$uki" | |
exit 0 | |
end | |
set keypairs "/root/.secureboot/MOK.key" "/root/.secureboot/MOK.crt" | |
set i 1 | |
while test $i -le (count $keypairs) | |
set key $keypairs[$i] | |
set cert $keypairs[(math $i + 1)] | |
if ! sbverify --cert "$cert" "$uki" &>/dev/null | |
sbsign --key "$key" --cert "$cert" --output "$uki" "$uki" | |
end | |
set i (math $i + 2) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment