Skip to content

Commit f104f35

Browse files
authored
Merge pull request #3437 from flatcar/chewi/initrd-ko-xz
sys-kernel/coreos-kernel: Decompress the minimal initrd kernel modules
2 parents 9c28b3a + 6de9372 commit f104f35

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/coreos-kernel-6.12.54.ebuild

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,16 @@ src_compile() {
108108
ln -s usr/lib64 lib || die
109109
ln -s usr/lib64 lib64 || die
110110
ln -s lib64 usr/lib || die
111-
mkdir -p lib/modules/"${KV_FULL}"/ || die
112111
# Instead from ESYSROOT we can also copy kernel modules from the dracut pre-selection
113-
cp "${S}"/build/bootengine/usr/lib/modules/"${KV_FULL}"/modules.* lib/modules/"${KV_FULL}"/ || die
114112
mkdir -p lib/modprobe.d/ || die
115113
cp "${S}"/build/bootengine/lib/modprobe.d/* lib/modprobe.d/ || die
116114
# Only include modules related to mounting /usr and for interacting with the emergency console
117115
pushd "${S}/build/bootengine/usr/lib/modules/${KV_FULL}" || die
118116
find kernel/drivers/{ata,block,hid,hv,input/serio,mmc,nvme,pci,scsi,usb} kernel/fs/{btrfs,overlayfs,squashfs} kernel/security/keys -name "*.ko.*" -printf "%f\0" | DRACUT_NO_XATTR=1 xargs --null "${BROOT}"/usr/lib/dracut/dracut-install --destrootdir "${S}"/build/minimal --kerneldir . --sysrootdir "${S}"/build/bootengine/ --firmwaredirs "${S}"/build/bootengine/usr/lib/firmware --module dm-verity dm-mod virtio_console || die
119117
popd || die
118+
# Double compression only makes the image bigger and slower
119+
find . -name "*.ko.xz" -exec unxz {} + || die
120+
depmod -a -b . "${KV_FULL}" || die
120121
echo '$MODALIAS=.* 0:0 660 @/sbin/modprobe "$MODALIAS"' > ./etc/mdev.conf || die
121122
# We can't use busybox's modprobe because it doesn't support the globs in module.alias, breaking module loading
122123
DRACUT_NO_XATTR=1 "${BROOT}"/usr/lib/dracut/dracut-install --destrootdir . --sysrootdir "${ESYSROOT}" --ldd /bin/veritysetup /bin/dmsetup /bin/busybox /sbin/modprobe || die

0 commit comments

Comments
 (0)