This small script was made to aid in porting modifications of Huawei Balong modems and routers to any original firmware.
Not all Balong devices have ready-to-use custom firmware files, as some routers are less common or more expensive than others. Many modifications are universal within selected Balong family and work on any family device.
This script is made to port such universal modifications to any device in automatic mode, and to make modification maintenance easier and cleaner.
Currently there's Balong V7R1, V7R2 and V7R11 family files present in this repository, for devices with and without OLED screen.
Features:
The kitchen has 2 main directories: base directory, where the family files are stored, and device_overlay directory, for device-specific scripts, configuration and binary files.
There are also pre-copy and post-copy scripts, which run before and after base and device_overlay files are copied, as well as output (building) scripts, which output final cpio image.
Consider the following: you want to build a firmware for E8372h-153 version 21.333.64.00.1456. You take the original firmware, unpack it, and run the script:
$ ./build.sh v7r11 e8372h orig_fw
Original firmware
⇓
base → v7r11
⇓
device_overlay → e8372h
⇓
Custom firmware
workdir
base/v7r11/before_copy.sh
is executedbase/v7r11/
files are copied into workdir
base/v7r11/after_copy.sh
is executeddevice_overlay/e8372h/before_copy.sh
is executeddevice_overlay/e8372h/
files are copieddevice_overlay/e8372h/after_copy.sh
is executeddevice_overlay/e8372h/output.sh
is executed. If it's missing, base/v7r11/output.sh
is run.You'll get modified file system in workdir/system
and cpio image in workdir/system.cpio
.
Add your device folder into device_overlay
and execute the script.
build.sh <balong family from base folder> <device name from device_overlay> <original firmware directory>
Example: build.sh v7r11 e8372h-153_zong_21.333.64.00.1456 orig_fw
Original firmware directory should contain system
and app
directories with files from corresponding partitions. Do get this structure, the firmware should be unpacked first (could be done with balongflash), then the system
and app
partitions should be unpacked with cpio -iv < file.bin
command.
Modem families (V7R1/V7R11 etc) are described in balong_series document.