internal/kobject: pass action kind for range
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m52s
Test / ShareFS (push) Successful in 3m47s
Test / Hakurei (push) Successful in 3m52s
Test / Sandbox (race detector) (push) Successful in 5m24s
Test / Hakurei (race detector) (push) Successful in 6m33s
Test / Flake checks (push) Successful in 1m22s

Useful for handling most uevents.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-27 17:58:01 +09:00
parent 12a6061051
commit b18f40d974
5 changed files with 41 additions and 23 deletions

View File

@@ -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
}