rc.local never runs until the rest of multi-user.target finishes. If CBoot is failing, then it won’t be due to rc.local. I would be curious to see what logging is visible from serial console.
Although you cannot directly mount the filesystem on another computer, you can clone the rootfs (which produces both a mountable raw loopback image and a non-mountable sparse image), edit that clone on the PC, then reflash using the edited clone as rootfs instead of regenerating a default rootfs. Be warned that this takes a lot of time and disk space.
The short story is that if you clone and name the clone file “backup.img”, then you will also get “backup.img.raw”. Throw away the “backup.img” and keep the “.raw” version. See:
As to the actual clone operation, basically you put the Xavier in recovery mode with the correct USB cable just like you are going to flash. If you’ve run JetPack or SDK Manager before, then you will have a “Linux_for_Tegra/” subdirectory in there, and that directory will have “flash.sh”. From that location this is the basic command for clone:
./flash.sh -r -k APP -G "backup.img" jetson-xavier mmcblk0p1
Remove “backup.img”. You can then loopback mount “backup.img.raw” (example is on “/mnt”, but you can pick somewhere else):
mount -o loop backup.img.raw /mnt
# Go to rc.local:
# Edit this or do as you want, save.
# You can't umount if you are in that directory:
Now if you want to flash this edited clone:
# This will take a lot of time...the file is around 28GB...two copies implies 56GB...check "df -H ." prior to doing this so you know how much space your host PC has:
cp backup.img.raw ./bootloader/system.img
# Reboot the Xavier back into recovery mode...you can't clone and flash without reboots between.
sudo ./flash.sh <b>-r</b> jetson-xavier mmcblk0p1
(the “-r” is very important)
Note that if the rootfs is a non-default size you may need to explicitly set the size. Size is set either in “MiB” (1024 x 1024) or “GiB” (1024 x 1024 x 1024). If your backup.img.raw is evenly divisible by 1024 three times, then this is GiB, or if only evenly divisible twice by 1024, then it is MiB (other values are not valid). So if my image is 28GiB I could explicitly state this:
sudo ./flash.sh -S 28GiB -r jetson-xavier mmcblk0p1