mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-11-05 04:06:38 +08:00
Merge branch 'nixos-improvements' into 'master'
Makefile: QEMU/NixOS improvements See merge request redox-os/redox!2381
This commit is contained in:
commit
94099aabf1
@ -86,7 +86,8 @@
|
||||
# with FSTOOLS_IN_PODMAN=1 these are not needed
|
||||
# without it, the installer fails to link FUSE somehow
|
||||
#fuse
|
||||
qemu_kvm
|
||||
qemu_kvm # for host arch
|
||||
qemu
|
||||
];
|
||||
|
||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
|
||||
|
||||
23
mk/qemu.mk
23
mk/qemu.mk
@ -5,6 +5,9 @@ QEMUFLAGS?=-d guest_errors -name "Redox OS $(ARCH)"
|
||||
netboot?=no
|
||||
redoxer?=no
|
||||
VGA_SUPPORTED=no
|
||||
# for qemu-relative firmware search
|
||||
QEMU_PATH?=$(shell command -v $(QEMU))
|
||||
QEMU_BASE_DIR?=$(shell if [ $(QEMU_PATH) ]; then realpath $$(dirname $(QEMU_PATH))/..; fi)
|
||||
|
||||
ifeq ($(ARCH),i586)
|
||||
audio?=ac97
|
||||
@ -39,8 +42,7 @@ else ifeq ($(ARCH),x86_64)
|
||||
ifeq ($(FIRMWARE),)
|
||||
PFLASH0=$(firstword \
|
||||
$(wildcard /usr/share/qemu/edk2-x86_64-code.fd) \
|
||||
$(wildcard /run/libvirt/nix-ovmf/edk2-x86_64-code.fd) \
|
||||
$(wildcard /opt/homebrew/opt/qemu/share/qemu/edk2s-x86_64-code.fd) \
|
||||
$(wildcard $(QEMU_BASE_DIR)/share/qemu/edk2-x86_64-code.fd) \
|
||||
)
|
||||
endif
|
||||
endif
|
||||
@ -78,9 +80,9 @@ else ifeq ($(ARCH),aarch64)
|
||||
ifeq ($(FIRMWARE),)
|
||||
PFLASH0=$(firstword \
|
||||
$(wildcard /usr/share/qemu/edk2-aarch64-code.fd) \
|
||||
$(wildcard /run/libvirt/nix-ovmf/edk2-aarch64-code.fd) \
|
||||
$(wildcard /opt/homebrew/opt/qemu/share/qemu/edk2-aarch64-code.fd) \
|
||||
$(wildcard $(QEMU_BASE_DIR)/share/qemu/edk2-aarch64-code.fd) \
|
||||
)
|
||||
PFLASH0_NEEDED=yes
|
||||
endif
|
||||
else
|
||||
FIRMWARE=$(BUILD)/qemu_uboot.rom
|
||||
@ -112,16 +114,16 @@ else ifeq ($(ARCH),riscv64gc)
|
||||
$(wildcard /usr/share/qemu-efi-riscv64/RISCV_VIRT_CODE.fd) \
|
||||
$(wildcard /usr/share/edk2/riscv/RISCV_VIRT_CODE.fd) \
|
||||
$(wildcard /usr/share/qemu/edk2-riscv-code.fd) \
|
||||
$(wildcard /run/libvirt/nix-ovmf/edk2-riscv-code.fd) \
|
||||
$(wildcard /opt/homebrew/opt/qemu/share/qemu/edk2-riscv-code.fd) \
|
||||
$(wildcard $(QEMU_BASE_DIR)/share/qemu/edk2-riscv-code.fd) \
|
||||
)
|
||||
PFLASH0_NEEDED=yes
|
||||
PFLASH1=$(firstword \
|
||||
$(wildcard /usr/share/qemu-efi-riscv64/RISCV_VIRT_VARS.fd) \
|
||||
$(wildcard /usr/share/edk2/riscv/RISCV_VIRT_VARS.fd) \
|
||||
$(wildcard /usr/share/qemu/edk2-riscv-vars.fd) \
|
||||
$(wildcard /run/libvirt/nix-ovmf/edk2-riscv-vars.fd) \
|
||||
$(wildcard /opt/homebrew/opt/qemu/share/qemu/edk2-riscv-vars.fd) \
|
||||
$(wildcard $(QEMU_BASE_DIR)/share/qemu/edk2-riscv-vars.fd) \
|
||||
)
|
||||
PFLASH1_NEEDED=yes
|
||||
ifneq ($(usb),no)
|
||||
QEMUFLAGS+=-device qemu-xhci -device usb-kbd -device usb-tablet
|
||||
endif
|
||||
@ -358,8 +360,13 @@ qemu-deps: $(BUILD)/fw_vars.bin
|
||||
.PRECIOUS: $(BUILD)/fw_vars.bin
|
||||
$(BUILD)/fw_vars.bin: $(PFLASH1)
|
||||
cp "$<" "$@"
|
||||
chmod +w "$@"
|
||||
endif
|
||||
|
||||
qemu-deps:
|
||||
$(if $(PFLASH0_NEEDED),$(if $(PFLASH0),,$(error UEFI firmware needed but not found)),)
|
||||
$(if $(PFLASH1_NEEDED),$(if $(PFLASH1),,$(error UEFI variables needed but not found)),)
|
||||
|
||||
$(EXTRA_DISK):
|
||||
truncate -s 1g $@
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user