A suggestion which might make testing easier…if you have serial console, then you can interrupt boot and pick different entries in extlinux.conf. During boot, with serial console, you can interrupt either at the U-Boot command line (too early for what you want), or at the selection of which command line/kernel to boot (this latter is what you’d want if you’ve added a second entry and that entry contains your command line edits). Then you just do a quick extlinux.conf edit and try the second entry without changing the default entry…if it fails, just don’t use the second entry.
An example boot on serial console will show something like this as U-Boot is reached (delay times where you can interrupt with a keystroke are short…and if you interrupt too early just type “boot” and continue and then interrupt during kernel select stage…any key will interrupt, and you want to interrupt when it gets to the “1: primary kernel” part):
U-Boot 2016.07-g0eb73f4 (Mar 13 2019 - 00:20:34 -0700)
TEGRA186
Model: NVIDIA P2771-0000-500
DRAM: 7.8 GiB
MC: Tegra SD/MMC: 0, Tegra SD/MMC: 1
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net: eth0: ethernet@2490000
Hit any key to stop autoboot: 0
Tegra186 (P2771-0000-500) # boot
MMC: no card present
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
213 bytes read in 114 ms (1000 Bytes/s)
p2771-0000 eMMC boot options
1: primary kernel
Enter choice:
If you look at “/boot/extlinux/extlinux.conf”, then you will see a block like this:
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4
Most of this file’s APPEND is no longer available for edit since earlier stages use a device tree and edit content, but the part of this file you see above is still available for customization directly in extlinux.conf. You can change this without flashing.
So as an example, you could duplicate this entry and edit, followed by using serial console to try it out. That single entry would instead become something like this:
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
APPEND ${cbootargs} root=/dev/mmcblk0p1 <b>rw</b> rootwait rootfstype=ext4
LABEL <b>test_read_only</b>
MENU LABEL <b>test read only</b>
LINUX /boot/Image
APPEND ${cbootargs} root=/dev/mmcblk0p1 <b>ro</b> rootwait rootfstype=ext4
The earlier boot text I showed from an example serial console would then change to this:
Retrieving file: /boot/extlinux/extlinux.conf
213 bytes read in 114 ms (1000 Bytes/s)
p2771-0000 eMMC boot options
1: primary kernel
<i><b>2: test read only</b></i>
Enter choice:
Entering nothing would use the default entry “1”. Entering “2” would boot the alternate APPEND in the second entry. You can add several entries.
Serial console setting is 115200 8N1 with a 3.3V TTL logic level:
http://www.jetsonhacks.com/2017/03/24/serial-console-nvidia-jetson-tx2/