]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(dmsquash-live-root): check kernel for built-in `overlay` drivers
authorFrederick Grose <fgrose@sugarlabs.org>
Tue, 2 Aug 2022 22:07:50 +0000 (18:07 -0400)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Fri, 12 Aug 2022 10:25:00 +0000 (10:25 +0000)
Do not assume that `overlay` is always a module.  Check first for
`overlay` in `/proc/filesystems`. This is needed in the --no-kernel
use case to avoid the error: modprobe:
  FATAL: Module overlay not found in directory /lib/modules/<kver>

Signed-off-by: Federico Vaga <federico.vaga@cern.ch>
modules.d/90dmsquash-live/dmsquash-live-root.sh

index abc68407f40c2b36a27a27b14b46f605ce0588e6..cb3fe5d06afa417461126a79dbb1df280929f695 100755 (executable)
@@ -177,7 +177,7 @@ do_live_overlay() {
         fi
     fi
     if [ -n "$overlayfs" ]; then
-        if ! modprobe overlay; then
+        if ! { strstr "$(< /proc/filesystems)" overlay || modprobe overlay; }; then
             if [ "$overlayfs" = required ]; then
                 die "OverlayFS is required but not available."
                 exit 1