deviceinfo: implement a new simple parser (MR 4)

This replaces an external toml library with a simple parser for
unmarshalling a deviceinfo.
This commit is contained in:
Clayton Craft
2021-09-04 18:01:17 -07:00
parent 003e04eaf2
commit d9f29af446
4 changed files with 109 additions and 53 deletions

View File

@@ -29,14 +29,19 @@ func timeFunc(start time.Time, name string) {
}
func main() {
devinfo, err := deviceinfo.ReadDeviceinfo()
if err != nil {
deviceinfoFile := "/etc/deviceinfo"
if !exists(deviceinfoFile) {
log.Print("NOTE: deviceinfo (from device package) not installed yet, " +
"not building the initramfs now (it should get built later " +
"automatically.)")
return
}
devinfo, err := deviceinfo.ReadDeviceinfo(deviceinfoFile)
if err != nil {
log.Fatal(err)
}
outDir := flag.String("d", "/boot", "Directory to output initfs(-extra) and other boot files")
flag.Parse()