Hi,
I use a NanoPi R5S as my OpenWrt router. This device has an onboard eMMC, an NVMe slot and an SD slot.
It has the ability to boot from eMMC or SD card, but not NVMe (SPI NOR pads present but not populated
). I am currently booting and running OpenWrt from the eMMC.
As I have reason to suspect the eMMC as having issues, is it possible to bootstrap OpenWrt on the NVME from an SD card?
wild guess, since I don't own one.
write the sysupgrade image to SD and NVME, change kernel root= param in boot loader to point to NVME instead of SD.
kernel will need to have built in NVME support to be able to load rootfs.
again, this is on a high level, Accenture kind of solution - "It worked on PowerPoint".
Thanks for the answer.
On 25.12, the nvme device is present, so it appears to be supported by the kernel. This would be apparent when booting from the SD card (whether or not I could see nvme)
How do I change the kernel root= parameter? Would that need uboot-envtools?
this is the part I can't answer, since I don't own one, but uboot-envtools is a good start indeed.
Hmm, so fw_printenv complains because it can't find /etc/fw_env.config
https://github.com/ARM-software/u-boot/blob/master/tools/env/fw_env.config gives an example for mmcblk0, but I'm not sure how to get the Device offset and Env. size
Gemini says
Commonly Used Values
Offset (CONFIG_ENV_OFFSET): Frequently set to 0x400000 (4MiB) or 0x100000 (1MiB) to avoid overlapping with bootloaders (SPL/U-Boot) at the start of the disk.
Size (CONFIG_ENV_SIZE): Commonly 0x20000 (128KiB) or 0x4000 (16KiB).
Redundant Environment: If used, CONFIG_ENV_OFFSET_REDUND is required to specify a backup location
lsblk shows
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 14.5G 0 loop /overlay
mmcblk1 179:0 0 14.6G 0 disk
├─mmcblk1p1 179:1 0 16M 0 part
└─mmcblk1p2 179:2 0 14.5G 0 part /rom
mmcblk1boot0 179:32 0 4M 1 disk
mmcblk1boot1 179:64 0 4M 1 disk
nvme0n1 259:0 0 465.8G 0 disk
└─nvme0n1p1 259:1 0 465.7G 0 part
So I'm guessing a basic /etc/fw_env.config could contain
/dev/mmcblk1 0x400000
but what about the Env. size? How do I determine that?
EDIT: i see in lsblk, that it's the size being reported (as 4M), so Env. size could be 0x400000, so what is the offset?
Have tried lsblk -t and dump.f2fs /dev/mmcblk1
EDIT2:
Do I need to mount mmcblk1root0 to change the kernel parameters?
echo 0 > /sys/block/mmcblk1boot0/force_ro
losetup -o $(($STARTLBA * 512)) /dev/loop1 /dev/mmcblk1boot0
for example?