HomeFreeBSD

kboot: add minmalist init functionality

Description

kboot: add minmalist init functionality

It is desirable to run kboot as the first program in some LinuxBoot
environments. This is the traditional "pid 1" or "init" program. When
running as pid 1. rovide a minimal environment based on what sysvinit,
u-root, initramfs-tools and other like projects do. We mount /dev, /sys,
/proc, make symlinks from /dev/fd to /dev/proc, and create /tmp, /run,
and /var. We also setup stdin/out/err to the console, set the tty
characteristics of same and block the appropriate signals.

This is indended as an environment that never does a fork/exec. If
that's required, the process groups, session leaders and all things
POSIX terminal handlers will need to be added.

Unlike the general purpose linux projects in this area, no attempt is
made to support very old kernels.

When not pid 1, we skip all of the above.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D36368

(cherry picked from commit 57f90cf81338ca9d1e403fdfeac16f21def72763)

Details

Provenance
impAuthored on Sep 1 2022, 5:06 PM
Differential Revision
D36368: kboot: add minmalist init functionality
Parents
rG69c6f6347c12: stand: Add lua binding loader.has_command
Branches
Unknown
Tags
Unknown