mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
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
21 lines
393 B
Makefile
21 lines
393 B
Makefile
CONFGROUPS= CONFTTYS
|
|
PACKAGE=runtime
|
|
PROG= init
|
|
MAN= init.8
|
|
SRCS= init.c
|
|
PRECIOUSPROG=
|
|
INSTALLFLAGS=-b -B.bak
|
|
CFLAGS.init.c+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT
|
|
.ifdef RESCUE
|
|
CFLAGS.init.c+=-DRESCUE
|
|
.else
|
|
SRCS+= reroot_seed.embed.s
|
|
ACFLAGS.reroot_seed.embed.s+=-I${OBJTOP}/sbin/reroot_seed
|
|
.endif
|
|
LIBADD= util crypt
|
|
|
|
CONFTTYSNAME= ttys
|
|
CONFTTYS+= ttys
|
|
|
|
.include <bsd.prog.mk>
|