diff options
author | Bobby Rong <rjl931189261@126.com> | 2021-12-17 14:51:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-17 14:51:47 +0800 |
commit | c4b3a22202972ef77e280705591c112c2448645f (patch) | |
tree | 6d578e63e27c8fa2af555a9a36667cc73a925728 /pkgs | |
parent | 096700463d8916414b2a238de3bd580c536fba1f (diff) | |
parent | 1ea561212a9269f61de8564bcf2db1f7f72d4b0e (diff) |
Merge pull request #149409 from 0x4A6F/master-quickemu
quickemu: 2.2.7 -> 3.11
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/quickemu/default.nix | 29 | ||||
-rw-r--r-- | pkgs/development/quickemu/efi_vars_ensure_writable.patch | 13 | ||||
-rw-r--r-- | pkgs/development/quickemu/input_overrides.patch | 28 |
3 files changed, 62 insertions, 8 deletions
diff --git a/pkgs/development/quickemu/default.nix b/pkgs/development/quickemu/default.nix index f7807a9d1c9ae..aa9906c77ecd3 100644 --- a/pkgs/development/quickemu/default.nix +++ b/pkgs/development/quickemu/default.nix @@ -17,6 +17,9 @@ , xdg-user-dirs , xrandr , zsync +, OVMF +, quickemu +, testVersion }: let runtimePaths = [ @@ -40,15 +43,20 @@ in stdenv.mkDerivation rec { pname = "quickemu"; - version = "2.2.7"; + version = "3.11"; src = fetchFromGitHub { - owner = "wimpysworld"; - repo = pname; + owner = "quickemu-project"; + repo = "quickemu"; rev = version; - sha256 = "sha256-TNG1pCePsi12QQafhayhj+V5EXq+v7qmaW5v5X8ER6s="; + sha256 = "1xwf9vwbr57wmyxfcqzl1jnmfx3ffh7sfqf0zcdq41wqkm8s106n"; }; + patches = [ + ./efi_vars_ensure_writable.patch + ./input_overrides.patch + ]; + nativeBuildInputs = [ makeWrapper ]; installPhase = '' @@ -56,16 +64,21 @@ stdenv.mkDerivation rec { install -Dm755 -t "$out/bin" quickemu quickget macrecovery - for f in quickget macrecovery quickemu; do - wrapProgram $out/bin/$f --prefix PATH : "${lib.makeBinPath runtimePaths}" - done + for f in quickget macrecovery quickemu; do + wrapProgram $out/bin/$f \ + --prefix PATH : "${lib.makeBinPath runtimePaths}" \ + --set ENV_EFI_CODE "${OVMF.fd}/FV/OVMF_CODE.fd" \ + --set ENV_EFI_VARS "${OVMF.fd}/FV/OVMF_VARS.fd" + done runHook postInstall ''; + passthru.tests = testVersion { package = quickemu; }; + meta = with lib; { description = "Quickly create and run optimised Windows, macOS and Linux desktop virtual machines"; - homepage = "https://github.com/wimpysworld/quickemu"; + homepage = "https://github.com/quickemu-project/quickemu"; license = licenses.mit; maintainers = with maintainers; [ fedx-sudo ]; }; diff --git a/pkgs/development/quickemu/efi_vars_ensure_writable.patch b/pkgs/development/quickemu/efi_vars_ensure_writable.patch new file mode 100644 index 0000000000000..e146d0ba76822 --- /dev/null +++ b/pkgs/development/quickemu/efi_vars_ensure_writable.patch @@ -0,0 +1,13 @@ +diff --git a/quickemu b/quickemu +index a9a60a5..1a932ac 100755 +--- a/quickemu ++++ b/quickemu +@@ -197,7 +197,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 diff --git a/pkgs/development/quickemu/input_overrides.patch b/pkgs/development/quickemu/input_overrides.patch new file mode 100644 index 0000000000000..228624edcf1bf --- /dev/null +++ b/pkgs/development/quickemu/input_overrides.patch @@ -0,0 +1,28 @@ +diff --git a/quickemu b/quickemu +index 1a932ac..ab2f752 100755 +--- a/quickemu ++++ b/quickemu +@@ -383,7 +383,10 @@ function vm_boot() { + # https://bugzilla.redhat.com/show_bug.cgi?id=1929357#c5 + case ${secureboot} in + on) +- 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 ++ 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 +@@ -402,7 +405,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 |