bootloader menu to pick a kernel - what is the current situation in in early 2022?
Hi all. I'm trying to compile and boot a custom kernel on my PineBook Pro. Trying to add some printk instrumentation to troubleshoot a type C hotplug issue I'm having, but I'm getting stuck even getting the kernel to boot at all. I don't want to outright replace my stock kernel, I just want to be able to pick the kernel I want at boot time. Ideally I would want to stick to the principle of a 100% free software (or close to it) process, and using a second computer with a serial cable is not attractive to me.

I am reluctant to try any option that makes my custom kernel the default, unless I also have a working boot menu that lets me pick the stock kernel.

I am using the manjaro OS that came preinstalled, fully updated. I am using the default partition map and bootloader.

I have tried editing my /boot/extlinux/extlinux.conf to look like this:
Timeout 10

MENU TITLE pick a kernel

FDT /dtbs/rockchip/rk3399-pinebook-pro.dtb
APPEND initrd=/initramfs-linux.img console=tty1 console=ttyS2,1500000 root=LABEL=ROOT_MNJRO rw rootwait video=eDP-1:1920x1080@60 video=HDMI-A-1:1920x1080@60 bootsplash.bootfile=bootsplash-themes/manjaro/bootsplash

FDT /dtbs/rockchip/rk3399-pinebook-pro.dtb
APPEND initrd=/initramfs-custom-instrumentation.img console=tty1 console=ttyS2,1500000 root=LABEL=ROOT_MNJRO rw rootwait video=eDP-1:1920x1080@60 video=HDMI-A-1:1920x1080@60 bootsplash.bootfile=bootsplash-themes/manjaro/bootsplash
This doesn't seem to do anything, just boots right into the stock kernel. I also tried spamming control-C or the arrow keys at boot time, this made no difference, no menu shows up. As I mentioned earlier I am reluctant to change the DEFAULT setting since it might make the system unbootable.

I have also tried using the kexec method. I wrote this script:
#! /bin/sh
sudo kexec -l /boot/vmlinux-5.17.0-rc1-CUSTOM_INSTRUMENTATION+ --initrd=/boot/initramfs-custom-instrumentation.img --reuse-cmdline

# I tried both of these versions:
#sudo systemctl kexec
sudo kexec -e
It's hard to tell what the hardware is doing on a fanless system, but it appears to just power off the computer when I run the script. Then, when I power it on, I just get a blank screen. I can then hard reset and power it on again, and it boots back into the stock kernel.

I found some prior forum threads on this subject, but it looks like the situation is evolving rapidly and the info there might not be up to date.
I'm doing kernel selection for more than a year so it's definitely possible. The biggest obstacle before was lack of display support in uboot but patches existed and since uboot 2021.07 it is mainlined. Things worth checking
  1. Try adding "menu label" entry under "label" (if I remember correctly it didn't work without it)
  2. Check your uboot version (some ancient versions of uboot didn't support extlinux.conf though I would be surprised if it was used for Pinebook Pro)
  3. Make sure partition with extlinux.conf is used: needs to be marked as active and device holding partition needs to be ordered accordingly in boot_targets var in uboot
Another option: clone your system to a fast SD card.  Boot from it and make sure it works properly.  When the SD boot works well,  move the custom kernel into place on the SD card and boot from it to test your kernel. 

1.  leaves your EMMC boot untouched!   
2. Backout is remove the SD card and reboot: dead simple.
3. Retry is fix your custom kernel, copy into place on the SD card, and try again.

Way less stress, dead simple, portable, and repeatable.
Ancient teacher (Secondary Field Science/Math), Warrior (USARNG- RET SSG), and IT warrior (30+ years Coder, Network/Systems Administrator, general house geek). 
Pinebook Pro user (Debian, Manjaro)
Those are some good breadcrumbs, thanks! I'll report results this weekend.
Partial success!

I did add the MENU LABEL lines to extlinux.conf, but I am not sure whether that was actually needed.

What made the difference in the end was switching from "uboot-pinebookpro-bsp" to "uboot-pinebookpro" ("pacman -S uboot-pinebookpro" and then follow the directions that get printed on the command line.)

This gets me a bootloader menu to pick a kernel like I wanted, and it can boot the stock kernel successfully. Unlike some of older reports I found on the forums, in my experience, switching to mainline u-boot did not make booting unreliable and suspend works fine.

When I pick my custom kernel, I get the same blank screen behavior that I saw with the kexec method, but I guess that just means there's something wrong with my kernel and I can troubleshoot that separately. I have the bootloader behavior I wanted, so I'll mark this thread as solved.

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to mainline kernel on daniel thompson's debian installer? hellojack 14 8,127 09-07-2023, 09:38 PM
Last Post: Der Geist der Maschine
  kernel module that supports usb-c hdmi alexandre 16 15,311 05-14-2023, 09:58 PM
Last Post: rathofkhan3
  Suspend/Resume Broken with Bootloader on SPI Flash xp19375 2 1,309 03-24-2023, 04:25 PM
Last Post: srs5694
Question Debian (Vanilla) no output on display after Kernel update (6.0.8-1) as365n4 1 1,379 12-09-2022, 12:43 PM
Last Post: as365n4
  Bootloader: SD card boot quirks crazyquark 1 1,168 10-04-2022, 12:27 PM
Last Post: elitegamercody
Question Twister OS on PBP (2022) crusaderoath 9 3,814 09-22-2022, 11:44 PM
Last Post: wdt
  Manjaro PBP stable update 2022-06-19 bricked wpeckham 2 1,793 06-30-2022, 10:03 PM
Last Post: wangyukunshan
  Kernel panics solostian 17 14,902 01-26-2022, 08:08 AM
Last Post: TRS-80
  Kernel 5.17 will improve VP9 support? jiyong 1 2,282 01-16-2022, 08:26 PM
Last Post: xmixahlx
  red/green power led not working with kernel 5.14 alchemist 4 4,012 11-04-2021, 04:09 AM
Last Post: alchemist

Forum Jump:

Users browsing this thread: 1 Guest(s)