From 1bec079aff67f6b1f2c23a29634eeb5bfec58743 Mon Sep 17 00:00:00 2001 From: Joel Granados Date: Mon, 18 Aug 2025 11:12:22 +0200 Subject: [PATCH 1/2] nix: Adjust Makefile to ignore all as a file Signed-off-by: Joel Granados --- contrib/nix/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/nix/Makefile b/contrib/nix/Makefile index b71cf1f..ad8c65f 100644 --- a/contrib/nix/Makefile +++ b/contrib/nix/Makefile @@ -1,4 +1,4 @@ -CC := $(shell command -v musl-clang 2>/dev/null || echo gcc) +CC := $(shell command -v musl-clang 2> /dev/null || echo gcc) CFLAGS := -Os -static -ffunction-sections -fdata-sections LDFLAGS := -Wl,--gc-sections BUILDDIR ?= . @@ -6,10 +6,9 @@ SRC := vmctl_init.c OUT := $(BUILDDIR)/init IMG := $(BUILDDIR)/init.img -.PHONY: clean +.PHONY: clean all $(OUT): $(SRC) - @echo "Compiler: $(CC)" $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(IMG): $(OUT) @@ -19,3 +18,6 @@ all: $(IMG) clean: rm -f $(OUT) $(IMG) + +print-%: + @echo $* = $($*) From 50c77edf9dbb0d714b617bbea743540d5dc94bf2 Mon Sep 17 00:00:00 2001 From: Joel Granados Date: Mon, 1 Sep 2025 14:54:16 +0200 Subject: [PATCH 2/2] lib/qemu/nix: always force copy nix Makefile and nix vmctl_initlc Always replace these files to their updated versions. Avoid potentially broken symbolic links. Signed-off-by: Joel Granados --- lib/qemu/nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/qemu/nix b/lib/qemu/nix index 0bddfeb..e98914e 100644 --- a/lib/qemu/nix +++ b/lib/qemu/nix @@ -35,14 +35,10 @@ _qemu_nix_create_nix_init () { _require_program "$(command -v musl-clang 2> /dev/null || echo gcc)" local make_path="${state_dir}/Makefile" - if [[ ! -f ${make_path} ]]; then - _add_pre_cmd "ln -s \"${BASEDIR}/contrib/nix/Makefile\" \"${make_path}\"" - fi + _add_pre_cmd "cp -f \"${BASEDIR}/contrib/nix/Makefile\" \"${make_path}\"" local c_init_path="${state_dir}/vmctl_init.c" - if [[ ! -f ${c_init_path} ]]; then - _add_pre_cmd "ln -s \"${BASEDIR}/contrib/nix/vmctl_init.c\" \"${c_init_path}\"" - fi + _add_pre_cmd "cp -f \"${BASEDIR}/contrib/nix/vmctl_init.c\" \"${c_init_path}\"" if [[ ${NIX_INIT_REBUILD} == "yes" ]]; then _add_pre_cmd "make -C \"${state_dir}\" clean"