Skip to content

Instantly share code, notes, and snippets.

earlyprintk=sunxi-uart,0x01c28000
initcall_debug=0
console=ttyS0,115200
nand_root=/dev/nand0p5
mmc_root=/dev/mmcblk0p5
init=/init
loglevel=8
cma=8M
setargs_nand=setenv bootargs earlyprintk=${earlyprintk} initcall_debug=${initcall_debug} console=${console} loglevel=${loglevel} root=${nand_root} init=${init} partitions=${partitions} cma=${cma} snum=${snum} mac_addr=${mac} wifi_mac=${wifi_mac} bt_mac=${bt_mac}
setargs_mmc=setenv bootargs earlyprintk=${earlyprintk} initcall_debug=${initcall_debug} console=${console} loglevel=${loglevel} root=${mmc_root} init=${init} rootwait partitions=${partitions} cma=${cma} snum=${snum} mac_addr=${mac} wifi_mac=${wifi_mac} bt_mac=${bt_mac}
python3 avbtool.py info_image --atx --image /mnt/c/Users/seanh/Desktop/vbmeta.img
Minimum libavb version: 1.1
Header Block: 256 bytes
Authentication Block: 576 bytes
Auxiliary Block: 6080 bytes
Public key (sha1): 340ac92fd2fcaa2c6fd1262a15aa215f828d39ca
Algorithm: SHA512_RSA4096
Rollback Index: 1
Flags: 0
Rollback Index Location: 0
First you'll need to clone acdb_extract. I used the one by J510-Dev which is originally based on the one by luca020400.
git clone https://github.com/J510-Dev/acdb_extract
Then, as the README says you must generate the acdb header. For Qualcomm devices? The stock audio hal would be audio.primary.msm8996.so which is found on my stock ROM from /system/lib/hw/audio.primary.msm8996.so which I could just copy into the acdb_get folder... so for example, I'd use this:
./generate_acdb_data.sh audio.primary.msm8996.so
which will generate a file called acdb_data.h which is needed for the next step.
Since acdb_extract doesn't require being built in the AOSP environment? You can just build it using...
Make sure the device's and/or commonized device proprietary-files are updated with the same blobs that you want in your proprietary vendor repo.
Next, to use the kang and section mode we need the switches "-k -s". -k tells extract-files to only kang/pull updated blobs without deleting any blobs. -s tells it to only update ones from a commented section of your proprietary-files.
for example, if i have this in my proprietary-files
# ADSP - from oneplus3t - OnePlus/OnePlus3/OnePlus3T:9/PKQ1.181203.001/1911042108 - OOS 9.0.6
vendor/lib/libadsp_hvx_callback_skel.so
vendor/lib/libadsp_hvx_stub.so
# When you need to map emmc blocks to mounts without root and no access to /dev
# Start by finding the target - look in /sys/dev/block for major:minor block devices
# that will link to mmcblk0, and use that in the first cd below (too lazy to script it today, sue me)
# EarlyMon 2016/01/27
# Steal this method :D
cd /sys/devices/soc.0/7824900.sdhci/mmc_host/mmc0/mmc0:0001/block/mmcblk0
for i in mmcblk0p*
do
cat $i/uevent | grep "NAME"