Huawei S7721u Recovery Image Verify Failed Repack Work -

Informative Report: Huawei S7721U – “Recovery Image Verify Failed” Error and Repack Solution

3. Methodology A: Correcting the Header Checksum (The "Repack" Fix)

If the device is checking a plaintext hash (common in non-secure-boot models or specific partition updates), you must update the image header after modifying the file.

Tools Required:

Procedure:

  1. Analyze the Stock Image: Use binwalk -e original_image.bin to extract the kernel and rootfs.
  2. Modify Files: Apply your necessary modifications to the rootfs (e.g., squashfs-root).
  3. Repack:
    • Rebuild the squashfs filesystem: mksquashfs squashfs-root rootfs.bin -b 4096 -comp xz
    • Combine Kernel and Rootfs.
  4. Update Header (Critical Step): Many Huawei images use a specific header format. You must calculate the SHA256/MD5 of the newly packed data and insert it into the specific offset in the file header.
    • Note: If you simply repack the file without updating the header offset, U-Boot will read the old hash from the header, compare it to the new file data, and fail.

3.2 Common Triggers

| Cause | Explanation | |-------|-------------| | Corrupted download | File transfer error or incomplete image. | | Version mismatch | Trying to downgrade to an unsigned or older version. | | Modified repack | User unpacks, changes content (e.g., busybox, scripts), and repacks without resigning. | | Wrong image type | Flashing an image intended for a different Huawei device variant. | huawei s7721u recovery image verify failed repack

3.7 Repack Final Image

If you extracted a signature earlier, re‑append it:

cat recovery_nosig.img signature.bin > recovery_new.img

3.5 Repacking the Filesystem

After modifications:

mksquashfs recovery_root/ new_recovery.squashfs -comp lzo -b 131072 -noappend

Step 1: Obtain a Clean Recovery Image

You cannot simply "repair" a corrupted image by renaming it. You must source a clean copy. Linux environment (WSL or VM) binwalk (for extraction)

  1. Download the full stock firmware for the Huawei S7721U.
  2. Locate the UPDATE.APP file within the firmware folder.
  3. Open Huawei Update Extractor.
  4. Load the UPDATE.APP file.
  5. Locate the RECOVERY.img entry in the list.
  6. Right-click and select Extract Selected. Save this file as recovery_stock.img.

3.1 Extract Stock Recovery

# If you have update.bin
unpack_update.py -f update.bin -o extracted/

3.4 Mounting and Modifying the Recovery Image

Use binwalk to find the SquashFS start offset:

binwalk original_recovery.img

Output example:

DECIMAL       HEXADECIMAL     DESCRIPTION
0             0x0             U-Boot uImage header
64            0x40            LZMA compressed data
262144        0x40000         Squashfs filesystem

Extract the SquashFS part:

dd if=original_recovery.img of=recovery.squashfs bs=1 skip=262144

Mount it (or use unsquashfs):

sudo mount -t squashfs -o loop recovery.squashfs /mnt/recovery
# Or:
unsquashfs -d recovery_root recovery.squashfs

Now modify the contents. Common fixes:

  • Replace a corrupted rcS or init script.
  • Add dropbear SSH binary for remote recovery.
  • Remove password checks from passwd.
X