[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#967918: marked as done ([PATCH] Remount /cdrom read-write if it also happens to be used as /boot/efi)



Your message dated Thu, 13 Aug 2020 11:06:06 +0000
with message-id <E1k6B3e-0002TE-JV@fasolo.debian.org>
and subject line Bug#967918: fixed in partman-efi 85
has caused the Debian Bug report #967918,
regarding [PATCH] Remount /cdrom read-write if it also happens to be used as /boot/efi
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
967918: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967918
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: partman-efi
Severity: important
Tags: d-i

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.

On the Raspberry Pi, the reason one might want to do that, outside of enabling the use of a single media as both the source and the target for the installation (which is a good enough reason per se, that applies to more that the Pi platform), is that it alleviates having to manually duplicate the necessary bootloader files and UEFI firmware that are necessary for the platform to boot, into a different target ESP.

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.

This patch was tested by modifying the partman-efi_84_arm64.udeb package from a recent nestinst testing ISO, and proceeding through an installation.

Also please note that, as per https://github.com/pftf/RPi4/issues/76, this is one of the very last showstopper we have to enable the use of *vanilla* Debian 11 installation ISOs to install the OS on the Raspberry Pi 4. As such so we would greatly appreciate if this patch could be reviewed and applied quickly.

Thank you,

/Pete
From dff3328ce6243956254e1d71e7b72dc93ce0c103 Mon Sep 17 00:00:00 2001
From: Pete Batard <pete@akeo.ie>
Date: Wed, 5 Aug 2020 00:12:40 +0100
Subject: [PATCH] Remount /cdrom read-write if it also happens to be used as
 /boot/efi

---
 fstab.d/efi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 mode change 100755 => 100644 fstab.d/efi

diff --git a/fstab.d/efi b/fstab.d/efi
old mode 100755
new mode 100644
index 14b6696..8fe688c
--- a/fstab.d/efi
+++ b/fstab.d/efi
@@ -12,6 +12,15 @@ case $ARCH in
 	;;
 esac
 
+# Resolve the device that is mounted as /cdrom
+cdrom_device=
+while IFS=" " read -r f1 f2 f3 f4 f5 f6
+do
+	if [ $f2 == "/cdrom" ]; then
+		cdrom_device=$f1
+	fi
+done < /proc/mounts
+
 seen_efi=
 for dev in $DEVICES/*; do
 	[ -d $dev ] || continue
@@ -23,6 +32,13 @@ for dev in $DEVICES/*; do
 		[ -f "$id/method" ] || continue
 		method=$(cat $id/method)
 		[ "$method" = efi ] || continue
+		# If the device we are mounting as /boot/efi also happens to
+		# be the /cdrom device, we must remount it read-write, else
+		# the mounting of /boot/efi fails.
+		if [ "$path" == "$cdrom_device" ]; then
+			log "Remounting /cdrom read-write for use as ESP"
+			mount -o remount,rw "$path" /cdrom
+		fi
 		echo "$path" /boot/efi vfat umask=0077 0 1
 		seen_efi=1
 	done
-- 
2.21.0.windows.1


--- End Message ---
--- Begin Message ---
Source: partman-efi
Source-Version: 85
Done: Steve McIntyre <93sam@debian.org>

We believe that the bug you reported is fixed in the latest version of
partman-efi, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 967918@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Steve McIntyre <93sam@debian.org> (supplier of updated partman-efi package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 13 Aug 2020 11:42:28 +0100
Source: partman-efi
Architecture: source
Version: 85
Distribution: unstable
Urgency: medium
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Steve McIntyre <93sam@debian.org>
Closes: 967918
Changes:
 partman-efi (85) unstable; urgency=medium
 .
   [ Pete Batard ]
   * Remount /cdrom read-write if it also happens to be used as
     /boot/efi. Closes: #967918
Checksums-Sha1:
 e8647fe5afec76191cbadfa439b62e197c04a010 1721 partman-efi_85.dsc
 f1b4ddd3f019f9f633ed4a272b10abe05ba9dcdd 55808 partman-efi_85.tar.xz
 4cd5b7438b4edd186448e47a80887e359248fd41 5292 partman-efi_85_source.buildinfo
Checksums-Sha256:
 ee95f22644168722833e370c8e8b45a381c17c45727533f97d811b8932fae032 1721 partman-efi_85.dsc
 791b4ba785b77bdd298587a583b10da032df29d686e8adaad87e06e10aecb075 55808 partman-efi_85.tar.xz
 15a5eb6a4179c20b22e930736b50a8fc5506dcb60842892b03d7748590b6249c 5292 partman-efi_85_source.buildinfo
Files:
 4ee84a0d01876578d14d9bd1a3d77f0d 1721 debian-installer standard partman-efi_85.dsc
 9cb7ca8b3ecd162cbda109f5465a6f7e 55808 debian-installer standard partman-efi_85.tar.xz
 f9a3027d1584b3f54d785171c9d13812 5292 debian-installer standard partman-efi_85_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCAAvFiEEzrtSMB1hfpEDkP4WWHl5VzRCaE4FAl81GicRHDkzc2FtQGRl
Ymlhbi5vcmcACgkQWHl5VzRCaE7c+g//d9WvEklKpJ9Nq3JQP4hYPd/NYk/bAx1k
qYfhTeSmEgKgHo+fNNfzr93THYFEFUml+g1poxYeDx4/m3PKe5dAJUThcSl4odoA
09WyhdHWHFtWnzc8oRs8eJn7GEsotdV6dAyDo3qK3SWdanDJfYCsGl3gAVlmZhGm
aokIAQjJtolAhz9e2TPMGh8Vptzmw8MyD9Ni1I80LlfN+ggp4rErKjJlJZDN2OaS
CV9YNvAzcbU9aETaazYlXifbXx/fwm2hYRhfrsT8SL4HaAAM7NV4jbh4M+FjOxQN
QLTalG0ax9xdNY6i60QVz1vufJPx8UH7iUby4gkMjm+C0Q9soZqu7QEC9VA2yY93
7oG+4+5FSOrCb3niRpbqgDMQ/VEi34K3dc6cDR1NIChNj9pt15EwS7ZPpnavosM9
BsmDo+9WStH7OkGr6ZUyJLC6HQH0W2HP2PnxKhxrGJVIsBtkVEOr8hD0+YL8YRul
vxdOVvrDWh9Umgt91+7UOeK5ik10cYEXiV7+R9poyfueq4K3tjlQutLkA3W32dhE
LkHeVNmCd6Sb1fqM2xCORXyb6TYiaXczoHRpTRqXkEBFsacucy0dK14qDxzK2vsb
z7sYOMwCUMyDhdq1tBrR4REWH6n75nwt9CFwDZPiIsgh07Rly7nvvk9w6dTu0oPl
xIXJs6c0PTs=
=3Jda
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: