diff options
-rw-r--r-- | discover/device-handler.c | 3 | ||||
-rw-r--r-- | discover/platform-powerpc.c | 25 | ||||
-rw-r--r-- | discover/platform.c | 6 | ||||
-rw-r--r-- | discover/platform.h | 2 |
4 files changed, 25 insertions, 11 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c index 120f11f..7cf5263 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -786,6 +786,9 @@ void device_handler_boot(struct device_handler *handler, if (handler->pending_boot) boot_cancel(handler->pending_boot); + + platform_finalise_config(); + handler->pending_boot = boot(handler, opt, cmd, handler->dry_run, boot_status, handler); handler->pending_boot_is_default = false; diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c index 1f6f725..7c34939 100644 --- a/discover/platform-powerpc.c +++ b/discover/platform-powerpc.c @@ -693,12 +693,8 @@ static void parse_opal_sysparams(struct config *config) if (!next_valid && !default_valid) return; - if (next_valid) { - /* invalidate next-boot-device setting */ - write_bootdev_sysparam("next-boot-device", 0xff); - } else { + if (!next_valid) next_bootdev = default_bootdev; - } switch (next_bootdev) { case IPMI_BOOTDEV_NONE: @@ -753,6 +749,12 @@ static int save_config(struct platform *p, struct config *config) return rc; } +static void finalise_config(struct platform *platform __attribute__((unused))) +{ + /* invalidate next-boot-device setting */ + write_bootdev_sysparam("next-boot-device", 0xff); +} + static int get_sysinfo(struct platform *p, struct system_info *sysinfo) { struct platform_powerpc *platform = p->platform_data; @@ -797,12 +799,13 @@ static bool probe(struct platform *p, void *ctx) static struct platform platform_powerpc = { - .name = "powerpc", - .dhcp_arch_id = 0x000e, - .probe = probe, - .load_config = load_config, - .save_config = save_config, - .get_sysinfo = get_sysinfo, + .name = "powerpc", + .dhcp_arch_id = 0x000e, + .probe = probe, + .load_config = load_config, + .save_config = save_config, + .finalise_config = finalise_config, + .get_sysinfo = get_sysinfo, }; register_platform(platform_powerpc); diff --git a/discover/platform.c b/discover/platform.c index 4d5009c..0a221e2 100644 --- a/discover/platform.c +++ b/discover/platform.c @@ -173,6 +173,12 @@ const struct platform *platform_get(void) return platform; } +void platform_finalise_config(void) +{ + if (platform && platform->finalise_config) + platform->finalise_config(platform); +} + int platform_get_sysinfo(struct system_info *info) { if (platform && platform->get_sysinfo) diff --git a/discover/platform.h b/discover/platform.h index 0a1aa5e..5601b61 100644 --- a/discover/platform.h +++ b/discover/platform.h @@ -8,6 +8,7 @@ struct platform { bool (*probe)(struct platform *, void *); int (*load_config)(struct platform *, struct config *); int (*save_config)(struct platform *, struct config *); + void (*finalise_config)(struct platform *); int (*get_sysinfo)(struct platform *, struct system_info *); uint16_t dhcp_arch_id; void *platform_data; @@ -17,6 +18,7 @@ int platform_init(void *ctx); int platform_fini(void); const struct platform *platform_get(void); int platform_get_sysinfo(struct system_info *info); +void platform_finalise_config(void); /* configuration interface */ const struct config *config_get(void); |