Something to keep in mind is that there appears to be some dual partition scheme being developed, but not yet complete. If you look at the partitions of R28.2 (“sudo gdisk -l /dev/mmcblk0”) you’ll see this dual partition scheme. Whatever I suggest here might be outdated and irrelevant in the future. Even so, it might be useful to think about the following…
There would be a big advantage if you were to have a separate “/boot” partition versus the rest of rootfs (I have not tried to do this, but it is tempting). Think first about when “/boot” is used by what software, and then what and when the rest of “/” is used.
U-Boot will look for an extlinux.conf in the partition named for destination during flash (e.g., “sudo ./flash.sh mmcblk0p1 jetson-tx2” means extlinux.conf must exist in mmcblk0p1). U-Boot does not care about anything but the “/boot” subdirectory of this partition. If you use a serial console and interrupt U-Boot and go to the command prompt, then environment variables will show you the search order and search devices of looking for extlinux.conf.
Once the Linux kernel runs, the root partition will be looked for in the “root=” entry passed in the APPEND key/value pair of extlinux.conf, but this value was already read by U-Boot and Linux will never read this from disk. “/boot” could be deleted after U-Boot has read in everything, and Linux would never know nor care. It just happens that by default convention “mmcblk0p1” contains both “/boot” and the rest of the rootfs, but it isn’t mandatory.
If you were to flash normally, but have no sample rootfs other than “/boot”, and you were to manually name the rootfs size with the flash.sh parameter “-S” (e.g., “sudo ./flash.sh -S 1GiB jetson-tx2 mmcblk0p1”), then you would essentially have a tiny “/boot” partition and no rootfs. The extra space could be added to the end of the eMMC at a later time using gdisk or gparted (you might want to preserve other partition sizes and order and labels), but you’d need to figure out a way to get the extlinux.conf to name a new “root=”.
During flash the “rootfs/” subdirectory on the host PC is used almost as an exact copy. Depending on arguments to flash.sh extlinux.conf will be edited…you’d need to edit the file copied in rather than edit the “rootfs/boot/exltinux/extlinux.conf” since any edits there are lost during flash. For example, when flash.sh is told to flash to mmcblk0p1 it copies “bootloader/t186ref/p2771-000/extlinux.conf.emmc” to “rootfs/boot/extlinux/extlinux.conf”. Editing the “.emmc” version would result in propagating your changes into “/boot/extlinux/extlinux.conf” of the final flash image. You could edit this for example to have “root=/dev/mmcblk0p29”. In theory, when Linux runs, this would be your rootfs. Perhaps you also have “/dev/mmcblk0p30”, and both are duplicates…or perhaps one is an upgrade mostly similar to the first…then a serial console could be used to select between entries. Or a “default” could change which entry is used when no serial console intervenes. Example entries:
TIMEOUT 30
DEFAULT <b>test1</b>
MENU TITLE p2771-0000 eMMC boot options
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4
LABEL test1
MENU LABEL test rootfs1
LINUX /boot/Image<b>_rootfs1</b>
APPEND ${cbootargs} root=/dev/mmcblk0p<b>29</b> rw rootwait rootfstype=ext4
LABEL test2
MENU LABEL test rootfs2
LINUX /boot/Image<b>_rootfs2</b>
APPEND ${cbootargs} root=/dev/mmcblk0p<b>30</b> rw rootwait rootfstype=ext4
LABEL sdcard
MENU LABEL SD Card
LINUX /boot/Image
APPEND ${cbootargs} root=/dev/mmcblk<b>1</b>p1 rw rootwait rootfstype=ext4
LABEL sata
MENU LABEL USB SATA
LINUX /boot/Image
APPEND ${cbootargs} root=/dev/<b>sda1</b> rw rootwait rootfstype=ext4
…copy relevant kernel “Image” files in to “/boot” of mmcblk0p1 so you can have independent kernels. Use a rescue SD card to add mmcblk0p29 and mmcblk0p30.
If you want to alternate active rootfs, then the extlinux.conf of the previous partition must always survive and point to a valid rootfs if your upgrade is to be “safe”. U-Boot environment determines where that extlinux.conf must be. Various non-rootfs partition content and environment variables can change if U-Boot survives due to boot environment setup requirements. If you keep “/boot” pristine and protected, then in theory if U-Boot itself survives testing, then you can afford to make mistakes (without a serial console mistakes would still be at minimimum “inconvenient”). Under the assumption that two rootfs images work using the same device tree and other startup initialization (cboot, mboot1, mboot2, so on), then there is no reason you can’t dual boot and experiment with one of the rootfs partitions while keeping your “/boot” partition protected.
Your life would be much easier if you had something like an ethernet serial UART console adapter.