aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/uevent/coldboot.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/uevent/coldboot.go')
-rw-r--r--internal/uevent/coldboot.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/uevent/coldboot.go b/internal/uevent/coldboot.go
index 07f6497f..660f0284 100644
--- a/internal/uevent/coldboot.go
+++ b/internal/uevent/coldboot.go
@@ -7,6 +7,7 @@ import (
"log"
"os"
"path/filepath"
+ "slices"
)
// synthAdd is prepared bytes written to uevent to cause a synthetic add event
@@ -26,6 +27,7 @@ var synthAdd = []byte(KOBJ_ADD.String())
func Coldboot(
ctx context.Context,
pathname string,
+ uuid *UUID,
visited chan<- string,
handleWalkErr func(error) error,
) error {
@@ -39,6 +41,11 @@ func Coldboot(
}
}
+ add := synthAdd
+ if uuid != nil {
+ add = slices.Concat(add, []byte{' '}, []byte(uuid.String()))
+ }
+
return filepath.WalkDir(filepath.Join(pathname, "devices"), func(
path string,
d fs.DirEntry,
@@ -54,7 +61,7 @@ func Coldboot(
if d.IsDir() || d.Name() != "uevent" {
return nil
}
- if err = os.WriteFile(path, synthAdd, 0); err != nil {
+ if err = os.WriteFile(path, add, 0); err != nil {
return handleWalkErr(err)
}