Skip to content

Instantly share code, notes, and snippets.

@Bryan2333
Created June 9, 2024 15:03
Show Gist options
  • Save Bryan2333/79c69ecaf8d0c7f6648fa41e08b5b447 to your computer and use it in GitHub Desktop.
Save Bryan2333/79c69ecaf8d0c7f6648fa41e08b5b447 to your computer and use it in GitHub Desktop.
给UKI签名
#!/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