From e9ba7987b863a7419c1d81e0f8f9d81df97a45de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Thu, 8 Dec 2022 12:50:34 +0100 Subject: [PATCH] fix: optionnal lvmetad setup in boot cmd --- pkg/cmd/init/boot/lvm.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/init/boot/lvm.go b/pkg/cmd/init/boot/lvm.go index 138953a..e6e6444 100644 --- a/pkg/cmd/init/boot/lvm.go +++ b/pkg/cmd/init/boot/lvm.go @@ -23,11 +23,15 @@ func setupLVM() { } // start lvmetad - sys.Mkdir("/run/lvm", 0700) - sys.Mkdir("/run/lock/lvm", 0700) - sys.Run("lvmetad") + if lvmetad, err := exec.LookPath("lvmetad"); err == nil { + sys.Mkdir("/run/lvm", 0700) + sys.Mkdir("/run/lock/lvm", 0700) + sys.Run(lvmetad) - sys.WaitFile("/run/lvm/lvmetad.socket", time.After(30*time.Second)) + sys.WaitFile("/run/lvm/lvmetad.socket", time.After(30*time.Second)) + } else { + log.Print("skipping lvmetad setup: ", err) + } // scan devices sys.Run("lvm", "pvscan")