Support dynamic zImage piggy payload sizes during repacking by updating
the zImage decompressor stub headers, symbol tables, and GOT entries.
Previously, magiskboot padded repacked zImage files to preserve the
exact original file size. For non-gzip compressed zImages (such as XZ),
repacking with a different payload size broke stub symbol resolution
and resulted in ununpackable or unbootable images.
Key changes:
- Encapsulate zImage parsing and patching in a dedicated struct ZImage
in Rust with CXX FFI, new_head, and new_tail methods.
- Locate piggy_end using table references or GOT table entries bounded
by LC0.
- Relocate LC0 table entries, LC1 table, and GOT table entries with
4-byte padding/alignment when payload size changes.
- Relocate R_ARM_GOTPC PC-relative literal pools in decompressor .text.
- Append uncompressed size for non-gzip algorithms per size_append.
- Remove zopfli compression support across magiskboot as dynamic zImage
piggy sizing supersedes the need for exact size matching.
Fix#9880
Assisted-by: Gemini 3.7 Flash
Hi there, appreciate you and your work.
Proposing a small change to the A/B device update instructions, based on your changes within the Magisk app which made those instructions outdated/ invalid.
Specifically, after installing Magisk to the new slot, apparently Magisk then instructs to go back to the system update and hit restart now, instead of the prior instructions which remain on this website of rebooting within the Magisk app. I just did testing, and rebooting within the Magisk app does not result in slot switch, which must be why you noe instruct to go back to system update for the restart now.
Just thought I'd update the instructions for anyone who might be confused.
Thx!
After we refactor the magic mount and always mount folder as tmpfs,
we can easily support deleting files or folders now. We recognize
dummy devices with major number 0 and minor number 0 as an indicator
for removing files and folders. This indicator is borrowed from
overlayfs.
Since system Safe Mode may activate without Magisk 'Safe Mode', this clarification will prevent users from erroneously concluding either that Safe Mode doesn't work or that modules are not the issue since 'Safe Mode' was apparently triggered...
Fixes this: #4624
It's very easy to wait for property change both in Java and C++,
but it's not the case in shell script. With this patch, developers
can now easily to wait for property change, just like what we have
in `.rc` files, and to wait for boot complete.
- Remove boot vbmeta patching because the checkbox is removed in b1363ee
- Remove meaningless slot argument from `fastboot flash` as it will automatically flash the active slot. Fix#7571
- actions: Update all actions/checkout references to v4
- magiskboot: Add missing new line to dtb help message
- docs: Update documents, fix some errors and remove outdated info