Documentation
¶
Overview ¶
Package libinit creates the environment and root file system for u-root.
Index ¶
- func Command(bin string, m ...CommandModifier) *exec.Cmd
- func CreateRootfs()
- func InstallAllModules()
- func InstallModules(pattern string, exclude map[string]bool) error
- func NetInit()
- func RunCommands(debug func(string, ...interface{}), commands ...*exec.Cmd) int
- func SetEnv()
- func WaitOrphans() uint
- type CommandModifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
func Command(bin string, m ...CommandModifier) *exec.Cmd
Command constructs an *exec.Cmd object.
func InstallAllModules ¶
func InstallAllModules()
InstallAllModules installs kernel modules (.ko files) from /lib/modules. Useful for modules that need to be loaded for boot (ie a network driver needed for netboot). It skips over blacklisted modules in excludedMods.
func InstallModules ¶
InstallModules installs kernel modules (.ko files) from /lib/modules that match the given pattern, skipping those in the exclude list.
func RunCommands ¶
FIX ME: make it not linux-specific RunCommands runs commands in sequence.
RunCommands returns how many commands existed and were attempted to run.
commands must refer to absolute paths at the moment.
func WaitOrphans ¶
func WaitOrphans() uint
WaitOrphans waits for all remaining processes on the system to exit.
Types ¶
type CommandModifier ¶
CommandModifier makes *exec.Cmd construction modular.
func WithArguments ¶
func WithArguments(arg ...string) CommandModifier
WithArguments adds command-line arguments to a command.
func WithCloneFlags ¶
func WithCloneFlags(flags uintptr) CommandModifier
WithCloneFlags adds clone(2) flags to the *exec.Cmd.
func WithTTYControl ¶
func WithTTYControl(ctty bool) CommandModifier
WithTTYControl turns on controlling the TTY on this command.