nixpkgs/pkgs/development/quickemu/input_overrides.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
1.7 KiB
Diff
Raw Normal View History

diff --git a/quickemu b/quickemu
2022-03-18 12:57:28 +00:00
index 24e1007..39cd5e4 100755
--- a/quickemu
+++ b/quickemu
2022-03-18 12:57:28 +00:00
@@ -196,7 +196,7 @@ function efi_vars() {
if [ ! -e "${VARS_OUT}" ]; then
if [ -e "${VARS_IN}" ]; then
- cp "${VARS_IN}" "${VARS_OUT}"
+ cp "${VARS_IN}" "${VARS_OUT}" && chmod +w "${VARS_OUT}"
else
echo "ERROR! ${VARS_IN} was not found. Please install edk2."
exit 1
@@ -383,7 +383,10 @@ function vm_boot() {
# https://bugzilla.redhat.com/show_bug.cgi?id=1929357#c5
case ${secureboot} in
on)
2022-03-18 12:57:28 +00:00
- if [ -e "/usr/share/OVMF/OVMF_CODE_4M.secboot.fd" ]; then
+ if [[ ${ENV_EFI_CODE_SECURE} && ${ENV_EFI_CODE_SECURE-x} ]] && [[ ${ENV_EFI_VARS_SECURE} && ${ENV_EFI_VARS_SECURE-x} ]]; then
2022-03-18 12:57:28 +00:00
+ EFI_CODE="${ENV_EFI_CODE_SECURE}"
+ efi_vars "${ENV_EFI_VARS_SECURE}" "${EFI_VARS}"
+ elif [ -e "/usr/share/OVMF/OVMF_CODE_4M.secboot.fd" ]; then
EFI_CODE="/usr/share/OVMF/OVMF_CODE_4M.secboot.fd"
efi_vars "/usr/share/OVMF/OVMF_VARS_4M.fd" "${EFI_VARS}"
elif [ -e "/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd" ]; then
2022-03-18 12:57:28 +00:00
@@ -408,7 +411,10 @@ function vm_boot() {
fi
;;
*)
- if [ -e "/usr/share/OVMF/OVMF_CODE_4M.fd" ]; then
+ if [[ ${ENV_EFI_CODE} && ${ENV_EFI_CODE-x} ]] && [[ ${ENV_EFI_VARS} && ${ENV_EFI_VARS-x} ]]; then
+ EFI_CODE="${ENV_EFI_CODE}"
+ efi_vars "${ENV_EFI_VARS}" "${EFI_VARS}"
+ elif [ -e "/usr/share/OVMF/OVMF_CODE_4M.fd" ]; then
EFI_CODE="/usr/share/OVMF/OVMF_CODE_4M.fd"
efi_vars "/usr/share/OVMF/OVMF_VARS_4M.fd" "${EFI_VARS}"
elif [ -e "/usr/share/edk2/ovmf/OVMF_CODE.fd" ]; then