grub-multi-install: get_mounted_device chokes on systemd automounts

Bug #1948571 reported by Andrej Shadura
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

On systems where /boot/efi is a systemd .automount, the postinst script fails without any error messages. While trying to figure out what’s wrong, I found this:

Trying to migrate /boot/efi into esp config
++ get_mounted_device /boot/efi
++ mountpoint=/boot/efi
++ cat /proc/mounts
...
++ read -r line
++ set -f
++ set -- systemd-1 /boot/efi autofs rw,relatime,fd=51,pgrp=1,timeout=60,minproto=5,maxproto=5,direct,pipe_ino=2548 0 0
++ set +f
++ '[' /boot/efi = /boot/efi ']'
++ echo systemd-1
++ break
+ esp=systemd-1
+ '[' systemd-1 ']'
++ device_to_id systemd-1

get_mounted_device doesn’t know that automounts are special. The attached patch teaches is to go one step further and attempt to resolve it.

Please note that I didn’t improve error handling, this still needs to be done.

Revision history for this message
Andrej Shadura (andrew.sh) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-Teach-get_mounted_device-to-not-choke-on-automounted.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.