First of all - thanks a lot @Radiation_Joe , just received my ext. board - fast shipping, perfect packaging, everything’s working:
Second - you don’t need any additional bootloader magic or custim initramfs to have simple way of dual-boot and fast switching betweentwo different os installations as @adcockm wants - uConsole perfectly boots from USB port attached directly to CM4. This my setup:
- Prepare SD card with with working Debian (like @Rex 's Bookworm -lite- image) and boot into it.
- Insert USB flash drive you are going to use as external storage
- check storage devices with
lsblk
. SD card appears as/dev/mmcblk0
USB flash appears as/dev/sda
- Copy SD card you booted from to USB drive:
sudo dd if=/dev/mmcblk0 of=/dev/sda bs=4M status=progress
- Verify CM4 boot-order options:
$ sudo rpi-eeprom-config
[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
# Try SD first (1), followed by, USB PCIe, NVMe PCIe, USB SoC XHCI then network
BOOT_ORDER=0xf25641
# Set to 0 to prevent bootloader self-updates (without recovery.bin)
# For remote units EEPROM hardware write protection should be used.
ENABLE_SELF_UPDATE=1
# Set to 1 to disable the bootloader HDMI diagnostics screen AND
# network install e.g. for kiosk devices.
DISABLE_HDMI=0
BOOT_ORDER looks fine to us.
6. Power off uConsole, remove SD card, boot without it (it boots from USB):
7. Insert your regular SD card (like full desktop image) - it boots from SD card if present:
My SD card I copied Debian onto USB flash is smaller than USB, so, I’ll re-partition the remaining USB flash space to use as shared data partition.
NB:
a) Yes, these ugly insulated 18650 cells are from old Tesla battery. USB flash drive draws hell lot of peak current during boot, may not boot from weak batteries, you may need to boot on charger if yours are the case.
b) Avoid using the same image for booting off SD card as you have on USB flash - their partitions have the same ID, and USB storage devices appear higher in the list, you may end up having /boot/firmware you are booting from mounted on SD, but /root on USB (or you may modify partitions ID’s on USB, to not clash with inter-change’able SD ID’s)