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.
pull/1/head
Dustin 2022-08-23 09:38:37 -05:00
parent ad09bd2cdc
commit 09c7277e30
2 changed files with 4 additions and 2 deletions

View File

@ -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 \

View File

@ -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 \