Skip to content

Commit

Permalink
Avoid calling udevadm with -v flag
Browse files Browse the repository at this point in the history
seems like it can block and has no timeout

Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed May 28, 2024
1 parent f6ed18c commit 4495239
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/lib/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"strings"
"syscall"
"time"

"github.com/gofrs/uuid"
Expand Down Expand Up @@ -59,13 +60,12 @@ func Luksify(label, version string, tpm bool) (string, error) {
}

// Make sure ghw will see all partitions correctly.
// Some versions of udevadm don't support --settle (e.g. alpine)
// and older versions don't have --type=all. Try the simpler version then.
out, err := SH("udevadm trigger --settle -v --type=all || udevadm trigger -v")
// older versions don't have --type=all. Try the simpler version then.
out, err := SH("udevadm trigger settle --type=all || udevadm trigger")
if err != nil {
return "", fmt.Errorf("udevadm trigger failed: %w, out: %s", err, out)
}
SH("sync") //nolint:errcheck
syscall.Sync()

part, b, err := FindPartition(label)
if err != nil {
Expand Down

0 comments on commit 4495239

Please sign in to comment.