Just some notes on what I’m looking at so this can be tracked by anyone reading. This is not “everything needed”, and I believe this will not be a quick answer. I am basically researching and then using you to test the research result, so I have no doubt this will be stressful and time-consuming.
Before you read all of this, it is possible that if you save your new initrd-4.9.201-fixed-tegra.img
somewhere safe, run the script you found earlier, and then drop your initrd-4.9.201-fixed-tegra.img
back in place, things might “just work”. You’d also have to make sure your extlinux.conf
“INITRD
” line still points at your initrd. It is certainly the easiest thing to test. Beyond that, what follows is more or less just a set of incomplete notes. What to do with those notes depends on the result of your new initrd-4.9.201-fixed-tegra.img
in combination with the script you tried earlier. FYI, you should probably also save a safe copy of “/boot/Image
” prior to running that script, perhaps copying it to “/boot/Image-original
”, and in your extlinux.conf
, changing any listing of "Image
for “Image-original
”…that way it won’t matter if the script overwrites the kernel. You could at any time edit extlinux.conf
and have it pick the old or new kernel (the file “Image
” is the kernel). Let me know how that works, then read below if you have some patience.
Also, perhaps editing the initrd the script produces to add the original Nano’s modules and the overlay module into the script-generated initrd might be enough. Case 1, test with the non-script-generated initrd-4.9.201-fixed-tegra.img
and kernel Image
; case 2, test with the script-generated initrd
after editing that initrd to include the missing modules.
Now for the part I’d wait to read only if the above fails…
First, I doubt that there are any other changes required for the initrd since it is loading the overlay module now (verify on the “failed” boot to the new overlayfs attempt that “lsmod
” shows the overlay module…if so, then probably no other OverlayFS changes are needed in the initrd, but no guarantee.
There is a line in the initrd which could be edited to provide better logging information. Near the top of the initrd file “init
” there is this: “export debug=
”. This could be edited with “export debug=y
” for more debug logging within the initrd.
Regarding the scripts you mentioned earlier, I suspect the failures are in the part where it is creating the initial ramdisk, while the rest of the script is “mostly” ok. These scripts are probably out of date with respect to current L4T release boot content within the initrd on the SD card model of Nano. Being sure would take some significant time to research it, but other non-initrd steps can be performed first to avoid such effort and it might “just work” after non-initrd changes.
What I do wish I had right now is the output “cat /proc/cmdline
” on any Jetson of any release version which has a working OverlayFS. This would be an enormous speed boost for research. Does anyone here have a “/proc/cmdline
” from a Jetson with OverlayFS? Or even from a PC with OverlayFS?
For reference, here is your current /proc/cmdline
:
tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,4 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1075 core_edp_ma=4000 gpt tegra_fbmem=0x800000@0x92ca9000 is_hdmi_initialised=1 earlycon=uart8250,mmio32,0x70006000 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0
The parts of interest (an excerpt of above):
root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 ...
... root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4
The root=
specification is listed twice, and normally only the last of the copied arguments matter. The first copy is likely from earlier boot stages, and might be accessed during initrd, so “usually don’t matter” might actually matter. It is confirmed from the boot log prior to the Linux kernel loading that read-write is first specified in the initrd. Here is an excerpt of the log prior to Linux loading:
[0004.569] boot image cmdline: root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0
[0004.582] Updated bootarg info to DTB
At minimum the “rootfstype=ext4
” needs to change to “overlay
”. Other arguments need to be added equivalent to this (some setup is no doubt required for creating those directories as an overlay system):
mount -t overlay overlay -o lowerdir=/lower,upperdir=/upper,workdir=/work /merged
…but I do not have experience with OverlayFS so I’m not sure how to do that from the initrd and extlinux.conf. Perhaps it is as simple as changing this excerpt in extlinux.conf
for the “rootfstype
”, but I don’t know what the other changes would be (I’m guessing at part of it):
…from:
APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4
…to:
APPEND ${cbootargs} root=/merged rw rootwait rootfstype=overlay
(some setup would have had to have first created “/merged
” as read-only ext4
under the ramdisk overlay…at this point I have no idea what that is and need to research, but those changes might need to be at least partly inside the initrd)
There would also need to be an edit to “/etc/fstab
”. Again, since I do not have OverlayFS experience, I would have to research it, but it appears to need something like this:
overlay /merged overlay noauto,x-systemd.automount,lowerdir=/lower,upperdir=/upper,workdir=/work 0 0