Jump to content

use extlinux.conf as boot menu for armbian with mainline u-boot


ning
 Share

Recommended Posts

mainline u-boot can read boot menu from extlinux.conf, and provides a menu to console or display (if support), which is more friendly to boot.scr

and debian provides a tool: u-boot-menu to update extlinux.conf.

 

in order to use u-boot-menu in armbian, need to update kernel build scripts, need to follow debian's build rules. or make change to u-boot-menu to fit armbian's kernel.

 

 

Link to comment
Share on other sites

Search Before Posting!

57 minutes ago, ning said:

mainline u-boot can read boot menu from extlinux.conf, and provides a menu to console or display (if support), which is more friendly to boot.scr

and debian provides a tool: u-boot-menu to update extlinux.conf.

 

in order to use u-boot-menu in armbian, need to update kernel build scripts, need to follow debian's build rules. or make change to u-boot-menu to fit armbian's kernel.


Can you estimate how much work is behind to get this properly implemented?

Link to comment
Share on other sites

there 2 different way to enable extlinux.conf

 

1, manually write extlinux.conf

       this is easy, not much work, just replace current boot.src. and armbian kernel image name is same when kernel upgraded, as I can remember.  so just one time job. if not need to use postins script to update extlinux.conf. and for switch kernel from current --> dev, also need handle update extlinux.conf.

       so how to handle extlinux.conf is major work. 2 scripts for postinst and postrm.

 

2, use u-boot-menu to update extlinux.conf automatically.

       currently armbian kernel doesn't compact to this tool, so huge work. not recommend. I have tried this. due to I rebuild my kernel use debian's build rules. you can read my post in "common issues"

 

for both methods, another thing needs to take care is nand-sata-install script, need to take care rootdev UUID update for extlinux.conf.

and for image create, need manually create extlinux.conf

 

summary:

1, create extlinux.conf during image create.   need family template.

2, extlinux.conf update in nand-sata-install.   need update nand-sata-install script.

3, extlinux.conf update when kernel update.  need postinst/postrm scripts

4, extlinux.conf update when switch kernel between branch. need postinst/postrm scripts

 

 

Link to comment
Share on other sites

Quote

ning@kvim1:~$ cat /boot/extlinux/extlinux.conf
## /boot/extlinux/extlinux.conf
##
## IMPORTANT WARNING
##
## The configuration of this file is generated automatically.
## Do not edit this file manually, use: u-boot-update

default l0
menu title U-Boot menu
prompt 0
timeout 50


label l0
        menu label Debian GNU/Linux kernel 5.6.0-1-arm64
        linux /boot/vmlinuz-5.6.0-1-arm64
        initrd /boot/initrd.img-5.6.0-1-arm64
        fdtdir /usr/lib/linux-image-5.6.0-1-arm64/
        append root=UUID=7a3fee0f-6d0c-40f7-9310-2194006e3473 ro quiet

label l0r
        menu label Debian GNU/Linux kernel 5.6.0-1-arm64 (rescue target)
        linux /boot/vmlinuz-5.6.0-1-arm64
        initrd /boot/initrd.img-5.6.0-1-arm64
        fdtdir /usr/lib/linux-image-5.6.0-1-arm64/
        append root=UUID=7a3fee0f-6d0c-40f7-9310-2194006e3473 ro single

 

Link to comment
Share on other sites

extlinux.conf supports include another conf file, I don't know how to use it.

 

extlinux.conf doesn't have key words to support dtbo load, can have a patch..

Link to comment
Share on other sites

Quote

commit 69076dff2284ed099cc0583e5e64bd8012d1ab5c
Author: Neil Armstrong <narmstrong@baylibre.com>
Date:   Wed Jan 20 09:54:53 2021 +0100

    cmd: pxe: add support for FDT overlays
    
    This adds support for specifying FDT overlays in an extlinux/pxelinux
    configuration file.
    
    Without this, there is no simple way to apply overlays when the kernel
    and fdt is loaded by the pxe command.
    
    This change adds the 'fdtoverlays' keyword for a label, supporting multiple
    overlay files to be applied on top of the fdt specified in the 'fdt' or
    'devicetree' keyword.
    
    Example:
      label linux
        kernel /Image
        fdt /soc-board.dtb
        fdtoverlays /soc-board-function.dtbo
        append console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait
    
    This code makes usage of a new variable called fdtoverlay_addr_r used to load
    the overlay files without overwritting anything important.
    
    Cc: Tom Rini <trini@konsulko.com>
    Cc: Andre Heider <a.heider@gmail.com>
    Cc: Jernej Škrabec <jernej.skrabec@siol.net>
    Cc: Jonas Karlman <jonas@kwiboo.se>
    Tested-by: Jernej Škrabec <jernej.skrabec@siol.net>
    Reviewed-by: Jernej Škrabec <jernej.skrabec@siol.net>
    Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>

 

 

I find this comment in u-boot, this means extlinux.conf supports dtbo. extlinux is much friendly.

Link to comment
Share on other sites

2 hours ago, ning said:

this means extlinux.conf supports dtbo

That's true. However, each platform must also define fdtoverlay_addr_r in default environment. Patches for amlogic and allwinner exist on ML, but I'm not sure for others.

Link to comment
Share on other sites

 Share

×
×
  • Create New...