main: return 0 if deviceinfo is missing

It might be missing if the device package is installed after mkinitfs is
being called, so don't cause apk triggers to error out by returning
failure.
This commit is contained in:
Clayton Craft
2021-08-16 22:32:32 -07:00
parent 217360b400
commit 1b9f0744b3

View File

@@ -26,7 +26,13 @@ func timeFunc(start time.Time, name string) {
}
func main() {
devinfo := deviceinfo.ReadDeviceinfo()
devinfo, err := deviceinfo.ReadDeviceinfo()
if err != nil {
log.Print("NOTE: deviceinfo (from device package) not installed yet, " +
"not building the initramfs now (it should get built later " +
"automatically.)")
os.Exit(0)
}
var outDir string
getopt.StringVar(&outDir, "d", "/boot", "Directory to output initfs(-extra), default: /boot")