From 09c7277e307702cb7ee5ca6348b7d963985a6e9e Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Tue, 23 Aug 2022 09:38:37 -0500 Subject: [PATCH] Run depmod before creating rootfs image `depmod` needs to be run by `mkrootfs.sh` so that the kernel module dependency information is included in the SquashFS image. Without this information, `modprobe` cannot install kernel modules at runtime. --- mkinitramfs.sh | 2 -- mkrootfs.sh | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mkinitramfs.sh b/mkinitramfs.sh index 1daaedf..b5908d6 100644 --- a/mkinitramfs.sh +++ b/mkinitramfs.sh @@ -17,8 +17,6 @@ mountpoint -q tmp || mount -t tmpfs tmpfs tmp echo 'Copying kernel image to /boot/ ...' >&2 cp -a "${destdir}"/lib/modules/"${kver}"/vmlinuz \ "${destdir}"/boot/ -echo 'Running depmod ...' >&2 -chroot "${destdir}" depmod -a "${kver}" echo 'Building initramfs image ...' 2>&1 chroot "${destdir}" dracut \ --no-hostonly \ diff --git a/mkrootfs.sh b/mkrootfs.sh index f2d6745..8aa034a 100644 --- a/mkrootfs.sh +++ b/mkrootfs.sh @@ -42,6 +42,10 @@ dnf --installroot "${destdir}" install -y \ --setopt tsflags=noscripts \ kernel \ -- +kver=$(rpm --root "${destdir}" -q --qf '%{VERSION}-%{RELEASE}.%{ARCH}' kernel) +if [ ! -f "${destdir}"/lib/modules/"${kver}"/modules.dep ]; then + chroot "${destdir}" depmod -a "${kver}" +fi cp -p \ "${srcdir}"/cmdline.txt \