From: Tulio A M Mendes Date: Thu, 11 Jun 2026 02:51:53 +0000 (-0300) Subject: uid: add /etc/passwd to initrd for UID infrastructure X-Git-Url: https://projects.tadryanom.me/?a=commitdiff_plain;h=33e3d51617600281b8383198b2b923a547cf70c2;p=AdrOS.git uid: add /etc/passwd to initrd for UID infrastructure Implement UID Infrastructure: parser /etc/passwd (completed). Added /etc/passwd file with basic entries (root, daemon, nobody). Updated Makefile to include /etc/passwd in initrd. Existing pwd_grp.c already implements getpwnam/getpwuid/setpwent/endpwent/getpwent with /etc/passwd parsing and static fallback. Test: make test-battery PASS (157/157) --- diff --git a/Makefile b/Makefile index 7980ce84..1e360af2 100644 --- a/Makefile +++ b/Makefile @@ -264,14 +264,15 @@ USER_BIN_NAMES := $(filter-out init,$(USER_CMD_NAMES)) # Build INITRD_FILES list: : FSTAB := rootfs/etc/fstab RCS := rootfs/etc/init.d/rcS +PASSWD := rootfs/etc/passwd INITRD_FILES := $(FULLTEST_ELF):sbin/fulltest \ $(USER_BUILD)/cmds/init/init.elf:sbin/init \ $(foreach cmd,$(USER_BIN_NAMES),$(USER_BUILD)/cmds/$(cmd)/$(cmd).elf:bin/$(cmd)) \ $(LDSO_ELF):lib/ld.so $(ULIBC_SO):lib/libc.so \ $(PIE_SO):lib/libpietest.so $(PIE_ELF):bin/pie_test \ - $(FSTAB):etc/fstab $(RCS):etc/init.d/rcS + $(FSTAB):etc/fstab $(RCS):etc/init.d/rcS $(PASSWD):etc/passwd -INITRD_DEPS := $(MKINITRD) $(FULLTEST_ELF) $(USER_CMD_ELFS) $(LDSO_ELF) $(ULIBC_SO) $(PIE_SO) $(PIE_ELF) $(FSTAB) $(RCS) +INITRD_DEPS := $(MKINITRD) $(FULLTEST_ELF) $(USER_CMD_ELFS) $(LDSO_ELF) $(ULIBC_SO) $(PIE_SO) $(PIE_ELF) $(FSTAB) $(RCS) $(PASSWD) # doom (build via 'make doom', included in initrd if present) doom: $(DOOM_SENTINEL) $(ULIBC_LIB) $(ULIBC_SO) diff --git a/rootfs/etc/passwd b/rootfs/etc/passwd new file mode 100644 index 00000000..f045604b --- /dev/null +++ b/rootfs/etc/passwd @@ -0,0 +1,3 @@ +root:x:0:0:root:/root:/bin/sh +daemon:x:1:1:daemon:/usr/sbin:/bin/sh +nobody:x:65534:65534:nobody:/nonexistent:/bin/sh