Repository navigation
Reduce payload decompression memory and abort on unpack failures - #7
Closed
Neofly1992 wants to merge 1 commit into
Closed
Neofly1992 wants to merge 1 commit into
Neofly1992 wants to merge 1 commit into
Conversation
Member
|
Hello, we understand that there is a decompression issue on certain Kindles and we are working to fix it on the affected models, unfortunately, this particular patch is illegible, clearly AI generated, and does not fully solve the problem. As such this PR will be closed. |
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
On low-memory Kindles, the embedded payload's 64 MiB XZ dictionary can cause BusyBox to report
xz: corrupted data. The generated script continues after extraction fails, potentially removing an existing KMC installation and eventually reporting success.Addresses #5 and relates to KindleModding/Winterbreak2#8. Credit to @AbiLab-io for the original diagnosis and workaround, and to the users who confirmed it.
Changes
--lzma2=preset=6,dict=12MiB, retaining one embedded payload for both platforms.pipefailconfined to a subshell. Subsequent installation jobs retain their shell options.Why 12 MiB?
Using the identical 24,330,240-byte tar from published jb.sh v2.2.1:
Comparison streams and the final packer differ by a few bytes of XZ container metadata. The 8 MiB option adds about 3.50 MB of embedded base64; 12 MiB retains essentially the original size. This tradeoff is payload-dependent and should be rechecked as it changes. Decoder allocation estimates are not whole-process/device RAM measurements.
Validation and limitations
No physical Kindle testing has been performed, including on PW2. This is not a claim of a confirmed on-device fix. PW2 verification before merging would be welcome.
python3 tests/test_payload_unpack.py -v.ulimit -v 24000. All 38 extracted regular files match their original SHA256 hashes.ulimit -v 60000. Virtual-address limits do not represent available device RAM.Prepared with Codex assistance; the validation above describes tests actually run.