aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/earlyinit
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/earlyinit')
-rw-r--r--cmd/earlyinit/main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/earlyinit/main.go b/cmd/earlyinit/main.go
index 62f87833..b1f49b90 100644
--- a/cmd/earlyinit/main.go
+++ b/cmd/earlyinit/main.go
@@ -96,6 +96,8 @@ const (
flagTrivial = "trivial"
// flagNoRecover sets [report.DNoRecover] on r.
flagNoRecover = "no_recover"
+ // flagKmsg arranges for /dev/kmsg to always replace standard streams.
+ flagKmsg = "kmsg"
// flagNoRemount arranges for / to remain writable.
flagNoRemount = "no_remount"
// flagMountTmp arranges for /tmp/ to be made available.
@@ -187,7 +189,7 @@ func main() {
// of output being visible to the user.
if fi, err := os.Stdout.Stat(); err == nil {
if stat, ok := fi.Sys().(*Stat_t); ok {
- if stat.Rdev == 0x103 {
+ if stat.Rdev == 0x103 || slices.Contains(flags, flagKmsg) {
var fd int
if fd, err = Open(
"/dev/kmsg",