Re: distro_boot vs. env-based bootmenu

Hi Frank,
On Fri, 21 Apr 2023 at 10:03, Frank Wunderlich frank-w@public-files.de wrote:
Maybe you have an idea because your patch removes distro-boot
https://patchwork.ozlabs.org/project/uboot/patch/20230409084454.v9.8.I4cf770...
For missing linebreak for autoboot this seems to be a calculation issue
https://source.denx.de/u-boot/u-boot/-/blob/master/common/menu.c#L439
Are you able to fix it with a patch?
Or if not, do you have a patch for the 'move to env-based bootmenu' so I can try it?
Regards, Simon
-------- Ursprüngliche Nachricht -------- Von: Frank Wunderlich frank-w@public-files.de Gesendet: 12. April 2023 11:22:23 MESZ An: u-boot@lists.denx.de Betreff: distro_boot vs. env-based bootmenu
Hi,
i try to move from distro-boot (extlinux-config files) to an env-based bootmenu (builtin-environment) for my bananapi r2pro.
basicly it works, but i see more bootmenu-entries than i have defined in my environment
*** U-Boot Boot Menu ***
1. Boot from SD/EMMC. mmc 1:2 mmc 1:3 mmc 1:4 U-Boot consoleHit any key to stop autoboot: 2
i have only defined one botmenu-entry (first one in uEnv_r2pro.txt)
bootmenu_0=1. Boot from SD/EMMC.=run newboot bootmenu_default=0
i guess the 3 mmc 1:x entries are part from distro-boot. i see a series from simon where he drops distroboot for rockchip-boards.
https://patchwork.ozlabs.org/project/uboot/patch/20230409084454.v9.8.I4cf770...
can anyone explain me where i can disable the mmc 1:x entries? i wanted to leave distro_boot as fallback but it seems this is not possible.
maybe i have to disable these?
BOOTMETH_DISTRO [=y] DISTRO_DEFAULTS [=y]
can i keep distro-boot (seems to works with env too, but overridden by my builtin env) somehow and drop the mmc-entries from my bootmenu?
any idea why i have no linebreak after u-Boot console?
i use u-boot 2023.04 my source for this conversion/tests is there: https://github.com/frank-w/u-boot/tree/2023-04-bpi-r2pro using modified configs/evb-rk3568_defconfig
regards Frank regards Frank

Am 24. April 2023 21:44:25 MESZ schrieb Simon Glass sjg@chromium.org:
Hi Frank,
On Fri, 21 Apr 2023 at 10:03, Frank Wunderlich frank-w@public-files.de wrote:
Maybe you have an idea because your patch removes distro-boot
https://patchwork.ozlabs.org/project/uboot/patch/20230409084454.v9.8.I4cf770...
For missing linebreak for autoboot this seems to be a calculation issue
https://source.denx.de/u-boot/u-boot/-/blob/master/common/menu.c#L439
Are you able to fix it with a patch?
Have not yet figured out which part of u-boot creates the mmc-entries on top of my bootmenu (i guess this comes from my still enabled distroboot options).
For missing linebreak i guess position calculation is wrong in this case.
Or if not, do you have a patch for the 'move to env-based bootmenu' so I can try it?
I have i builtin env file (uEnv_r2pro.txt) in my tree here and add (enable pepared option) the config-option to use this env file in topmost commit.
https://github.com/frank-w/u-boot/commits/2023-04-bpi-r2pro
I had this in but disabled but this overrides the env created by distroboot-defines...but now enabling it to get rid of distroboot.
Regards, Simon
-------- Ursprüngliche Nachricht -------- Von: Frank Wunderlich frank-w@public-files.de Gesendet: 12. April 2023 11:22:23 MESZ An: u-boot@lists.denx.de Betreff: distro_boot vs. env-based bootmenu
Hi,
i try to move from distro-boot (extlinux-config files) to an env-based bootmenu (builtin-environment) for my bananapi r2pro.
basicly it works, but i see more bootmenu-entries than i have defined in my environment
*** U-Boot Boot Menu ***
1. Boot from SD/EMMC. mmc 1:2 mmc 1:3 mmc 1:4 U-Boot consoleHit any key to stop autoboot: 2
i have only defined one botmenu-entry (first one in uEnv_r2pro.txt)
bootmenu_0=1. Boot from SD/EMMC.=run newboot bootmenu_default=0
i guess the 3 mmc 1:x entries are part from distro-boot. i see a series from simon where he drops distroboot for rockchip-boards.
https://patchwork.ozlabs.org/project/uboot/patch/20230409084454.v9.8.I4cf770...
can anyone explain me where i can disable the mmc 1:x entries? i wanted to leave distro_boot as fallback but it seems this is not possible.
maybe i have to disable these?
BOOTMETH_DISTRO [=y] DISTRO_DEFAULTS [=y]
can i keep distro-boot (seems to works with env too, but overridden by my builtin env) somehow and drop the mmc-entries from my bootmenu?
any idea why i have no linebreak after u-Boot console?
i use u-boot 2023.04 my source for this conversion/tests is there: https://github.com/frank-w/u-boot/tree/2023-04-bpi-r2pro using modified configs/evb-rk3568_defconfig
regards Frank regards Frank
regards Frank

+Heinrich Schuchardt +Ilias Apalodimas in case they have ideas on this
On Mon, 24 Apr 2023 at 15:22, Frank Wunderlich frank-w@public-files.de wrote:
Am 24. April 2023 21:44:25 MESZ schrieb Simon Glass sjg@chromium.org:
Hi Frank,
On Fri, 21 Apr 2023 at 10:03, Frank Wunderlich frank-w@public-files.de wrote:
Maybe you have an idea because your patch removes distro-boot
https://patchwork.ozlabs.org/project/uboot/patch/20230409084454.v9.8.I4cf770...
For missing linebreak for autoboot this seems to be a calculation issue
https://source.denx.de/u-boot/u-boot/-/blob/master/common/menu.c#L439
Are you able to fix it with a patch?
Have not yet figured out which part of u-boot creates the mmc-entries on top of my bootmenu (i guess this comes from my still enabled distroboot options).
For missing linebreak i guess position calculation is wrong in this case.
Or if not, do you have a patch for the 'move to env-based bootmenu' so I can try it?
I have i builtin env file (uEnv_r2pro.txt) in my tree here and add (enable pepared option) the config-option to use this env file in topmost commit.
https://github.com/frank-w/u-boot/commits/2023-04-bpi-r2pro
I had this in but disabled but this overrides the env created by distroboot-defines...but now enabling it to get rid of distroboot.
Regards, Simon
-------- Ursprüngliche Nachricht -------- Von: Frank Wunderlich frank-w@public-files.de Gesendet: 12. April 2023 11:22:23 MESZ An: u-boot@lists.denx.de Betreff: distro_boot vs. env-based bootmenu
Hi,
i try to move from distro-boot (extlinux-config files) to an env-based bootmenu (builtin-environment) for my bananapi r2pro.
basicly it works, but i see more bootmenu-entries than i have defined in my environment
*** U-Boot Boot Menu ***
1. Boot from SD/EMMC. mmc 1:2 mmc 1:3 mmc 1:4 U-Boot consoleHit any key to stop autoboot: 2
i have only defined one botmenu-entry (first one in uEnv_r2pro.txt)
bootmenu_0=1. Boot from SD/EMMC.=run newboot bootmenu_default=0
i guess the 3 mmc 1:x entries are part from distro-boot. i see a series from simon where he drops distroboot for rockchip-boards.
https://patchwork.ozlabs.org/project/uboot/patch/20230409084454.v9.8.I4cf770...
can anyone explain me where i can disable the mmc 1:x entries? i wanted to leave distro_boot as fallback but it seems this is not possible.
maybe i have to disable these?
BOOTMETH_DISTRO [=y] DISTRO_DEFAULTS [=y]
can i keep distro-boot (seems to works with env too, but overridden by my builtin env) somehow and drop the mmc-entries from my bootmenu?
any idea why i have no linebreak after u-Boot console?
i use u-boot 2023.04 my source for this conversion/tests is there: https://github.com/frank-w/u-boot/tree/2023-04-bpi-r2pro using modified configs/evb-rk3568_defconfig
regards Frank regards Frank
regards Frank

Hi
I tried to find out why distroboot is enabled (i have not set it in my defconfig) and i think this is why:
│ Symbol: DISTRO_DEFAULTS [=y] │ │ Type : bool │ │ Prompt: Select defaults suitable for booting general purpose Linux dist │ │ Location: │ │ (3) -> Boot options │ │ Defined at boot/Kconfig:833 │ │ Selects: BOOT_DEFAULTS [=y] && AUTO_COMPLETE [=y] && CMDLINE_EDITING │ │ Implied by [y]: │ │ - ARCH_ROCKCHIP [=y] && <choice> && !ROCKCHIP_RK3399 [=n]
as far as i see you've got a response from Jonas about this option and he changed Kconfig file to BOOTSTD_DEFAULTS
as i have not used BOOTSTD_DEFAULTS before, what needs to be changed to have it working?
basicly my Plan is to script the bootup via env in script with a bootmenu (default entry + additional ones which can be changed by an env.txt file), but i do not want to break existing setups (using extlinux/*.conf behaviour) and no additional bootmenu-entries.
is there any documentation describing the "Standard boot"?
i found this, but it looks like the "old" distro-boot...or is is same from users PoV?
https://u-boot.readthedocs.io/en/latest/develop/bootstd.html
regards Frank
On Mon, 24 Apr 2023 at 15:22, Frank Wunderlich frank-w@public-files.de wrote:
Am 24. April 2023 21:44:25 MESZ schrieb Simon Glass sjg@chromium.org:
Hi Frank,
On Fri, 21 Apr 2023 at 10:03, Frank Wunderlich frank-w@public-files.de wrote:
Maybe you have an idea because your patch removes distro-boot
https://patchwork.ozlabs.org/project/uboot/patch/20230409084454.v9.8.I4cf770...
For missing linebreak for autoboot this seems to be a calculation issue
https://source.denx.de/u-boot/u-boot/-/blob/master/common/menu.c#L439
Are you able to fix it with a patch?
Have not yet figured out which part of u-boot creates the mmc-entries on top of my bootmenu (i guess this comes from my still enabled distroboot options).
For missing linebreak i guess position calculation is wrong in this case.
Or if not, do you have a patch for the 'move to env-based bootmenu' so I can try it?
I have i builtin env file (uEnv_r2pro.txt) in my tree here and add (enable pepared option) the config-option to use this env file in topmost commit.
https://github.com/frank-w/u-boot/commits/2023-04-bpi-r2pro
I had this in but disabled but this overrides the env created by distroboot-defines...but now enabling it to get rid of distroboot.
-------- Ursprüngliche Nachricht -------- Von: Frank Wunderlich frank-w@public-files.de Gesendet: 12. April 2023 11:22:23 MESZ An: u-boot@lists.denx.de Betreff: distro_boot vs. env-based bootmenu
Hi,
i try to move from distro-boot (extlinux-config files) to an env-based bootmenu (builtin-environment) for my bananapi r2pro.
basicly it works, but i see more bootmenu-entries than i have defined in my environment
*** U-Boot Boot Menu ***
1. Boot from SD/EMMC. mmc 1:2 mmc 1:3 mmc 1:4 U-Boot consoleHit any key to stop autoboot: 2
i have only defined one botmenu-entry (first one in uEnv_r2pro.txt)
bootmenu_0=1. Boot from SD/EMMC.=run newboot bootmenu_default=0
i guess the 3 mmc 1:x entries are part from distro-boot. i see a series from simon where he drops distroboot for rockchip-boards.
https://patchwork.ozlabs.org/project/uboot/patch/20230409084454.v9.8.I4cf770...
can anyone explain me where i can disable the mmc 1:x entries? i wanted to leave distro_boot as fallback but it seems this is not possible.
maybe i have to disable these?
BOOTMETH_DISTRO [=y] DISTRO_DEFAULTS [=y]
can i keep distro-boot (seems to works with env too, but overridden by my builtin env) somehow and drop the mmc-entries from my bootmenu?
any idea why i have no linebreak after u-Boot console?
i use u-boot 2023.04 my source for this conversion/tests is there: https://github.com/frank-w/u-boot/tree/2023-04-bpi-r2pro using modified configs/evb-rk3568_defconfig

Hi Frank,
On 2023-04-30 15:25, Frank Wunderlich wrote:
Hi
I tried to find out why distroboot is enabled (i have not set it in my defconfig) and i think this is why:
│ Symbol: DISTRO_DEFAULTS [=y] │ │ Type : bool │ │ Prompt: Select defaults suitable for booting general purpose Linux dist │ │ Location: │ │ (3) -> Boot options │ │ Defined at boot/Kconfig:833 │ │ Selects: BOOT_DEFAULTS [=y] && AUTO_COMPLETE [=y] && CMDLINE_EDITING │ │ Implied by [y]: │ │ - ARCH_ROCKCHIP [=y] && <choice> && !ROCKCHIP_RK3399 [=n]
as far as i see you've got a response from Jonas about this option and he changed Kconfig file to BOOTSTD_DEFAULTS
as i have not used BOOTSTD_DEFAULTS before, what needs to be changed to have it working?
Please update to latest master branch, rk356x is not fully working with v2023.04 or earlier, especially BOOTSTD without extra CONFIGs.
With latest master branch CONFIG_BOOTSTD_DEFAULTS=y should be set by default for all ARCH_ROCKCHIP. And should work very similar to if you used to have "run distro_bootcmd" as your bootcmd.
It is still unclear what script/bootcmd you are trying to use, or if you used to have "run distro_bootcmd" as a fallback. Replacing "run distro_bootcmd" with "bootflow scan -lb" or "bootflow scan" could work as such fallback option.
basicly my Plan is to script the bootup via env in script with a bootmenu (default entry + additional ones which can be changed by an env.txt file), but i do not want to break existing setups (using extlinux/*.conf behaviour) and no additional bootmenu-entries.
The "distro" bootmeth described at the documentation you linked to will looks for a file called extlinux/extlinux.conf.
Is there a special reason why you need to use a custom bootmenu script and are moving from distro-boot (extlinux-config files)?
is there any documentation describing the "Standard boot"?
i found this, but it looks like the "old" distro-boot...or is is same from users PoV?
https://u-boot.readthedocs.io/en/latest/develop/bootstd.html
This is the documentation for standard boot.
I recommend you try out the commands bootdev, bootflow and bootmeth with CONFIG_BOOTSTD_FULL=y to get a better handling on how it would work on your device and how you can use them in your script.
Regards, Jonas
regards Frank
On Mon, 24 Apr 2023 at 15:22, Frank Wunderlich frank-w@public-files.de wrote:
Am 24. April 2023 21:44:25 MESZ schrieb Simon Glass sjg@chromium.org:
Hi Frank,
On Fri, 21 Apr 2023 at 10:03, Frank Wunderlich frank-w@public-files.de wrote:
Maybe you have an idea because your patch removes distro-boot
https://patchwork.ozlabs.org/project/uboot/patch/20230409084454.v9.8.I4cf770...
For missing linebreak for autoboot this seems to be a calculation issue
https://source.denx.de/u-boot/u-boot/-/blob/master/common/menu.c#L439
Are you able to fix it with a patch?
Have not yet figured out which part of u-boot creates the mmc-entries on top of my bootmenu (i guess this comes from my still enabled distroboot options).
For missing linebreak i guess position calculation is wrong in this case.
Or if not, do you have a patch for the 'move to env-based bootmenu' so I can try it?
I have i builtin env file (uEnv_r2pro.txt) in my tree here and add (enable pepared option) the config-option to use this env file in topmost commit.
https://github.com/frank-w/u-boot/commits/2023-04-bpi-r2pro
I had this in but disabled but this overrides the env created by distroboot-defines...but now enabling it to get rid of distroboot.
-------- Ursprüngliche Nachricht -------- Von: Frank Wunderlich frank-w@public-files.de Gesendet: 12. April 2023 11:22:23 MESZ An: u-boot@lists.denx.de Betreff: distro_boot vs. env-based bootmenu
Hi,
i try to move from distro-boot (extlinux-config files) to an env-based bootmenu (builtin-environment) for my bananapi r2pro.
basicly it works, but i see more bootmenu-entries than i have defined in my environment
*** U-Boot Boot Menu ***
1. Boot from SD/EMMC. mmc 1:2 mmc 1:3 mmc 1:4 U-Boot consoleHit any key to stop autoboot: 2
i have only defined one botmenu-entry (first one in uEnv_r2pro.txt)
bootmenu_0=1. Boot from SD/EMMC.=run newboot bootmenu_default=0
i guess the 3 mmc 1:x entries are part from distro-boot. i see a series from simon where he drops distroboot for rockchip-boards.
https://patchwork.ozlabs.org/project/uboot/patch/20230409084454.v9.8.I4cf770...
can anyone explain me where i can disable the mmc 1:x entries? i wanted to leave distro_boot as fallback but it seems this is not possible.
maybe i have to disable these?
BOOTMETH_DISTRO [=y] DISTRO_DEFAULTS [=y]
can i keep distro-boot (seems to works with env too, but overridden by my builtin env) somehow and drop the mmc-entries from my bootmenu?
any idea why i have no linebreak after u-Boot console?
i use u-boot 2023.04 my source for this conversion/tests is there: https://github.com/frank-w/u-boot/tree/2023-04-bpi-r2pro using modified configs/evb-rk3568_defconfig

Hi Jonas
sorry for the delay. i came back to this and tried your way. Thx for your information...there is no real example in the docs (or i didn't found it) for manual trigger the extlinux-boot, so your information helps a lot.
Gesendet: Sonntag, 30. April 2023 um 19:40 Uhr Von: "Jonas Karlman" jonas@kwiboo.se An: "Frank Wunderlich" frank-w@public-files.de, "Simon Glass" sjg@chromium.org Cc: "U-Boot Mailing List" u-boot@lists.denx.de, "Heinrich Schuchardt" heinrich.schuchardt@canonical.com, "Ilias Apalodimas" ilias.apalodimas@linaro.org Betreff: Re: Aw: Re: distro_boot vs. env-based bootmenu
Hi Frank,
On 2023-04-30 15:25, Frank Wunderlich wrote:
Hi
I tried to find out why distroboot is enabled (i have not set it in my defconfig) and i think this is why:
│ Symbol: DISTRO_DEFAULTS [=y] │ │ Type : bool │ │ Prompt: Select defaults suitable for booting general purpose Linux dist │ │ Location: │ │ (3) -> Boot options │ │ Defined at boot/Kconfig:833 │ │ Selects: BOOT_DEFAULTS [=y] && AUTO_COMPLETE [=y] && CMDLINE_EDITING │ │ Implied by [y]: │ │ - ARCH_ROCKCHIP [=y] && <choice> && !ROCKCHIP_RK3399 [=n]
as far as i see you've got a response from Jonas about this option and he changed Kconfig file to BOOTSTD_DEFAULTS
as i have not used BOOTSTD_DEFAULTS before, what needs to be changed to have it working?
Please update to latest master branch, rk356x is not fully working with v2023.04 or earlier, especially BOOTSTD without extra CONFIGs.
With latest master branch CONFIG_BOOTSTD_DEFAULTS=y should be set by default for all ARCH_ROCKCHIP. And should work very similar to if you used to have "run distro_bootcmd" as your bootcmd.
As i use builtin-environment there is no distro_bootcmd which i can run.
It is still unclear what script/bootcmd you are trying to use, or if you used to have "run distro_bootcmd" as a fallback. Replacing "run distro_bootcmd" with "bootflow scan -lb" or "bootflow scan" could work as such fallback option.
but with "bootflow scan -lb" it works except 1 thing: old bootchain looked in config directory for the files (kernel+fdt) whereas new way looks in root of partition and now needs additional extlinux prefix.
and yes i want distroboot as fallback...
is there a way to avoid this to hold the file compatible?
why i use the environment bootmenu? i do a bit more in the menuitems (and before) e.g. loading a uEnv.txt to override some options and for testing. have bootargs only defined once, have testkernels with initrd and some special stuff with asking for user input (list kernels from mmc/tftp/... and let user choose which kernel/fdt/initrd/...). Such things are imho not possible with extlinux way.
currently only bpi-r2pro uses extlinux boot and the other 3 boards using the builtin environment bootmenu. So to keep all boards nearly same i want to have the same for r2pro but allow users with extlinux still using this.
basicly my Plan is to script the bootup via env in script with a bootmenu (default entry + additional ones which can be changed by an env.txt file), but i do not want to break existing setups (using extlinux/*.conf behaviour) and no additional bootmenu-entries.
The "distro" bootmeth described at the documentation you linked to will looks for a file called extlinux/extlinux.conf.
Is there a special reason why you need to use a custom bootmenu script and are moving from distro-boot (extlinux-config files)?
is there any documentation describing the "Standard boot"?
i found this, but it looks like the "old" distro-boot...or is is same from users PoV?
https://u-boot.readthedocs.io/en/latest/develop/bootstd.html
This is the documentation for standard boot.
I recommend you try out the commands bootdev, bootflow and bootmeth with CONFIG_BOOTSTD_FULL=y to get a better handling on how it would work on your device and how you can use them in your script.
Regards, Jonas
regards Frank

Hi Frank, On 2023-06-30 19:51, Frank Wunderlich wrote:
Hi Jonas
sorry for the delay. i came back to this and tried your way. Thx for your information...there is no real example in the docs (or i didn't found it) for manual trigger the extlinux-boot, so your information helps a lot.
Gesendet: Sonntag, 30. April 2023 um 19:40 Uhr Von: "Jonas Karlman" jonas@kwiboo.se An: "Frank Wunderlich" frank-w@public-files.de, "Simon Glass" sjg@chromium.org Cc: "U-Boot Mailing List" u-boot@lists.denx.de, "Heinrich Schuchardt" heinrich.schuchardt@canonical.com, "Ilias Apalodimas" ilias.apalodimas@linaro.org Betreff: Re: Aw: Re: distro_boot vs. env-based bootmenu
Hi Frank,
On 2023-04-30 15:25, Frank Wunderlich wrote:
Hi
I tried to find out why distroboot is enabled (i have not set it in my defconfig) and i think this is why:
│ Symbol: DISTRO_DEFAULTS [=y] │ │ Type : bool │ │ Prompt: Select defaults suitable for booting general purpose Linux dist │ │ Location: │ │ (3) -> Boot options │ │ Defined at boot/Kconfig:833 │ │ Selects: BOOT_DEFAULTS [=y] && AUTO_COMPLETE [=y] && CMDLINE_EDITING │ │ Implied by [y]: │ │ - ARCH_ROCKCHIP [=y] && <choice> && !ROCKCHIP_RK3399 [=n]
as far as i see you've got a response from Jonas about this option and he changed Kconfig file to BOOTSTD_DEFAULTS
as i have not used BOOTSTD_DEFAULTS before, what needs to be changed to have it working?
Please update to latest master branch, rk356x is not fully working with v2023.04 or earlier, especially BOOTSTD without extra CONFIGs.
With latest master branch CONFIG_BOOTSTD_DEFAULTS=y should be set by default for all ARCH_ROCKCHIP. And should work very similar to if you used to have "run distro_bootcmd" as your bootcmd.
As i use builtin-environment there is no distro_bootcmd which i can run.
It is still unclear what script/bootcmd you are trying to use, or if you used to have "run distro_bootcmd" as a fallback. Replacing "run distro_bootcmd" with "bootflow scan -lb" or "bootflow scan" could work as such fallback option.
but with "bootflow scan -lb" it works except 1 thing: old bootchain looked in config directory for the files (kernel+fdt) whereas new way looks in root of partition and now needs additional extlinux prefix.
This could be related to an issue that was fixed in v2023.07-rc5:
bootstd: Fix relative path use in extlinux bootmeth
See https://source.denx.de/u-boot/u-boot/-/commit/a7e4dffcd8c582bf4344548270d2fc...
If not then please provide more details, in case this is a bug.
and yes i want distroboot as fallback...
is there a way to avoid this to hold the file compatible?
The intent is that the new standard boot should be as compatible as possible as the old script based distro boot, depending on you boot script.
If you use any of the script part that the old distro boot provided you will have to adjust your boot script, e.g. replace "run distro_bootcmd" with "bootflow scan -lb" or "bootflow scan", and modify boot_targets and bootmeths to control boot order.
See https://u-boot.readthedocs.io/en/latest/develop/bootstd.html#controlling-ord...
why i use the environment bootmenu? i do a bit more in the menuitems (and before) e.g. loading a uEnv.txt to override some options and for testing. have bootargs only defined once, have testkernels with initrd and some special stuff with asking for user input (list kernels from mmc/tftp/... and let user choose which kernel/fdt/initrd/...). Such things are imho not possible with extlinux way.
I think there are some limited menu handling with standard boot, it may depend on a working video driver, something that RK356x does not have.
Regards, Jonas
currently only bpi-r2pro uses extlinux boot and the other 3 boards using the builtin environment bootmenu. So to keep all boards nearly same i want to have the same for r2pro but allow users with extlinux still using this.
basicly my Plan is to script the bootup via env in script with a bootmenu (default entry + additional ones which can be changed by an env.txt file), but i do not want to break existing setups (using extlinux/*.conf behaviour) and no additional bootmenu-entries.
The "distro" bootmeth described at the documentation you linked to will looks for a file called extlinux/extlinux.conf.
Is there a special reason why you need to use a custom bootmenu script and are moving from distro-boot (extlinux-config files)?
is there any documentation describing the "Standard boot"?
i found this, but it looks like the "old" distro-boot...or is is same from users PoV?
https://u-boot.readthedocs.io/en/latest/develop/bootstd.html%3E%3E%3E
This is the documentation for standard boot.
I recommend you try out the commands bootdev, bootflow and bootmeth with CONFIG_BOOTSTD_FULL=y to get a better handling on how it would work on your device and how you can use them in your script.
Regards, Jonas
regards Frank

Hi Jonas
thx again for your valuable answer
Gesendet: Samstag, 01. Juli 2023 um 10:12 Uhr Von: "Jonas Karlman" jonas@kwiboo.se An: "Frank Wunderlich" frank-w@public-files.de Cc: "Simon Glass" sjg@chromium.org, "U-Boot Mailing List" u-boot@lists.denx.de, "Heinrich Schuchardt" heinrich.schuchardt@canonical.com, "Ilias Apalodimas" ilias.apalodimas@linaro.org Betreff: Re: Aw: Re: Re: distro_boot vs. env-based bootmenu
Hi Frank, On 2023-06-30 19:51, Frank Wunderlich wrote:
Hi Jonas
sorry for the delay. i came back to this and tried your way. Thx for your information...there is no real example in the docs (or i didn't found it) for manual trigger the extlinux-boot, so your information helps a lot.
Gesendet: Sonntag, 30. April 2023 um 19:40 Uhr Von: "Jonas Karlman" jonas@kwiboo.se An: "Frank Wunderlich" frank-w@public-files.de, "Simon Glass" sjg@chromium.org Cc: "U-Boot Mailing List" u-boot@lists.denx.de, "Heinrich Schuchardt" heinrich.schuchardt@canonical.com, "Ilias Apalodimas" ilias.apalodimas@linaro.org Betreff: Re: Aw: Re: distro_boot vs. env-based bootmenu
Hi Frank,
On 2023-04-30 15:25, Frank Wunderlich wrote:
Hi
I tried to find out why distroboot is enabled (i have not set it in my defconfig) and i think this is why:
│ Symbol: DISTRO_DEFAULTS [=y] │ │ Type : bool │ │ Prompt: Select defaults suitable for booting general purpose Linux dist │ │ Location: │ │ (3) -> Boot options │ │ Defined at boot/Kconfig:833 │ │ Selects: BOOT_DEFAULTS [=y] && AUTO_COMPLETE [=y] && CMDLINE_EDITING │ │ Implied by [y]: │ │ - ARCH_ROCKCHIP [=y] && <choice> && !ROCKCHIP_RK3399 [=n]
as far as i see you've got a response from Jonas about this option and he changed Kconfig file to BOOTSTD_DEFAULTS
as i have not used BOOTSTD_DEFAULTS before, what needs to be changed to have it working?
Please update to latest master branch, rk356x is not fully working with v2023.04 or earlier, especially BOOTSTD without extra CONFIGs.
With latest master branch CONFIG_BOOTSTD_DEFAULTS=y should be set by default for all ARCH_ROCKCHIP. And should work very similar to if you used to have "run distro_bootcmd" as your bootcmd.
As i use builtin-environment there is no distro_bootcmd which i can run.
It is still unclear what script/bootcmd you are trying to use, or if you used to have "run distro_bootcmd" as a fallback. Replacing "run distro_bootcmd" with "bootflow scan -lb" or "bootflow scan" could work as such fallback option.
but with "bootflow scan -lb" it works except 1 thing: old bootchain looked in config directory for the files (kernel+fdt) whereas new way looks in root of partition and now needs additional extlinux prefix.
This could be related to an issue that was fixed in v2023.07-rc5:
bootstd: Fix relative path use in extlinux bootmeth
See https://source.denx.de/u-boot/u-boot/-/commit/a7e4dffcd8c582bf4344548270d2fc...
If not then please provide more details, in case this is a bug.
thx, after rebase on rc5 it works as expected...rebased on rc4 a few hours before rc5 was relasted :p
as this commit was done by you thx for fixing this ;)
and yes i want distroboot as fallback...
is there a way to avoid this to hold the file compatible?
The intent is that the new standard boot should be as compatible as possible as the old script based distro boot, depending on you boot script.
If you use any of the script part that the old distro boot provided you will have to adjust your boot script, e.g. replace "run distro_bootcmd" with "bootflow scan -lb" or "bootflow scan", and modify boot_targets and bootmeths to control boot order.
See https://u-boot.readthedocs.io/en/latest/develop/bootstd.html#controlling-ord...
simply added this to my builtin-environment if anyone wants to run distro_bootcmd manually (was called automaticly before).
distro_bootcmd=bootflow scan -lb
now all looks good
why i use the environment bootmenu? i do a bit more in the menuitems (and before) e.g. loading a uEnv.txt to override some options and for testing. have bootargs only defined once, have testkernels with initrd and some special stuff with asking for user input (list kernels from mmc/tftp/... and let user choose which kernel/fdt/initrd/...). Such things are imho not possible with extlinux way.
I think there are some limited menu handling with standard boot, it may depend on a working video driver, something that RK356x does not have.
Regards, Jonas
currently only bpi-r2pro uses extlinux boot and the other 3 boards using the builtin environment bootmenu. So to keep all boards nearly same i want to have the same for r2pro but allow users with extlinux still using this.
basicly my Plan is to script the bootup via env in script with a bootmenu (default entry + additional ones which can be changed by an env.txt file), but i do not want to break existing setups (using extlinux/*.conf behaviour) and no additional bootmenu-entries.
The "distro" bootmeth described at the documentation you linked to will looks for a file called extlinux/extlinux.conf.
Is there a special reason why you need to use a custom bootmenu script and are moving from distro-boot (extlinux-config files)?
is there any documentation describing the "Standard boot"?
i found this, but it looks like the "old" distro-boot...or is is same from users PoV?
https://u-boot.readthedocs.io/en/latest/develop/bootstd.html%3E%3E%3E
This is the documentation for standard boot.
I recommend you try out the commands bootdev, bootflow and bootmeth with CONFIG_BOOTSTD_FULL=y to get a better handling on how it would work on your device and how you can use them in your script.
Regards, Jonas
regards Frank
participants (3)
-
Frank Wunderlich
-
Jonas Karlman
-
Simon Glass