aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/earlyinit/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/earlyinit/main.go')
-rw-r--r--cmd/earlyinit/main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/earlyinit/main.go b/cmd/earlyinit/main.go
index df454e3d..b5e8bcde 100644
--- a/cmd/earlyinit/main.go
+++ b/cmd/earlyinit/main.go
@@ -19,6 +19,7 @@ import (
"hakurei.app/internal/kobject"
"hakurei.app/internal/report"
"hakurei.app/internal/uevent"
+ "hakurei.app/message"
)
var r report.Reporter
@@ -79,6 +80,8 @@ const (
// optionSystem specifies devpath of the system device.
optionSystem = "system"
+ // flagVerbose increases output verbosity.
+ flagVerbose = "verbose"
// flagStrict sets [report.DStrict] on r.
flagStrict = "strict"
// flagNoRecover sets [report.DNoRecover] on r.
@@ -116,6 +119,9 @@ func main() {
r.SetFlags(flag)
}
+ msg := message.New(log.Default())
+ msg.SwapVerbose(slices.Contains(flags, flagVerbose))
+
mustSyscall("mount devtmpfs", Mount(
"devtmpfs",
"/dev/",
@@ -193,7 +199,7 @@ func main() {
must1(rand.Read(uuid[:]))
ctx, cancel := context.WithCancel(context.Background())
- go consume(ctx, &r, conn, uuid, events)
+ go consume(ctx, msg, &r, conn, uuid, events)
s := kobject.New(uuid, func(o *kobject.Object, env map[string]string) {
log.Printf("change %s: %q", o.DevPath, env)
}, func(err error) {