SOLVED - CentOS 7.4 and UEFI Support in Dracut

Issues related to hardware problems
Post Reply
User avatar
GregoryYoung
Posts: 2
Joined: 2018/01/24 15:30:41

SOLVED - CentOS 7.4 and UEFI Support in Dracut

Post by GregoryYoung » 2018/01/24 16:28:26

Testing UEFI support by using Hyper-V Generation 2 VM. I have discovered that the install works as expected, but any kernel upgrades break UEFI boot.

For reference, the initial kernel that works is:

Code: Select all

[root@localhost tmp]# uname -a
Linux localhost.localdomain 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Upgrade the kernel and we get a dracut error that it cannot find the 'vfat' module:

Code: Select all

[root@localhost tmp]# yum update kernel
Loaded plugins: fastestmirror, langpacks
base                                                                                                                                                                              | 3.6 kB  00:00:00
extras                                                                                                                                                                            | 3.4 kB  00:00:00
updates                                                                                                                                                                           | 3.4 kB  00:00:00
(1/2): extras/7/x86_64/primary_db                                                                                                                                                 | 145 kB  00:00:00
(2/2): updates/7/x86_64/primary_db                                                                                                                                                | 5.3 MB  00:00:02
Determining fastest mirrors
 * base: mirror.scalabledns.com
 * extras: mirrors.umflint.edu
 * updates: centos.mirrors.tds.net
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.10.0-693.11.6.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================================================
 Package                                      Arch                                         Version                                                   Repository                                     Size
=========================================================================================================================================================================================================
Installing:
 kernel                                       x86_64                                       3.10.0-693.11.6.el7                                       updates                                        43 M

Transaction Summary
=========================================================================================================================================================================================================
Install  1 Package

Total download size: 43 M
Installed size: 59 M
Is this ok [y/d/N]: y
Downloading packages:
updates/7/x86_64/prestodelta                                                                                                                                                      | 680 kB  00:00:03
kernel-3.10.0-693.11.6.el7.x86_64.rpm                                                                                                                                             |  43 MB  00:01:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : kernel-3.10.0-693.11.6.el7.x86_64                                                                                                                                                     1/1
dracut module 'vfat' cannot be found or installed.
mkinitrd failed
warning: %posttrans(kernel-3.10.0-693.11.6.el7.x86_64) scriptlet failed, exit status 1
Non-fatal POSTTRANS scriptlet failure in rpm package kernel-3.10.0-693.11.6.el7.x86_64
  Verifying  : kernel-3.10.0-693.11.6.el7.x86_64                                                                                                                                                     1/1

Installed:
  kernel.x86_64 0:3.10.0-693.11.6.el7

Complete!
Checking the current system, we have vfat support in the kernel:

Code: Select all

[root@localhost tmp]# modinfo vfat
filename:       /lib/modules/3.10.0-693.5.2.el7.x86_64/kernel/fs/fat/vfat.ko.xz
author:         Gordon Chaffee
description:    VFAT filesystem support
license:        GPL
alias:          fs-vfat
rhelversion:    7.4
srcversion:     A3254796A3CD9815ABDDC94
depends:        fat
intree:         Y
vermagic:       3.10.0-693.5.2.el7.x86_64 SMP mod_unload modversions
signer:         CentOS Linux kernel signing key
sig_key:        C7:57:A9:FB:BD:0D:82:C9:E5:40:52:02:9A:09:08:D1:7C:F1:AD:C7
sig_hashalgo:   sha256
[root@localhost tmp]# modinfo fat
filename:       /lib/modules/3.10.0-693.5.2.el7.x86_64/kernel/fs/fat/fat.ko.xz
license:        GPL
rhelversion:    7.4
srcversion:     48C5E88500B6EBB832D91D7
depends:
intree:         Y
vermagic:       3.10.0-693.5.2.el7.x86_64 SMP mod_unload modversions
signer:         CentOS Linux kernel signing key
sig_key:        C7:57:A9:FB:BD:0D:82:C9:E5:40:52:02:9A:09:08:D1:7C:F1:AD:C7
sig_hashalgo:   sha256
And the kernel modules are present in the new kernel:

Code: Select all

[root@localhost tmp]# ll /lib/modules/3.10.0-693.11.6.el7.x86_64/kernel/fs/fat/
total 48
-rw-r--r--. 1 root root 30576 Jan  3 20:58 fat.ko.xz
-rw-r--r--. 1 root root  5828 Jan  3 20:58 msdos.ko.xz
-rw-r--r--. 1 root root  7892 Jan  3 20:58 vfat.ko.xz

For reference, the current working kernel modules:

Code: Select all

[root@localhost tmp]# ll /lib/modules/3.10.0-693.5.2.el7.x86_64/kernel/fs/fat/
total 48
-rw-r--r--. 1 root root 30588 Oct 20 17:45 fat.ko.xz
-rw-r--r--. 1 root root  5824 Oct 20 17:45 msdos.ko.xz
-rw-r--r--. 1 root root  7896 Oct 20 17:45 vfat.ko.xz
I have added the vfat module to /etc/dracut.conf:

Code: Select all

# dracut modules to add to the default
add_dracutmodules+="vfat"
The EFI partition is mounted:

Code: Select all

/dev/sda2 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)

**************************************************************************************

In the course of writing this post, I discovered the solution (why I couldn't figure this out yesterday...). The dracut error is technically right, but leads you down a rabbit hole. The vfat module is needed, but it gets loaded as part of the "uefi-lib" module. The fix is to edit /etc/dracut.conf:

Code: Select all

# dracut modules to add to the default
add_dracutmodules+="uefi-lib"

User avatar
GregoryYoung
Posts: 2
Joined: 2018/01/24 15:30:41

Re: SOLVED - CentOS 7.4 and UEFI Support in Dracut

Post by GregoryYoung » 2018/01/24 17:07:50

For reference, I created bug 14409 .
https://bugs.centos.org/view.php?id=14409

Post Reply