On Thu, Dec 14, 2023 at 09:50:26AM -0700, Simon Glass wrote:

> In quite a few places, the bootm command is used to handle a boot. We
> want these to be done without needing CONFIG_CMDLINE, so add a new
> bootm_run() function to handle this.
> 
> Signed-off-by: Simon Glass <s...@chromium.org>
[snip]
> +int bootm_run(struct bootm_info *bmi)
> +{
> +     int states;
> +
> +     bmi->cmd_name = "bootm";
> +     states = BOOTM_STATE_START | BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD |
> +             BOOTM_STATE_FINDOTHER | BOOTM_STATE_LOADOS |
> +             BOOTM_STATE_OS_PREP | BOOTM_STATE_OS_FAKE_GO |
> +             BOOTM_STATE_OS_GO;
> +     if (IS_ENABLED(CONFIG_SYS_BOOT_RAMDISK_HIGH))
> +             states |= BOOTM_STATE_RAMDISK;
> +     if (IS_ENABLED(CONFIG_MEASURED_BOOT))
> +             states |= BOOTM_STATE_MEASURE;
> +     if (IS_ENABLED(CONFIG_PPC) || IS_ENABLED(CONFIG_MIPS))
> +             states |= BOOTM_STATE_OS_CMDLINE;
> +
> +     return bootm_run_states(bmi, states);
> +}

Looking at this, and then boot[zi]_run, I think we should either always set
BOOTM_STATE_MEASURE (it's a nop without CONFIG_MEASURED_BOOT) or always
IS_ENABLED check it before setting. I think we both would prefer the
former? And I really do wonder how much it would hurt or not to just
have boot_run() or something which takes the name as a param and handles
the few "bootm"-only flags.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to