aboutsummaryrefslogtreecommitdiff
path: root/sbin/reroot_seed
Commit message (Collapse)AuthorAgeFilesLines
* init(8): extract reroot transient code into reroot_seedKonstantin Belousov2026-07-142-0/+115
Since init become dynamically linked, reroot appeared to be broken because init copies itself into a transient tmpfs mount to continue controlling execution right after the reboot(REROOT) syscall. Because the binary is dynamically linked, it cannot be properly executed. Provide a minimal static binary 'reroot_seed' embedded into the init as byte stream, which performs what the 'init -r' did, namely, the second phase reroot. For the static build of init as part of the /rescue crunch, keep the inline reroot code. Reported and tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58164