Remount /cdrom read-write if it also happens to be used as /boot/efi
This is the patch associated to Bug#967918 (as well as Bug#963156).
Some installation processes (e.g. The installation of vanilla Debian ARM64 on a Raspberry Pi 4 in UEFI mode) greatly benefit from extracting the Debian installation files from mini.iso or netinst.iso into an ESP and then using that same ESP for the final system.
However, since this results in /cdrom and /boot/efi sharing the same underlying device, and /cdrom is mounted read-only, the attempt to mount the ESP as /boot/efi in partman returns a fatal error (with the message: "The attempt to mount a file system with type vfat in SCSI1 (0,0,0), partition #1 (sda) at /boot/efi failed") due to the Linux kernel not allowing the same device to be mounted both ro and rw at the same time.
This patch fixes this in the script that sets the /boot/efi mount by:
- Detecting the underlying device used by the /cdrom mountpoint.
- Remounting /cdrom rw if that device is the same as the one that will be used to mount /boot/efi.