From 5a67532500d3149d5510c6ce1e96579df5e33a51 Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Wed, 22 Jul 2026 01:13:18 -0400 Subject: [PATCH] utest: rename utest to init Signed-off-by: Michael Shaw --- init/main.c | 2 +- usr.bin/Makefile | 2 +- usr.bin/Makefile.common | 4 +++- usr.bin/{utest => init}/.gitignore | 0 usr.bin/{utest => init}/Makefile | 4 ++-- usr.bin/{utest/utest.c => init/init.c} | 0 usr.bin/{utest => init}/syscall.S | 0 7 files changed, 7 insertions(+), 5 deletions(-) rename usr.bin/{utest => init}/.gitignore (100%) rename usr.bin/{utest => init}/Makefile (63%) rename usr.bin/{utest/utest.c => init/init.c} (100%) rename usr.bin/{utest => init}/syscall.S (100%) diff --git a/init/main.c b/init/main.c index d191335..76ad5ff 100644 --- a/init/main.c +++ b/init/main.c @@ -95,7 +95,7 @@ static void kmain() apic_init(); dirent_t *init; - res = vfs_open("/bin/utest", &init); + res = vfs_open("/bin/init", &init); if (res < 0) panic("failed to open /bin/utest: %s\n", strerror(-res)); diff --git a/usr.bin/Makefile b/usr.bin/Makefile index e59e281..3aba970 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -4,7 +4,7 @@ else Q := endif -usr_dirs := utest +usr_dirs := init usr_bins := $(foreach d,$(usr_dirs),$d/$d) .PHONY: all $(usr_dirs) diff --git a/usr.bin/Makefile.common b/usr.bin/Makefile.common index 48da91c..24e6ab8 100644 --- a/usr.bin/Makefile.common +++ b/usr.bin/Makefile.common @@ -10,6 +10,8 @@ USR_CFLAGS ?= -g3 -O0 -pipe -Wall -ffreestanding -nostdlib \ USR_LDFLAGS ?= -nostdlib -static -m elf_x86_64 -z max-page-size=0x1000 +DEPS := $(UOBJ:.o=.d) + $(OUT): $(UOBJ) $(Q)echo " LD [U] $(DIR)/$@" $(Q)$(LD) $(USR_LDFLAGS) -o $@ $^ @@ -23,7 +25,7 @@ $(OUT): $(UOBJ) $(Q)$(CC) $(USR_CFLAGS) -c $< -o $@ clean: - $(Q)rm -rf $(UOBJ) $(OUT) + $(Q)rm -rf $(UOBJ) $(OUT) $(DEPS) print-%: $(Q)echo $($(*)) diff --git a/usr.bin/utest/.gitignore b/usr.bin/init/.gitignore similarity index 100% rename from usr.bin/utest/.gitignore rename to usr.bin/init/.gitignore diff --git a/usr.bin/utest/Makefile b/usr.bin/init/Makefile similarity index 63% rename from usr.bin/utest/Makefile rename to usr.bin/init/Makefile index 41fecd5..d3f6269 100644 --- a/usr.bin/utest/Makefile +++ b/usr.bin/init/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -OUT := utest -UOBJ := utest.o syscall.o +OUT := init +UOBJ := init.o syscall.o -include ../Makefile.common diff --git a/usr.bin/utest/utest.c b/usr.bin/init/init.c similarity index 100% rename from usr.bin/utest/utest.c rename to usr.bin/init/init.c diff --git a/usr.bin/utest/syscall.S b/usr.bin/init/syscall.S similarity index 100% rename from usr.bin/utest/syscall.S rename to usr.bin/init/syscall.S