I want to modify the official Raspberry Pi OS lite image:
I want to add a secondary root partition to the image, so I can easily switch between 2 different operating systems.
Since I want to automate the modification of the image file, I cannot use any GUI/desktop program. My Raspberry is not connected to a display so I cannot use any fancy boot manager either (no Berryboot, PINN). Also I don't want to manually calculate partition sectors, sizes.
What is the common approach to automate the modification of a Raspberry OS image to have dual root partitions?