L5 Phone Dual boot

While still waiting for my phone, I’d like to connect an R Pi storage and dual boot the phone. Has anyone done this, or is it at all possible?

Thank you.

Do you mean you want to boot PureOS that is built for the Librem 5 on a Raspberry Pi?

Or you are asking a hypothetical question about booting Raspbian that is built for the Raspberry Pi on the Librem 5 that you don’t have yet?

My guess is that it is theoretically doable but won’t work out-of-the-box because the peripheral components are somewhat to very different, depending on the exact config of the Pi. (For example, if the Pi has an external display connected via HDMI then PureOS won’t have the needed HDMI blob but if the Pi is using a display connected via DSI then … maybe.)

Then there are the differences in the pre-boot environment.

If you want to play around with this kind of thing, the following article gives the flavour of the degree of difficulty: https://hechao.li/2021/12/20/Boot-Raspberry-Pi-4-Using-uboot-and-Initramfs/

1 Like

The bootloader (u-boot) must run from eMMC, there’s no way around that (aside of uploading it via USB with uuu each time you boot, but that’s not exactly practical). However, once you’re in u-boot, you have access to SD card, so you can run kernel+initrd+dtb from there.

It should be also possible to access an external storage connected through USB-C port in u-boot, but I don’t think anyone has ever tried to do that so far. It may need some patching to put the USB controller into host mode.

Oooh, regarding the u-boot to SD card startup, that sounds exactly what I want. ie test other OSs running off SD card, while leaving PureOS alone. Before I start reading up on the details, do you know if there is a procedure or summary documented somewhere?
Thanks,

With recent enough u-boot, you should be able to simply put an image into the SD card and run it by holding Vol- button during boot.

Beware that if you put the same image into eMMC and SD, you’ll end up with partitions with duplicated UUIDs, which may cause unexpected behavior during mounting :wink:

3 Likes

What versions are recent enough?
Also how can u-boot be updated? (Sorry if this is a dumb question, I got my Librem 5 only yesterday and am still reading the documentations)

purism@evergreen:~$ cat /proc/cmdline 
u_boot_version=2022.10-g9d134279b6 console=ttymxc0,115200 quiet fsck.repair=yes security=apparmor splash plymouth.ignore-serial-consoles vt.global_cursor_default=0

You want a version that starts with 2022.10. If you got it yesterday, it sure is going to be recent enough.

To update you can either reflash a recent image, or install a deb from CI artifacts at https://source.puri.sm/Librem5/uboot-imx and invoke sudo u-boot-install-librem5 /dev/mmcblk0 afterwards.

1 Like

I guess it’s badness then if the output from cat /proc/cmdline doesn’t even include u_boot_version=... :wink:

My L5, delivered in December, has u_boot_version=2019.04… I followed your link, but did not find any .deb file. :grimacing:

It’s right there at the latest commit: https://source.puri.sm/Librem5/uboot-imx/-/jobs/406070/artifacts/browse/debian/output/

(note that this URL points to a specific pipeline/commit and may get outdated with time)

2 Likes

Artifact availability and potentially buggy albeit passing jobs are primary reasons why I prefer to publish verified milestone builds as releases and share links to the associated project release page.

Perhaps Purism should build a utility similar to Titanium Backup, for the Librem 5. Just something that boots and provides a selection of available operating systems to boot in to is all that is needed. I would suggest GRUB but that might be bad on Security by the time someone gets it working on the Librem 5.