Grub on BPI-R2: kernel starting problem

Hi everyone.

Just wondering if anyone has tried to run OS using GRUB, and if it was successfull?

For now i’ve installed grub (u-boot 2020-01-bpi-r2 from Frank’s repo), i’m able to run it, but i can’t load linux kernel ftom grub.

u-boot env for grub run:

...
boot19=load mmc 0:1 ${loadaddr} /grub/arm-uboot/core.img; bootm ${loadaddr}
...
bootmenu_4=5. Run GRUB.=run boot19 
...

Grub Menu:

GNU GRUB  version 2.05_alpha20200110                                                                                                                                                                                          
                                                                                                                                                                                                                                                   
+----------------------------------------------------------------------------+                                                                                                                                                                     
|*Gentoo GNU/Linux                                                           |                                                                                                                                                                     
| Advanced options for Gentoo GNU/Linux                                      |                                                                                                                                                                     
|                                                                            |                                                                                                                                                                     
|                                                                            |                                                                                                                                                                     
|                                                                            |                                                                                                                                                                     
|                                                                            |                                                                                                                                                                     
|                                                                            |                                                                                                                                                                     
|                                                                            |                                                                                                                                                                     
|                                                                            |                                                                                                                                                                     
|                                                                            |                                                                                                                                                                     
|                                                                            |                                                                                                                                                                     
|                                                                            |                                                                                                                                                                     
+----------------------------------------------------------------------------+                                                                                                                                                                     
                                                                                                                                                                                                                                                   
     Use the ^ and v keys to select which entry is highlighted.                                                                                                                                                                                    
     Press enter to boot the selected OS, `e' to edit the commands                                                                                                                                                                                 
     before booting or `c' for a command-line.

cgub.cfg:

menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-4d920cff-b900-40c2-90c8-ffc716a6656f' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod fat
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  4449-36D1
        else
          search --no-floppy --fs-uuid --set=root 4449-36D1
        fi
        echo    'Loading Linux 5.5.0-rc1-arm+ ...'
        devicetree /bpi-r2.dts
        linux   /vmlinuz-5.5.0-rc1-arm+ root=UUID=4d920cff-b900-40c2-90c8-ffc716a6656f ro root=/dev/sdb1 rootfstype=ext4 rootwait console=earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-5.5.0-rc1-arm+.img
}

root=UUID=4d920cff-b900-40c2-90c8-ffc716a6656f ro root=/dev/sdb1 - are the same drive

/etc/default/grub:

GRUB_DISTRIBUTOR="Gentoo"

GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

GRUB_DEFAULT=0

GRUB_TIMEOUT=5

GRUB_CMDLINE_LINUX="root=/dev/sdb1 rootfstype=ext4 rootwait console=earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200"

Kernel is my 5.5-merged-lima branch based on Frank’s 5.5-merged. It runs w/o any problebs when built by build.sh script for u-boot.

After attempt to boot it prints Loading Linux 5.5.0-rc1-arm+ ... halts for 3-5 secs and resets.

P.S. Looks like uboot has some type of watchdog and restart board after some period of inactivity, if it’s really u-boot, where can i edit timeouts?

uboot has watchdog timeout, but it is ~20 sec of inactivity and shows message before do the reset…

have not tried using grub because one bootloader is enough for me :wink: what do you want to archive with it?

More familiar environment for me, no u-boot image ‘magic’,no uboot env - easy to update kernel, easy to use initramfs(useful for mdadm, zfs, dmraid, etc), new experience :wink:

Where can I disable it or edit timeout? Not very convinient when r2 reboots during reading manuals :slight_smile:.

I didn’t catched the message.

maybe by disabling the watchdog-driver…imho timeout cannot be increased

if not maybe you can start timer again if it is timed-out

1 Like

It is hardware timer. You should put grup to update watchdog timer regular interval. I don’t know how but I guess that broblem is solved in grub somehow.

1 Like