Ship kernel modules Zstd compressed

Bug #2028568 reported by Benjamin Drung
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

To reduce the size of the initramfs and also to speed up the boot (by only decompressing the modules that are needed), please compress the kernel modules. From size and speed perspective, either use zstd or xz. I suggest to go with zstd -19.

This change is independent of the initramfs-tools version. Old initramfs-tools versions will decompress the kernel modules before putting them in the initramfs. New initramfs-tools versions will put the compressed kernel modules into an uncompressed cpio archive (see bug #2028567).

See also https://lists.ubuntu.com/archives/ubuntu-devel/2023-July/042652.html and https://lists.ubuntu.com/archives/ubuntu-devel/2023-July/042707.html

See https://discourse.ubuntu.com/t/reduce-initramfs-size-and-speed-up-the-generation-in-ubuntu-23-10/38972 for the performance evaluation.

Revision history for this message
Benjamin Drung (bdrung) wrote :

Attached a tested patch for zstd -19 compression.

tags: added: patch
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

hi, i like portions of the patch, but not quite where in the machinery it is implemented.

As we have many more packages that ship .ko modules, and those debs should not be compressed.

And also i'd want to enable in-kernel decompressor too.

summary: - Ship kernel modules compressed
+ Ship kernel modules Zstd compressed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Changed in linux (Ubuntu):
status: New → In Progress
Benjamin Drung (bdrung)
description: updated
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

This will be available in the next kernel builds, likely as part of landing v6.5 kernel into mantic.

Changed in linux (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-oem-6.5/6.5.0-1002.2 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-jammy-linux-oem-6.5' to 'verification-done-jammy-linux-oem-6.5'. If the problem still exists, change the tag 'verification-needed-jammy-linux-oem-6.5' to 'verification-failed-jammy-linux-oem-6.5'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: kernel-spammed-jammy-linux-oem-6.5-v2 verification-needed-jammy-linux-oem-6.5
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 6.5.0-5.5

---------------
linux (6.5.0-5.5) mantic; urgency=medium

  * mantic/linux: 6.5.0-5.5 -proposed tracker (LP: #2034546)

  * Packaging resync (LP: #1786013)
    - [Packaging] update helper scripts
    - debian/dkms-versions -- update from kernel-versions (main/d2023.08.23)

 -- Andrea Righi <email address hidden> Wed, 06 Sep 2023 15:51:04 +0200

Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
Benjamin Drung (bdrung)
description: updated
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-azure-6.5/6.5.0-1007.7~22.04.1 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-jammy-linux-azure-6.5' to 'verification-done-jammy-linux-azure-6.5'. If the problem still exists, change the tag 'verification-needed-jammy-linux-azure-6.5' to 'verification-failed-jammy-linux-azure-6.5'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: kernel-spammed-jammy-linux-azure-6.5-v2 verification-needed-jammy-linux-azure-6.5
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-aws-6.5/6.5.0-1008.8~22.04.1 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-jammy-linux-aws-6.5' to 'verification-done-jammy-linux-aws-6.5'. If the problem still exists, change the tag 'verification-needed-jammy-linux-aws-6.5' to 'verification-failed-jammy-linux-aws-6.5'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: kernel-spammed-jammy-linux-aws-6.5-v2 verification-needed-jammy-linux-aws-6.5
Revision history for this message
Werner Sembach (matombo) wrote :

I spoted that for jammy hwe 6.5.0-14.14 the modules are still not compressed, albeit CONFIG_MODULE_COMPRESS_ZSTD is 'y' for amd64 in config/annotations.
I also spotted that when the modules are compressed, DKMS compresses built modules too, but DKMS v2.8.7 (the version running in jammy) has a bug that compressed modules don't get MOK signed.

Revision history for this message
Werner Sembach (matombo) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.