-
Notifications
You must be signed in to change notification settings - Fork 59
hook: introduce post-linuxkit initramfs compressor/optimizer/reporter #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rpardini
wants to merge
12
commits into
tinkerbell:main
Choose a base branch
from
rpardini:pr/hook-introduce-post-linuxkit-initramfs-compressoroptimizerreporter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
hook: introduce post-linuxkit initramfs compressor/optimizer/reporter #299
rpardini
wants to merge
12
commits into
tinkerbell:main
from
rpardini:pr/hook-introduce-post-linuxkit-initramfs-compressoroptimizerreporter
Conversation
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
Member
Author
|
Done a week of tests, this seems to be working fine. Will force-push with Sign-off's and undraft. |
- for each linuxkit/<xyz> image used: - auto-generate Dockerfile under images/hook-linuxkit-xyz - build it as regular lk_containers for the arch - replace usage in hook.template.yaml with HOOK_CONTAINER_LINUXKIT_XYZ_IMAGE - this way we capitalize on the caching mechanisms already in place Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
- to make the (rather large) Armbian kernel's modules fit in 2gb RAM machines, we used to (quite bluntly) remove modules that weren't strictly needed for Hook: - drivers/net/wireless - kernel/sound - drivers/media - drivers/infiniband - with the initramfs optimization work, we can stop removing those - this fixes certain video/DRM problems - opens up the wireless path for the future Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
- squash out some instances of `SC2268 (style): Avoid x-prefix in comparisons` - I'm too old and it shows, I wrote _all_ of them - squash one unused var and wrong comment ref Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
- otherwise contents wouldn't be shown at all - maybe it's time to add bat to downloaded dependencies (like linuxkit)? Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
- this is done via - `./build.sh kernel-config hook-latest-lts-amd64` - `./build.sh kernel-config hook-default-amd64` - `./build.sh kernel-config hook-default-arm64` - `./build.sh kernel-config hook-latest-lts-arm64` - and then making no changes and exiting - here, `ARM_SDE_INTERFACE=y` is being removed as it is implied by having `ACPI_APEI_GHES=y`, `ACPI=y`, `ACPI_APEI=y` and `ARM64=y` Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
- turns out LinuxKit ends up producing initramfs's that are very large
- multiple copies of exact same files in different fs paths
- gzip compression
- multiple cpio layers causing multiple instances of same filepath stored
- add a Docker-based postprocess step that does multiple tricks to fix it
- extract/repack cpio to flatten it
- rdfind to replace duplicates with hardlinks
- zstd (-9, multithread) compression
- reports usage and large duplicate files in different paths
- so we can optimize our lk containers for better dedupe
- gains are at
- 25% for zstd compression (meson64)
- 10Mb for rdfind, without any lk optimization yet
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
- unpack and repack cpio's like the kernel does; order vs timestamps matter, since the kernel overwrites without mtime comparision Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
- 'peg' has served its purpose, should we remove it? Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
- this way we drastically reduce the number of different binaries found in the final initramfs, allowing the initramfs compressor to deduplicate them into hardlinks - libssl / libcrypto - busybox - musl Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
…ramfs Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
535e12d to
a57e278
Compare
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.
hook: introduce post-linuxkit initramfs compressor/optimizer/reporter
Signed-off-by: Ricardo Pardini ricardo@pardini.net
machines, we used to (quite bluntly) remove modules that weren't
strictly needed for Hook:
Signed-off-by: Ricardo Pardini ricardo@pardini.net
SC2268 (style): Avoid x-prefix in comparisonsSigned-off-by: Ricardo Pardini ricardo@pardini.net
catifbatis missing inlog_file_bat()Signed-off-by: Ricardo Pardini ricardo@pardini.net
./build.sh kernel-config hook-latest-lts-amd64./build.sh kernel-config hook-default-amd64./build.sh kernel-config hook-default-arm64./build.sh kernel-config hook-latest-lts-arm64ARM_SDE_INTERFACE=yis being removed as it is impliedby having
ACPI_APEI_GHES=y,ACPI=y,ACPI_APEI=yandARM64=ySigned-off-by: Ricardo Pardini ricardo@pardini.net
Signed-off-by: Ricardo Pardini ricardo@pardini.net
matter, since the kernel overwrites without mtime comparision
Signed-off-by: Ricardo Pardini ricardo@pardini.net
Signed-off-by: Ricardo Pardini ricardo@pardini.net
found in the final initramfs, allowing the initramfs compressor
to deduplicate them into hardlinks
Signed-off-by: Ricardo Pardini ricardo@pardini.net
Signed-off-by: Ricardo Pardini ricardo@pardini.net
Signed-off-by: Ricardo Pardini ricardo@pardini.net
Signed-off-by: Ricardo Pardini ricardo@pardini.net