Booting - User device selection in U-Boot?
#1
One of the issues that comes up is that we can't easily select what device to boot during startup.
U-Boot does not have that option for us, yet. During testing, I've had to remove and insert the
MicroSD card far too many times. It would be nice if I could leave it installed and force booting
something else.


So, how about something like this?

U-Boot selectable device target:
        - Pause & blink LED, (which one?), for a short time, (5 seconds?)
        - During this time, accept keyboard input
        - Select boot device of:
                - eMMC, (number 1?)
                - MicroSD card, (number 2?)
        - Timeout default using current scheme, MicroSD if installed, eMMC otherwise.

The exact keys for which devices are not really important. And if NVMe or USB booting works fine
then those could be added as well. Plus, allow changing the default boot order at install time, (so
people with NVMes could be a priority over eMMC).

Plus, perhaps having the ESC and Enter keys immediately jump to the default action. So a way to
skip the pause.

As time goes one, perhaps we can add a primitive text menu on the screen.


At present, this idea does not care where U-Boot is installed, (SPI, eMMC, MicroSD card). For
testing, it probably easiest to have it on a eMMC or MicroSD card. This idea is to address which
device we use for "/boot".

So, what does anyone else think?

Perhaps someone has a better idea?

Does using Grub as a target allow boot chaining?
(Meaning a grub menu entry can say go to another device.)
--
Arwen Evenstar
Princess of Rivendale
  Reply
#2
I think the petitboot bootloader (also used on some POWER systems) would be a good fit here: https://github.com/open-power/petitboot.

It's a small linux program that scans all connected drives for grub, syslinux, etc. boot configurations and presents them in an ncurses TUI. It uses the kernel's kexec facility to boot the selected OS, so it should work OOTB on arm64.
  Reply
#3
(05-16-2020, 01:44 PM)Arwen Wrote: U-Boot selectable device target:
        - Pause & blink LED, (which one?), for a short time, (5 seconds?)
        - During this time, accept keyboard input
        - Select boot device of:
                - eMMC, (number 1?)
                - MicroSD card, (number 2?)
        - Timeout default using current scheme, MicroSD if installed, eMMC otherwise.

This reminds me of how Qi used to work on OpenMoko phones. While not quite convenient it was functional and would certainly be an improvement on the current u-boot situation on the pinebook pro.
  Reply
#4
using the uboot priority mapped to numbers would be great. usb, sd, nvme, emmc = 1 2 3 4 etc.

selectable ala grub would be useful for multiple installed kernels on a single device. most usable for testing.

either would be a huge improvement.
  Reply
#5
Yes, either Grub with menu, or the simple U-Boot device selection would work.
People doing testing could then select which OS to boot. If it fails, no problem,
just reboot and select the working OS and make a change to the one under
test. Then try again.

At present, I don't see Grub getting both text menu, (on the LCD), and keyboard
support, (also the PBP keyboard, not serial console), any time soon. Grub seems
to support such for x86/x64, but that is likely through BIOS calls that don't exist
for any ARM computer.

Thinking about it, I've added ESC & Return keys to the original post, to do the
obvious thing.
--
Arwen Evenstar
Princess of Rivendale
  Reply
#6
(06-08-2020, 09:55 AM)Arwen Wrote: Yes, either Grub with menu, or the simple U-Boot device selection would work.
People doing testing could then select which OS to boot. If it fails, no problem,
just reboot and select the working OS and make a change to the one under
test. Then try again.

At present, I don't see Grub getting both text menu, (on the LCD), and keyboard
support, (also the PBP keyboard, not serial console), any time soon. Grub seems
to support such for x86/x64, but that is likely through BIOS calls that don't exist
for any ARM computer.

Thinking about it, I've added ESC & Return keys to the original post, to do the
obvious thing.

I got the PBP keyboard to work with u-boot and grub (using the arm64-efi target). It's as simple as adding a few flags when compiling u-boot to instruct it to enable the necessary USB support, and having "usb start" as part of the boot script (note this does slow down the boot by a second or two). Unfortunately the menu only displays over a serial console since u-boot doesn't know how to initialize LCD.

If anyone has any pointers on how to port the LCD/eDP drivers that linux uses to u-boot I'd love to hear it. The code for both are sooo similar, and unfortunately I wasn't smart enough to figure out the right combination of edits to the u-boot code to make it work (can only make the screen briefly flicker).
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] U-Boot with NVMe support, keyboard & display working as400 55 7,159 Yesterday, 04:52 AM
Last Post: as400
Tongue An introduction from Paulie420; PBP user Paulie420 2 157 09-19-2020, 01:06 PM
Last Post: Paulie420
Lightbulb Booting from SD card CalmMopey 8 253 09-17-2020, 08:23 AM
Last Post: wdt
  U-Boot on SPI flash - discussion Arwen 20 2,210 09-16-2020, 08:20 AM
Last Post: hmuller
  Am I supposed to flash keyboard firmware and u-boot imgs? superkazuya 4 412 09-02-2020, 04:12 AM
Last Post: pfeerick
  PBP won't boot (no amber or green LED) ian-s-mcb 29 1,571 08-31-2020, 06:23 PM
Last Post: ian-s-mcb
  PBP does not boot: broken boot partition barn 9 746 08-21-2020, 01:51 AM
Last Post: gimy16
  U-Boot with direct NVMe boot support for eMMC/SPI Flash pcm720 109 37,653 07-22-2020, 12:49 PM
Last Post: mamboman777
  Booting OS from SD card: consistency issue pivic 8 627 07-21-2020, 09:46 AM
Last Post: pivic
  Orange light won't boot>>>PineBook Pro user1gokou 4 497 07-10-2020, 03:04 PM
Last Post: KC9UDX

Forum Jump:


Users browsing this thread: 1 Guest(s)