From f0bdceca80766f94fd7d5631641ae6f1f5e5f626 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Sun, 22 Nov 2026 17:43:33 +0800 Subject: [PATCH 1/4] fix module export for FAT metadata cursor --- kernel/reliefnt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/reliefnt b/kernel/reliefnt index 1a02e706..29cabdf3 160000 --- a/kernel/reliefnt +++ b/kernel/reliefnt @@ -1 +1 @@ -Subproject commit 1a02e706bea0e2209f2432e00291b02abc253f17 +Subproject commit 29cabdf315297ae57631d82df79ee978d8f8afff From 309274c73f99b262a6b74d55b825738a976452f2 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Sun, 22 Nov 2026 19:58:14 +0800 Subject: [PATCH 2/4] fix QEMU user network argument parsing --- scripts/reliefos/Makefile.run | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/reliefos/Makefile.run b/scripts/reliefos/Makefile.run index 9547f6e2..eba15abf 100644 --- a/scripts/reliefos/Makefile.run +++ b/scripts/reliefos/Makefile.run @@ -44,7 +44,8 @@ QEMU_MEMORY := $(or $(MEMORY),$(CONFIG_QEMU_MEMORY_MB),4096) QEMU_CPUS := $(or $(CPUS),$(CONFIG_QEMU_SMP_CPUS),4) comma := , QEMU_NETWORK := $(subst ",,$(CONFIG_QEMU_NET_DEVICE)) -QEMU_FLAGS := -machine $(if $(filter 1 y yes true,$(RELIEFOS_QEMU_IDE)),pc,q35) $(if $(filter 1,$(QEMU_KVM)),-enable-kvm -cpu host,-cpu max) -m $(QEMU_MEMORY) -smp $(QEMU_CPUS) $(QEMU_FIRMWARE_FLAGS) -display $(QEMU_DISPLAY) -serial $(QEMU_SERIAL) $(QEMU_GPU_FLAGS) $(if $(QEMU_NETWORK),-netdev user,id=net0 -device $(QEMU_NETWORK)$(comma)netdev=net0) -audiodev $(QEMU_AUDIO),id=snd0 $(QEMU_SOUND_FLAGS) +QEMU_NETWORK_FLAGS := $(if $(QEMU_NETWORK),-netdev user$(comma)id=net0 -device $(QEMU_NETWORK)$(comma)netdev=net0) +QEMU_FLAGS := -machine $(if $(filter 1 y yes true,$(RELIEFOS_QEMU_IDE)),pc,q35) $(if $(filter 1,$(QEMU_KVM)),-enable-kvm -cpu host,-cpu max) -m $(QEMU_MEMORY) -smp $(QEMU_CPUS) $(QEMU_FIRMWARE_FLAGS) -display $(QEMU_DISPLAY) -serial $(QEMU_SERIAL) $(QEMU_GPU_FLAGS) $(QEMU_NETWORK_FLAGS) -audiodev $(QEMU_AUDIO),id=snd0 $(QEMU_SOUND_FLAGS) QEMU_DISK := -drive file=$(DISK_VMDK),if=none,id=disk0,format=vmdk ifneq ($(filter 1 y yes true,$(RELIEFOS_QEMU_NVME)),) QEMU_DISK += -device nvme,drive=disk0,serial=leonosnvme From 2b2977a970c85a3ddf982448208f3eaf999efbcb Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Mon, 23 Nov 2026 21:38:33 +0800 Subject: [PATCH 3/4] build: add QEMU run-only targets and disk options --- Makefile | 5 ++++- scripts/help.sh | 7 +++++++ scripts/reliefos/Makefile.run | 39 +++++++++++++++++++++++++++++++++-- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3b42ffda..e08bc551 100644 --- a/Makefile +++ b/Makefile @@ -240,6 +240,7 @@ gettext gettext-check: $(RELIEFOS_O_MARKER) $(RELIEFOS_DOCS_I18N_INPUTS) sh $(RELIEFOS_SRC)/scripts/docs-python.sh $(RELIEFOS_SRC)/scripts/update-doc-translations.py \ --output $(O)/Documentation/gettext $(if $(filter gettext-check,$@),--check) +reliefos_run_only_goals := run-only run-installer-only run-iso-only reliefos_goals := $(filter-out help doctor clean distclean htmldocs gettext gettext-check,$(MAKECMDGOALS)) reliefos_kbuild_goals := $(patsubst $(reliefos_O_absolute)/%,%,$(patsubst $(O)/%,%,$(reliefos_goals))) ifneq ($(strip $(reliefos_goals)),) @@ -249,7 +250,7 @@ endif # Inspection never creates O. Configuration-independent goals may inspect an # existing host-only tree without creating a .config as a side effect. -reliefos_config_free_goals := tools fetch fetch-check reliefnt-fetch ntclks-fetch reliefnt-fetch-check ntclks-fetch-check headers_install defconfig olddefconfig menuconfig kernel-menuconfig kernel-olddefconfig kernel-allmodconfig migrate-config regen-component-kconfig +reliefos_config_free_goals := tools fetch fetch-check reliefnt-fetch ntclks-fetch reliefnt-fetch-check ntclks-fetch-check headers_install defconfig olddefconfig menuconfig kernel-menuconfig kernel-olddefconfig kernel-allmodconfig migrate-config regen-component-kconfig $(reliefos_run_only_goals) ifneq ($(strip $(reliefos_lock_skip)),) ifneq ($(strip $(reliefos_goals)),) ifeq ($(wildcard $(reliefos_O_absolute)),) @@ -291,6 +292,7 @@ reliefos_hostcc_fingerprint = $(shell sh $(RELIEFOS_SRC)/scripts/reliefos/hostcc reliefos_native_hostcc = env RELIEFOS_HOST_COMPILER_ID=$(reliefos_hostcc_fingerprint) $(reliefos_hostcc_command) __kbuild: +ifneq ($(strip $(filter-out $(reliefos_run_only_goals),$(reliefos_kbuild_goals))),) $(Q)mkdir -p '$(reliefos_O_absolute)' $(Q)test -f '$(RELIEFOS_O_MARKER)' || printf 'reliefos-build-out version=1 root=%s\n' '$(RELIEFOS_SRC)' > '$(RELIEFOS_O_MARKER)' +$(Q)CONFIG_SHELL=/bin/sh AWK=awk srctree='$(RELIEFOS_SRC)' objtree=. VPATH='$(RELIEFOS_SRC)' \ @@ -298,6 +300,7 @@ __kbuild: -f '$(RELIEFOS_SRC)/scripts/Makefile.port' -f '$(RELIEFOS_SRC)/scripts/Makefile.build' \ obj=scripts/basic KBUILD_HOSTCFLAGS='-O2 -I$(RELIEFOS_SRC)/scripts/include' \ HOSTCC='$(reliefos_native_hostcc)' +endif +$(Q)CONFIG_SHELL=/bin/sh AWK=awk srctree='$(RELIEFOS_SRC)' objtree=. VPATH='$(RELIEFOS_SRC)' \ RELIEFOS_SRC='$(RELIEFOS_SRC)' ARCH='$(ARCH)' PROFILE='$(PROFILE)' \ SOURCE_DATE_EPOCH='$(SOURCE_DATE_EPOCH)' TOOLCHAIN='$(TOOLCHAIN)' \ diff --git a/scripts/help.sh b/scripts/help.sh index f36b107b..d038b0c5 100755 --- a/scripts/help.sh +++ b/scripts/help.sh @@ -47,6 +47,9 @@ ReliefOS build system (Linux Kbuild / Kconfig) make run boot the VMDK in QEMU (no root required) make run-iso boot the live ISO in QEMU make run-installer boot the installer ISO in QEMU + make run-only boot the existing VMDK without rebuilding + make run-iso-only boot the existing live ISO without rebuilding + make run-installer-only boot the existing installer ISO without rebuilding make test-tools C host tool tests, plain and under ASan/UBSan make test-build shell contract tests for the build surface @@ -72,6 +75,10 @@ Variables V=1 echo the real command, its working directory and overrides QEMU_BOOT=uefi|bios run firmware, default uefi QEMU_FIRMWARE=FILE OVMF firmware for uefi; unused for bios + QEMU_INSTALLER_DISK=FILE attach an optional target disk to installer QEMU (qcow2 by default) + QEMU_INSTALLER_DISK_FORMAT=FORMAT qcow2, raw or vmdk disk image format + QEMU_RUN_DISK=FILE select a disk image for run-only (qcow2 by default; relative to repo root) + QEMU_RUN_DISK_FORMAT=FORMAT qcow2, raw or vmdk disk image format CPUS=n override Kconfig guest CPU count MEMORY=4G guest memory for the run targets TOOLCHAIN=FILE toolchain description, default configs/toolchains/llvm-x86_64.mk diff --git a/scripts/reliefos/Makefile.run b/scripts/reliefos/Makefile.run index eba15abf..0ca54728 100644 --- a/scripts/reliefos/Makefile.run +++ b/scripts/reliefos/Makefile.run @@ -43,8 +43,15 @@ RELIEFOS_QEMU_NVME ?= $(LEONOS_QEMU_NVME) QEMU_MEMORY := $(or $(MEMORY),$(CONFIG_QEMU_MEMORY_MB),4096) QEMU_CPUS := $(or $(CPUS),$(CONFIG_QEMU_SMP_CPUS),4) comma := , +QEMU_INSTALLER_DISK ?= +QEMU_INSTALLER_DISK_FORMAT ?= qcow2 QEMU_NETWORK := $(subst ",,$(CONFIG_QEMU_NET_DEVICE)) QEMU_NETWORK_FLAGS := $(if $(QEMU_NETWORK),-netdev user$(comma)id=net0 -device $(QEMU_NETWORK)$(comma)netdev=net0) +ifneq ($(strip $(QEMU_INSTALLER_DISK)),) +QEMU_INSTALLER_DISK_PATH := $(if $(filter /%,$(QEMU_INSTALLER_DISK)),$(QEMU_INSTALLER_DISK),$(RELIEFOS_SRC)/$(QEMU_INSTALLER_DISK)) +QEMU_INSTALLER_DISK_CHECK := test -f '$(QEMU_INSTALLER_DISK_PATH)' || { echo 'missing installer target disk: $(QEMU_INSTALLER_DISK_PATH)' >&2; exit 1; } +QEMU_INSTALLER_DISK_FLAGS := -drive file=$(QEMU_INSTALLER_DISK_PATH)$(comma)if=none$(comma)id=installer-disk$(comma)format=$(QEMU_INSTALLER_DISK_FORMAT) -device ich9-ahci$(comma)id=installer-ahci -device ide-hd$(comma)drive=installer-disk$(comma)bus=installer-ahci.0 +endif QEMU_FLAGS := -machine $(if $(filter 1 y yes true,$(RELIEFOS_QEMU_IDE)),pc,q35) $(if $(filter 1,$(QEMU_KVM)),-enable-kvm -cpu host,-cpu max) -m $(QEMU_MEMORY) -smp $(QEMU_CPUS) $(QEMU_FIRMWARE_FLAGS) -display $(QEMU_DISPLAY) -serial $(QEMU_SERIAL) $(QEMU_GPU_FLAGS) $(QEMU_NETWORK_FLAGS) -audiodev $(QEMU_AUDIO),id=snd0 $(QEMU_SOUND_FLAGS) QEMU_DISK := -drive file=$(DISK_VMDK),if=none,id=disk0,format=vmdk ifneq ($(filter 1 y yes true,$(RELIEFOS_QEMU_NVME)),) @@ -54,7 +61,17 @@ QEMU_DISK += -device piix3-ide,id=ide -device ide-hd,drive=disk0,bus=ide.0,unit= else QEMU_DISK += -device ich9-ahci,id=ahci -device ide-hd,drive=disk0,bus=ahci.0 endif -.PHONY: run run-debug run-iso run-installer +QEMU_RUN_DISK ?= +QEMU_RUN_DISK_FORMAT ?= qcow2 +ifneq ($(strip $(QEMU_RUN_DISK)),) +QEMU_RUN_DISK_PATH := $(if $(filter /%,$(QEMU_RUN_DISK)),$(QEMU_RUN_DISK),$(RELIEFOS_SRC)/$(QEMU_RUN_DISK)) +QEMU_RUN_DISK_CHECK := test -f '$(QEMU_RUN_DISK_PATH)' || { echo 'missing run disk: $(QEMU_RUN_DISK_PATH)' >&2; exit 1; } +QEMU_RUN_DISK_FLAGS := -drive file=$(QEMU_RUN_DISK_PATH)$(comma)if=none$(comma)id=run-disk$(comma)format=$(QEMU_RUN_DISK_FORMAT) -device ich9-ahci$(comma)id=run-ahci -device ide-hd$(comma)drive=run-disk$(comma)bus=run-ahci.0 +else +QEMU_RUN_DISK_CHECK := test -f '$(DISK_VMDK)' || { echo 'missing disk image: $(DISK_VMDK)' >&2; exit 1; } +QEMU_RUN_DISK_FLAGS := $(QEMU_DISK) +endif +.PHONY: run run-debug run-iso run-installer run-only run-installer-only run-iso-only run run-debug: image-vmdk $(Q)test '$(QEMU_BOOT)' = bios || test -f '$(QEMU_FIRMWARE)' || { echo 'set QEMU_FIRMWARE to an OVMF firmware image' >&2; exit 1; } $(Q)$(QEMU) $(QEMU_FLAGS) $(QEMU_DISK) $(if $(filter run-debug,$@),-no-reboot -no-shutdown) @@ -63,4 +80,22 @@ run-iso: iso $(Q)$(QEMU) $(QEMU_FLAGS) -cdrom $(LIVE_ISO) -no-reboot -no-shutdown run-installer: installer $(Q)test '$(QEMU_BOOT)' = bios || test -f '$(QEMU_FIRMWARE)' - $(Q)$(QEMU) $(QEMU_FLAGS) -cdrom $(INSTALLER_ISO) -no-reboot -no-shutdown + $(Q)$(QEMU) $(QEMU_FLAGS) $(QEMU_INSTALLER_DISK_FLAGS) -cdrom $(INSTALLER_ISO) -no-reboot -no-shutdown + +# These entry points consume existing images only; they deliberately have no +# image-vmdk/iso/installer prerequisites. +run-only: + $(Q)$(QEMU_RUN_DISK_CHECK) + $(Q)test '$(QEMU_BOOT)' = bios || test -f '$(QEMU_FIRMWARE)' || { echo 'set QEMU_FIRMWARE to an OVMF firmware image' >&2; exit 1; } + $(Q)$(QEMU) $(QEMU_FLAGS) $(QEMU_RUN_DISK_FLAGS) + +run-iso-only: + $(Q)test -f '$(LIVE_ISO)' || { echo 'missing live ISO: $(LIVE_ISO)' >&2; exit 1; } + $(Q)test '$(QEMU_BOOT)' = bios || test -f '$(QEMU_FIRMWARE)' || { echo 'set QEMU_FIRMWARE to an OVMF firmware image' >&2; exit 1; } + $(Q)$(QEMU) $(QEMU_FLAGS) -cdrom $(LIVE_ISO) -no-reboot -no-shutdown + +run-installer-only: + $(Q)test -f '$(INSTALLER_ISO)' || { echo 'missing installer ISO: $(INSTALLER_ISO)' >&2; exit 1; } + $(Q)$(QEMU_INSTALLER_DISK_CHECK) + $(Q)test '$(QEMU_BOOT)' = bios || test -f '$(QEMU_FIRMWARE)' || { echo 'set QEMU_FIRMWARE to an OVMF firmware image' >&2; exit 1; } + $(Q)$(QEMU) $(QEMU_FLAGS) $(QEMU_INSTALLER_DISK_FLAGS) -cdrom $(INSTALLER_ISO) -no-reboot -no-shutdown From b2b22f472f2ec466645d5af80dcb5845c5ae97ed Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Mon, 23 Nov 2026 21:57:51 +0800 Subject: [PATCH 4/4] chore: update ReliefNT gitlink after PR 40 --- kernel/reliefnt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/reliefnt b/kernel/reliefnt index cde8f40e..8cf925a2 160000 --- a/kernel/reliefnt +++ b/kernel/reliefnt @@ -1 +1 @@ -Subproject commit cde8f40e0303bece5723e575c1892fe8bf8e02bf +Subproject commit 8cf925a2c1bd1ed4279c1223a253ab1569dbaf68