initrd: install perf in ukl-base and fail non-destructively on missing binary - #39
Open
borkluce wants to merge 1 commit into
Open
initrd: install perf in ukl-base and fail non-destructively on missing binary#39borkluce wants to merge 1 commit into
borkluce wants to merge 1 commit into
Conversation
…g binary The ukl-base image did not install perf, but buildinitrd.sh lists it as required, so the build aborted and deleted its working directory, leaving an empty initrd and an unexplained 'Unable to mount root fs' panic at boot. - Add perf to the ukl-base Dockerfile so the required set is present. - On a missing binary, print a clear error naming it and pointing to the fix, and no longer 'rm -rf $WDIR', so the failure is diagnosable.
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.
Problem
The initrd build aborts and produces a near-empty (~25 KB) image when a binary listed in
buildinitrd.shis not present in theukl-basebuild container. In practice this happens withperf: theukl-baseimage (Fedora 36) does not install it, butbuildinitrd.shlists it insbinfilesand also assumes a./perfexists in the repo. Whencopy()cannot findperf, it runsrm -rf $WDIRand exits, leaving an incomplete initrd. The build appears to finish, but the kernel then panics at boot withUnable to mount root fs, with nothing linking the panic back to the missing binary.Changes
initrd/ukl-base/Dockerfile: addperfto thednf installlist so the binary required bybuildinitrd.shis present in the container.initrd/buildinitrd.sh: on a missing binary, print a clear error naming it and pointing to the fix, and stop callingrm -rf $WDIR. The working directory is now preserved on failure, so the problem is diagnosable instead of surfacing as an unexplained boot panic much later.Testing
ukl-baseimage with the updated Dockerfile: it builds successfully and now includesperf(perf version 6.2.6).bash -n buildinitrd.shpasses (no syntax errors).perffromsbinfileswas my original workaround and produced a correct (~8 MB) initrd that booted normally; addingperfto the image achieves the same while keeping the tool available.Encountered while integrating an application into UKL. Happy to adjust the approach — e.g. mark non-essential tools as optional instead — if preferred.
Closes #38