Workaround for buggy dracut in Fedora 25

dracut --kmoddir is broken in dracut-044 (mangles module path inside
initramfs). This is already fixed upstream, but updated package still
haven't been uploaded to Fedora 25.
For now, postprocess the initramfs fixing the path.

https://bugzilla.redhat.com/show_bug.cgi?id=1431317
https://github.com/dracutdevs/dracut/issues/194
QubesOS/qubes-issues#2574
pull/9/head
Marek Marczykowski-Górecki 7 years ago
parent c743468eb3
commit 0923b4093b
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

@ -329,7 +329,26 @@ PATH="/sbin:$PATH" dracut --nomdadmconf --nolvmconf \
--modules "kernel-modules qubes-vm-simple" \
--conf /dev/null --confdir /var/empty \
-d "xenblk xen-blkfront cdrom ext4 jbd2 crc16 dm_snapshot" \
%buildroot/%vm_install_dir/initramfs %kernelrelease
%buildroot/%vm_install_dir/initramfs %kernelrelease || exit 1
# workaround for buggy dracut-044 in Fedora 25
# https://bugzilla.redhat.com/show_bug.cgi?id=1431317
# https://github.com/dracutdevs/dracut/issues/194
modules_dep=$(lsinitrd "%buildroot/%vm_install_dir/initramfs" \
"usr/lib/modules/%kernelrelease/modules.dep")
if [ -z "$modules_dep" ]; then
tmpdir=$(mktemp -d)
zcat "%buildroot/%vm_install_dir/initramfs" | cpio -imd -D "$tmpdir" || exit 1
mv "$tmpdir"/%buildroot/lib/modules/%kernelrelease/kernel \
"$tmpdir"/lib/modules/%kernelrelease/ || exit 1
depmod -F %buildroot/boot/System.map-%kernelrelease \
-b "$tmpdir" -a %kernelrelease || exit 1
pushd "$tmpdir"
find . -print0 | sort -z \
| cpio --null -R 0:0 -H newc -o --quiet \
| gzip > %buildroot/%vm_install_dir/initramfs || exit 1
popd
fi
cp -p arch/x86/boot/bzImage %buildroot/%vm_install_dir/vmlinuz

Loading…
Cancel
Save