Skip to content
Snippets Groups Projects
Commit abaf2a9e authored by Pete Batard's avatar Pete Batard
Browse files

Remount /cdrom read-write if it also happens to be used as /boot/efi

parent f3df3864
No related branches found
No related tags found
1 merge request!1Remount /cdrom read-write if it also happens to be used as /boot/efi
fstab.d/efi 100755 → 100644
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment