Permalink
Browse files

storage: ignore the wrong fstype in /etc/fstab about the EFI Boot Par…

…tition

EFI Boot Partitions have partition type EFh (efi) but in Linux we
need to set it to vfat, which is what is effectively inside it.
So, we should just handle the case and consider fstab valid anyways.
  • Loading branch information...
1 parent 723e7f2 commit 292781b37763b28dbd583eec93bd3349b61b43fd @lxnay lxnay committed Jul 17, 2013
Showing with 10 additions and 1 deletion.
  1. +10 −1 storage/__init__.py
View
@@ -1696,7 +1696,16 @@ def _parseOneLine(self, (devspec, mountpoint, fstype, options, dump, passno)):
# make sure, if we're using a device from the tree, that
# the device's format we found matches what's in the fstab
fmt = getFormat(fstype, device=device.path)
- if fmt.type != device.format.type:
+
+ # /boot/efi can have a partition type of EFh while containing a
+ # vfat partition. Handle this case and fixup the partition type
+ is_efi_fmt = device.format.type == "efi"
+ if fstype == "vfat" and mountpoint == "/boot/efi" and is_efi_fmt:
+ # This is triggered in the bootloader restore path
+ log.warning(
+ "/boot/efi is vfat but has partition type set to 'efi', okay..."
+ )
+ elif fmt.type != device.format.type:
raise StorageError("scanned format (%s) differs from fstab "
"format (%s)" % (device.format.type, fstype))

0 comments on commit 292781b

Please sign in to comment.