7 Commits

Author SHA1 Message Date
INAGAKI Hiroshi
49ea930a86 utils: add key-value offset support to get_cmdline_val()
Add offset support of key-value pairs to get_cmdline_val() for getting
multiple values of the same keys.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2024-03-25 10:28:50 +01:00
Mathew McBride
2cfc26f845 inittab: detect active console from kernel if no console= specified
The default serial console can be set in the device tree
using the linux,stdout-path parameter (or equivalent from ACPI).

This is important for universal booting (EFI/EBBR) on ARM platforms
where the default console can be different (e.g ttyS0 vs ttyAMA0).

Signed-off-by: Mathew McBride <matt@traverse.com.au>
2021-03-07 23:46:27 +00:00
Daniel Golle
945d0d79cb utils: fix C style in header file
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-03-07 23:45:33 +00:00
Jo-Philipp Wich
9f3b9ddf1a utils: add patch_fd() and patch_stdio() helpers
Introduce two new helper functions to deal with stdio redirecation in a
uniform, reliable manner:

The patch_fd() function will attempt to redirect the given fd number to the
specified file, using the supplied flags for the open() syscall. When the
device is NULL, "/dev/null" is asumed, when the device is a relative path,
openat() is used to open it relative to the "/dev" directory. When the device
cannot be openend, a fallback to "/dev/null" is attempted.

The patch_stdio() function is essentially a wrapper around patch_fd(),
providing an easy interface to redirect stdin, stdout and stderr to the same
given device.

Both function return 0 on success and -1 on error. The errno variable will
be set accordingly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-05-16 20:59:59 +02:00
Steven Barth
f83a9e2f67 Fix regression in command line parsing
79872ea6 reduced the command line buffer breaking various platforms.

Signed-off-by: Steven Barth <steven@midlink.org>
2014-10-31 13:05:47 +01:00
Michel Stam
79872ea6ca Use one generic routine to access /proc/cmdline
Signed-off-by: Michel Stam <m.stam@fugro.nl>
2014-10-12 13:24:11 +02:00
John Crispin
916f95cb58 debloat and reorganize code
split app into procd and init binaries
remove log support, this is an external service now

Signed-off-by: John Crispin <blogic@openwrt.org>
2013-11-15 17:05:20 +01:00