]> git.ozlabs.org Git - petitboot/blobdiff - discover/platform-powerpc.c
ui/ncurses: Add nc-subset selection screen
[petitboot] / discover / platform-powerpc.c
index 4cc91fa2594eeac6c2b939ee50c4dc0821fe433a..895f0ecd73cc54ccea2420c037b26124f9a68076 100644 (file)
@@ -388,6 +388,47 @@ static void populate_network_config(struct platform_powerpc *platform,
        talloc_free(val);
 }
 
+static int read_bootdev(void *ctx, char **pos, struct autoboot_option *opt)
+{
+       char *delim = strchr(*pos, ' ');
+       int len, prefix = 0, rc = -1;
+       enum device_type type;
+
+       if (!strncmp(*pos, "uuid:", strlen("uuid:"))) {
+               prefix = strlen("uuid:");
+               opt->boot_type = BOOT_DEVICE_UUID;
+               rc = 0;
+       } else if (!strncmp(*pos, "mac:", strlen("mac:"))) {
+               prefix = strlen("mac:");
+               opt->boot_type = BOOT_DEVICE_UUID;
+               rc = 0;
+       } else {
+               type = find_device_type(*pos);
+               if (type != DEVICE_TYPE_UNKNOWN) {
+                       opt->type = type;
+                       opt->boot_type = BOOT_DEVICE_TYPE;
+                       rc = 0;
+               }
+       }
+
+       if (opt->boot_type == BOOT_DEVICE_UUID) {
+               if (delim)
+                       len = (int)(delim - *pos) - prefix;
+               else
+                       len = strlen(*pos);
+
+               opt->uuid = talloc_strndup(ctx, *pos + prefix, len);
+       }
+
+       /* Always advance pointer to next option or end */
+       if (delim)
+               *pos = delim + 1;
+       else
+               *pos += strlen(*pos);
+
+       return rc;
+}
+
 static void populate_bootdev_config(struct platform_powerpc *platform,
                struct config *config)
 
@@ -802,7 +843,7 @@ static int set_ipmi_os_boot_sensor(struct platform_powerpc *platform)
        uint8_t resp[1];
        uint8_t req[] = {
                0x00, /* sensor number: os boot */
-               0x10, /* operation: set assertion bits */
+               0xA9, /* operation: set everything */
                0x00, /* sensor reading: none */
                0x40, /* assertion mask lsb: set state 6 */
                0x00, /* assertion mask msb: none */