discover/platform-powerpc: Configure safe mode from IPMI bootdev setting
authorJeremy Kerr <jk@ozlabs.org>
Mon, 21 Jul 2014 10:30:33 +0000 (18:30 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 22 Jul 2014 01:04:59 +0000 (09:04 +0800)
An IPMI bootflags of 0x3 indicates a safe-mode boot. Use this to trigger
petitboot's safe mode.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/platform-powerpc.c

index 6ed65221c84b1ac14d5a7491e7e948bf7256e7be..24cc521c12c98c40f57c2fbec42400ee71f6f556 100644 (file)
@@ -572,6 +572,7 @@ enum ipmi_bootdev {
        IPMI_BOOTDEV_NONE = 0x00,
        IPMI_BOOTDEV_NETWORK = 0x01,
        IPMI_BOOTDEV_DISK = 0x2,
        IPMI_BOOTDEV_NONE = 0x00,
        IPMI_BOOTDEV_NETWORK = 0x01,
        IPMI_BOOTDEV_DISK = 0x2,
+       IPMI_BOOTDEV_SAFE = 0x3,
        IPMI_BOOTDEV_CDROM = 0x5,
        IPMI_BOOTDEV_SETUP = 0x6,
 };
        IPMI_BOOTDEV_CDROM = 0x5,
        IPMI_BOOTDEV_SETUP = 0x6,
 };
@@ -612,6 +613,7 @@ static int read_bootdev_sysparam(const char *name, uint8_t *val)
        case IPMI_BOOTDEV_NONE:
        case IPMI_BOOTDEV_NETWORK:
        case IPMI_BOOTDEV_DISK:
        case IPMI_BOOTDEV_NONE:
        case IPMI_BOOTDEV_NETWORK:
        case IPMI_BOOTDEV_DISK:
+       case IPMI_BOOTDEV_SAFE:
        case IPMI_BOOTDEV_CDROM:
        case IPMI_BOOTDEV_SETUP:
                *val = buf[0];
        case IPMI_BOOTDEV_CDROM:
        case IPMI_BOOTDEV_SETUP:
                *val = buf[0];
@@ -698,6 +700,10 @@ static void parse_opal_sysparams(struct config *config)
        case IPMI_BOOTDEV_SETUP:
                config->autoboot_enabled = false;
                break;
        case IPMI_BOOTDEV_SETUP:
                config->autoboot_enabled = false;
                break;
+       case IPMI_BOOTDEV_SAFE:
+               config->autoboot_enabled = false;
+               config->safe_mode = true;
+               break;
        }
 }
 
        }
 }