Use multi-threaded unsquashfs to extract untethered images - #247
Merged
Conversation
`unsquashfs` can use multiple CPU cores during image extraction, significantly reducing boot time. For example the whole boot time from PXE to shell on a 8-core VM, from approximately 45 seconds to 20 seconds. This PR adds `squashfs-tools` as a dependency. Since the package is smaller than 1 MB, the additional image size is justified by the performance improvement. For backward compatibility, the existing `cp`-based extraction method is used when `unsquashfs` is unavailable, such as with images built before this change. The extraction logic has also been moved into the common functions and is now shared between EL9, EL10, and Ubuntu. Both untethered `squashfs` images and `confluent_multisquash` images are supported. Images must be rebuilt to include `unsquashfs` and benefit from the faster extraction path.
imageboot falls back to cp when unsquashfs is unavailable, but the build side did not: a bare dracut_install/copy_exec aborts initramfs generation when the binary is absent, and the capture prerequisite check refused to capture the image at all. Mark the initramfs copies optional and report the missing package as an advisory rather than a hard prerequisite, so such images still build and capture, just without the faster extraction path. Widen the EL check to every release past el8 so future ones inherit it.
source_remote imageboot.sh is the last thing the diskless cmdline hook runs, so returning early on a failed extraction ended the hook and left dracut to time out. Falling through instead reaches the existing /sysroot/sbin/init guard, which reports the failure and holds the node so it stays reachable over ssh, as it did before extraction was checked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
unsquashfscan use multiple CPU cores during image extraction, significantly reducing boot time.For example the whole boot time from PXE to shell on a 8-core VM and the default alma10 image, from approximately 45 seconds to 20 seconds. Bigger images and more cores will make this gap even larger.
This PR adds
squashfs-toolsas a dependency. Since the package is smaller than 1 MB, the additional image size is justified by the performance improvement.For backward compatibility, the existing
cp-based extraction method is used whenunsquashfsis unavailable, such as with images built before this change.The extraction logic has also been moved into the common functions and is now shared between EL9, EL10, and Ubuntu.
Both untethered
squashfsimages andconfluent_multisquashimages are supported.Images must be rebuilt to include
unsquashfsand benefit from the faster extraction path.