extlinux bootloader
#1
Hello Piners

Which bootloader shipped with the "january" dispatch of PBP, with default debian mate?  Extlinux? 

When I looked in /boot, I saw directory called extlinux, and in that was file "extlinux.conf," whose contents reminded me of uefi on x64, because of the append line.

I noticed it had entries for PINEBOOKPRO, and PINEBOOKPRO-prev-kernel.

Without any docs, I intuitively created another entry for PINEBOOKPRO-SLARM64, and changed the append line to root=/dev/mmcblk0p2, as well as changed the default to my new entry, and adding slarm64 to the menu line.

I was kind of amazed that it worked, and booted slarm64 (unofficial slackware for arm) from the microsd (still using the kernel image and dtb that shipped).


I see lots of posts and instructions about flashing u-boot to SPI, but that doesn't seem necessary to boot from microsd.

On x64, most hardware have some kind of key that you can hold down during boot to bring up a boot menu.

Does this extlinux bootloader have a way to bring up its menu like that?  It has an entry  in extlinux.conf called menu.  It looked like this:

Code:
menu title boot prev kernel

but when booting, I never saw a menu, and I lucked out because the default worked.  But if I wanted to try PINEBOOKPRO-prev-kernel, how would I select it at boot time?  I tried "TAB" and "ESC" and "F2" and "F10" and then gave up guessing.

Perhaps such a boot menu would only be available over the serial console, for which I haven't ordered the cable yet.

It is booting the way I want for the moment, but I would like to understand more about extlinux.  It has a website, but I didn't see anything about the boot menu there.

Does anyone know a way to manually select target at boot time (with this extlinux bootloader that shipped)?
#2
The PBP uses (a modified, I believe) Das U-Boot. The SoC doesn't require anything to boot from SD, but it's last in the boot order. One of the modifications to U-Boot for the PBP is placing the SD before the eMMC in boot priority. There are a few images using an older mainline U-Boot, that does not prioritize the SD. However, most don't use that U-Boot version, and will boot an image from SD so long as you insert it before booting. No changes to conf files necessary.

I believe the only way currently to enable and view to the U-Boot menu would be through UART. (Be sure to search the forums and read carefully on this, as the UART cable in the store will cause problems with the PBP. You'll need a cable that's 3.3v not 5v.)

IIRC, video drivers would have to be added to U-Boot to see the boot menu. It might be worth waiting for cyrstalgamma's levinboot (a replacement bootloader.)
#3
Thanks, tophneal, for the tip about the 3.3V UART cable -- I would have been victimized by the 5v version in the store for sure, cause it says pinebook-- they ought to make it clear that it's not for pinebook pro up there.

I have noticed that these pine64 devices are not the same from release to release:  my January dispatch PBP has the debian-mate; but the next dispatch is shipping with manjaro; the pinephone turned from a distro-neutral "braveheart" to a distrocentric "UBports".   With the /boot/extlinux folder present on my PBP,  it seemed feasible to wonder whether the debian/mate developers of the January dispatch tried a new bootloader on the PBP.

My PBP definitely arrived with a /boot directory, and in that directory was folder called "extlinux," and in there was "extlinux.conf".  The contents of /boot/extlinux/extlinux.conf , before I touched it, are as follows:

Code:
root@Debian-Desktop:~#   cat /boot/extlinux/extlinux.conf

timeout 10
default PINEBOOKPRO
menu title boot prev kernel

label PINEBOOKPRO
 kernel /Image
 fdt /rk3399-pinebookpro.dtb
 append consloe=ttyS2,1500000n8 rw root=/dev/mmcblk1p2 rootwait rootfstype=ext4 panic=10 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#} cgroup_enable=cpuset cgroup_memory=1  cgroup_enable=memory swapaccount=1 zswap.enabled=1 video=HDMI-A-1:1920x1080@60 video=eDP-1:1920x1080@60 quiet loglevel=3 vga=current

label PINEBOOKPRO-prev-kernel
 kernel /Image.bak
 fdt /rk3399-pinebookpro.dtb.bak
 append console=ttyS2,1500000n8 rw root=/dev/mmcblk1p2 rootwait rootfstype=ext4 panic=10 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#} cgroup_enable=cpuset cgroup_memory=1  cgroup_enable=memory swapaccount=1 zswap.enabled=1 video=HDMI-A-1:1920x1080@60 video=eDP-1:1920x1080@60 quiet loglevel=3 vga=current

Never having seen or heard of extlinux.conf, I searched for it with swisscows.ch, and yielded these fine links:

http://shallowsky.com/linux/extlinux.html
https://superuser.com/questions/743802/h...h-extlinux
https://linux.die.net/man/1/extlinux

All of this looks like the extlinux.conf file that was on my PBP, and none of it looks like Das U-Boot.  Perhaps Das-Uboot is on there as well, and there are two bootloaders.  Is that possible?  

So what I did to get my microSD card boot was as follows:
  • inserted blank 64GB microSD which the sytem recognized as /dev/mmcblk0
  • used dd like this:    dd if=/dev/mmcblk1 of=/dev/mmcblk0 status=progress  (I only waited for a few hundred MB to transfer, and then used ctrl-c to cancel). This, I figured transferred whatever bootloader is on there to the microSD card as well as the partition table.  
  • used fdisk to remove the second partition, because it was a copy of the internal mmcblk1p2, which was on a 128GB card instead of my 64G, so it was too big.  I just deleted the second partition, then added it again, and wrote the partition table
  • used mkfs.ext4 to create an ext4 file system
  • created a mountpoint for the microsd called /dragon  (because I like dragons), and then mounted this new ext4 partition to /dragon
  • created the directory /dragon/boot, and mounted /dev/mmcblk0p1 there (the clone of what was on the internal sdcard's first partition).
  • downloaded Pat.Volkerding's "installpkg" script from slackware, and made a symlink from /usr/bin/du to /bin/du, because P.V.'s script calls /bin/du, but debian has du at /usr/bin/du.
  • downloaded slarm64-current
  • then I installed slarm64 to /dragon, using the installpkg script, with the flag --root /dragon.
  • then I did the mount -o bind for /proc and /sys to /dragon/proc and /dragon/sys
  • I copied /etc/fstab, /etc/hosts, and /etc/resolv.conf to /dragon/etc/
  • then I chrooted into /dragon and changed the hostname, and gave the root user a password, and, very importantly, I edited /boot/extlinux/extlinux.conf, and I added a label for SLARM64, which was identical to the PINEBOOKPRO label, except that the root device was changed to /dev/mmcblk0p2; I also changed the default to SLARM64.
After exiting the chroot and rebooting, slarm64 on the microSD booted.  

I don't know how it would have booted without editing extlinux.conf.  I might have made /var or /tmp at /mmcbk0p2, and had the rootfs at /mmcblk0p3 -- how would the bootloader know which partition on my microSD card contains the rootfs, if I don't tell it?  

I'm happy.  The unofficial port of Slackware to arm64, Slarm64, is booting on my PBP.  But as far as I can tell, it's using extlinux, and not das-uboot. 

Do you have a "/boot/extlinux/extlinux.conf" on your PInebookPro?

Just trying to figure this extlinux stuff out.  As far as I can tell, I made a bootable microSD without ever touching das U-Boot.
#4
>As far as I can tell, I made a bootable microSD without ever touching das U-Boot.
But you did, your aborted dd, 16MB since spi chip is 128Mb
idbloader at 64 sectors, uboot at 8M, ATF (maybe) at 12M, user partitions at 16M, 32768 sectors
It fooled me too, nothing to do with syslinux despite the same name
Just another interface to uboot, instead of boot.txt/boot.scr or uEnv.txt/boot.something/boot.scr (armbian)
You can try to get boot selection,, from odroid forum
https://forum.odroid.com/viewtopic.php?t=26894
Let us know how it works out
Great to get slack going
Please note,, some uboots do NOT flip boot order, chip default is spi, emmc, uSD, usb for program load
If emmc is before uSD, you can not boot uSD


Possibly Related Threads…
Thread Author Replies Views Last Post
  Suspend/Resume Broken with Bootloader on SPI Flash xp19375 2 1,086 03-24-2023, 04:25 PM
Last Post: srs5694
  Bootloader: SD card boot quirks crazyquark 1 1,000 10-04-2022, 12:27 PM
Last Post: elitegamercody
  bootloader menu to pick a kernel - what is the current situation in in early 2022? maxtothemax 4 3,025 02-05-2022, 03:04 PM
Last Post: maxtothemax
  extlinux.conf file error, can it be edited in bootloader? Abandoned Brain 2 2,486 09-26-2021, 01:28 PM
Last Post: Abandoned Brain

Forum Jump:


Users browsing this thread: 1 Guest(s)