Files
Konstantin Belousov 4c9f648852 init(8): extract reroot transient code into reroot_seed
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
2026-07-14 18:43:45 +03:00
..
…