chenxiaolong/avbroot

payload.bin is not stored uncompressed

Mikamuro opened this issue · 4 comments

Hello!

Firmware: LineageOS 21

I encountered this error. Initially blamed on the system (Manjaro), on it, your software does not run at all and gives an error that there is no such “package” (if you add ./ the situation was repeated), but not about that.

On Windows gave generally other errors, now on Ubuntu managed to achieve this:

Caused by:
payload.bin is not stored uncompressed

./avbroot ota patch --input lineage-device.zip --key-avb avb.key --key-ota ota.key --cert-ota ota.crt --prepatched magisk_patched.img 

  8.380s  INFO Copying zip entry: META-INF/
  8.381s  INFO Copying zip entry: META-INF/com/
  8.381s  INFO Copying zip entry: META-INF/com/android/
  8.381s  INFO Replacing zip entry: META-INF/com/android/otacert
  8.381s  INFO Copying zip entry: apex_info.pb
  8.381s  INFO Copying zip entry: care_map.pb
  8.382s  INFO Patching zip entry: payload.bin
  8.382s ERROR Failed to patch OTA zip

Caused by:
    payload.bin is not stored uncompressed

I don't know if this information is necessary, but if you use this function
--magisk app-release.apk --magisk-preinit-device sda11
the error is the same.

I also have another question.

I also tried to patch A13, but I got an error in the spirit of failed to find payload.bin.
As far as I remember in the documentation mentions an old version of the program, do I understand correctly that it is worth using it for android versions 13 and below?

I hope you can help me.

The compression level is set separately for each file inside a zip. For an OTA, the payload.bin inside the zip must be stored uncompressed or else it's not flashable (nor readable by avbroot).

Can you link to lineage-device.zip? Has it been modified by any other tool? (Even extracting and recompressing the zip will break it.)


Initially blamed on the system (Manjaro), on it, your software does not run at all

Do you still have the error when running on Manjaro? avbroot should work on every Linux system.

The compression level is set separately for each file inside a zip. For an OTA, the payload.bin inside the zip must be stored uncompressed or else it's not flashable (nor readable by avbroot).

Sorry for the long reply. I downloaded the “original” image from the Lineage website for my device.
Now I am getting these errors:

./avbroot ota patch --input lineage-21.0-20240823-nightly-coral-signed.zip  --key-avb avb.key --key-ota ota.key --cert-ota ota.crt --magisk app-release.apk --magisk-preinit-device sda11 

  8.104s  INFO Replacing zip entry: META-INF/com/android/otacert
  8.104s  INFO Copying zip entry: apex_info.pb
  8.104s  INFO Copying zip entry: care_map.pb
  8.104s  INFO Patching zip entry: payload.bin
  8.107s  INFO Extracting from original payload: boot
  8.726s  INFO Extracting from original payload: vbmeta_system
  8.726s  INFO Extracting from original payload: system
 18.241s  INFO Extracting from original payload: vbmeta
 18.241s  INFO Patching boot images: boot
 24.321s  INFO Patching system image: system
 30.541s  INFO Patched otacerts.zip offsets in system: [300224512..300226048]
 30.541s  INFO Patching vbmeta images: vbmeta_system, vbmeta
 30.754s ERROR Failed to patch OTA zip

Caused by:
    0: Failed to patch payload: payload.bin
    1: Verified boot is disabled by vbmeta's header flags: 0x3

Do you still have the error when running on Manjaro? avbroot should work on every Linux system.

Manjaro gives an error like this:
avbroot: command not found
Naturally, the following was executed before the execution: chmod +x avbroot

The problem also persists if you use ./

What have I done..

Sorry)

1: Verified boot is disabled by vbmeta's header flags: 0x3

You'll need to add this https://github.com/chenxiaolong/avbroot/?tab=readme-ov-file#clearing-vbmeta-flags and then you should be good to go.

Manjaro gives an error like this:
avbroot: command not found
Naturally, the following was executed before the execution: chmod +x avbroot

Ah, if you use ./avbroot like what you're doing now, then it should work fine on Manjaro too.