diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-27 17:58:01 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-27 17:58:01 +0900 |
| commit | b18f40d974ffc33f3703d46bfe42d6fa2f844a01 (patch) | |
| tree | 1b713d0d797ab99da540d772255009775fe3c1c3 /cmd/earlyinit/mount.go | |
| parent | 12a606105124d1ef3133594afb9e6e0bc2e0ad33 (diff) | |
internal/kobject: pass action kind for range
Useful for handling most uevents.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/earlyinit/mount.go')
| -rw-r--r-- | cmd/earlyinit/mount.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/earlyinit/mount.go b/cmd/earlyinit/mount.go index 6ac59a46..51d4ecc9 100644 --- a/cmd/earlyinit/mount.go +++ b/cmd/earlyinit/mount.go @@ -12,6 +12,7 @@ import ( "hakurei.app/check" "hakurei.app/fhs" "hakurei.app/internal/kobject" + "hakurei.app/internal/uevent" ) // mustMountSystem waits for and mounts a system device matching pattern. @@ -26,8 +27,9 @@ func mustMountSystem( for { var matchErr error var systemPath *check.Absolute - s.Range(c, func(o *kobject.Object) bool { - if o.Subsystem != "block" || + s.Range(c, func(o *kobject.Object, act uevent.KobjectAction) bool { + if (act != uevent.KOBJ_ADD && act != uevent.KOBJ_CHANGE) || + o.Subsystem != "block" || o.Env["DEVTYPE"] != "disk" { return true } |
