]> git.ozlabs.org Git - petitboot/blobdiff - discover/hostboot.c
Display VERSION partition info on BMC machines
[petitboot] / discover / hostboot.c
diff --git a/discover/hostboot.c b/discover/hostboot.c
new file mode 100644 (file)
index 0000000..9a27b0f
--- /dev/null
@@ -0,0 +1,26 @@
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include <log/log.h>
+#include <talloc/talloc.h>
+#include <flash/flash.h>
+
+#include "hostboot.h"
+
+void hostboot_load_versions(struct system_info *info)
+{
+       int n = 0;
+
+       n = flash_parse_version(info, &info->platform_current, true);
+       if (n < 0)
+               pb_log("Failed to read platform versions for current side\n");
+       else
+               info->n_current = n;
+
+       n = flash_parse_version(info, &info->platform_other, false);
+       if (n < 0)
+               pb_log("Failed to read platform versions for other side\n");
+       else
+               info->n_other = n;
+}