]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
rootfs-handoff: Milestone C - integrate pivot_root in early /init
authorTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 03:39:26 +0000 (00:39 -0300)
committerTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 03:39:26 +0000 (00:39 -0300)
commitef509611e2be33acd353bfd3cfd91696992306f1
tree1f7dae5871b250f63ec826da6e5a9942ae9a8609
parent3960d77b08d903f55806cafd079dd5cc787fa403
rootfs-handoff: Milestone C - integrate pivot_root in early /init

- Added full pivot_root implementation to initrd_init.c
- Added mkdir_p() for recursive directory creation
- Added mount_virtual_fs() to mount virtual filesystems
- Added move_mount() to move mounts using MS_MOVE flag
- Early /init now moves /dev, /proc, /tmp to /newroot
- Performs pivot_root to make /newroot the new root
- Unmounts old root after pivot
- Executes /sbin/init from the new root
- Added MS_MOVE definition (not in ulibc)
- Fixed includes to use ulibc headers (syscall.h instead of sys/syscall.h)
- Used pivot_root() wrapper from ulibc instead of raw syscall

Test Results:
- Smoke test: 131/131 PASS
- Battery test: 157/157 PASS
- Analyzer: PASS
- Zero regressions
user/cmds/initrd_init/Makefile
user/cmds/initrd_init/initrd_init.c