Android_boot_image_editor icon indicating copy to clipboard operation
Android_boot_image_editor copied to clipboard

Support for vendor_dlkm img

Open hosiet opened this issue 2 years ago • 4 comments

I am wondering if you would like to add support for vendor_dlkm images, which is becoming increasingly common as described in https://source.android.com/devices/bootloader/partitions/vendor-odm-dlkm-partition . You may find such partition image from current Pixel 6 ROMs.

-> % ls
aosp      build             gradle       helper              README.md            tools
avbImpl   build.gradle.kts  gradlew      integrationTest.py  settings.gradle.kts  uiderrors
bbootimg  doc               gradlew.bat  LICENSE.md          src                  vendor_dlkm.img


-> % ./gradlew unpack

> Task :unpack FAILED
20:24:39.632 [main] WARN  cfig.packable.PackableLauncher - No handler is activated, DO NOTHING!

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':unpack'.
> Process 'command '/usr/lib/jvm/java-18-openjdk-amd64/bin/java'' finished with non-zero exit value 2

hosiet avatar Aug 02 '22 00:08 hosiet

image conversion "sparse image -> raw ext4 image " is supported. But image mounting and editing aren't supported.

cfig avatar Aug 03 '22 06:08 cfig

BTW, what's your ideal work flow on vendor_dlkm.img ? As the output will be raw ext4/erofs image file, we can use some linux tools(eg. udisksctl) to mount/view/unmount it. And such operations aren't integrated in the tool.

cfig avatar Aug 03 '22 10:08 cfig

Thanks for your work. Ideally I am looking for an end-to-end solution on unpacking/editing/repacking an existing vendor_dlkm.img file, but seems that it is not available yet.

For workflow: the mount/view/umount operations should not be a major problem; I was even using regular mount(8) on Linux and that works.

hosiet avatar Aug 03 '22 14:08 hosiet

Besides, with current git HEAD 68afa1834e677d6a5ded459fa2bd35145c7f14cd the unpack action cannot give any results. After running ./gradlew unpack, ./build/unzip_boot/ dir is empty. I have set bHackingMode = true in build.gradle.kts file.

I am attaching the file sample here as well.

% file vendor_dlkm.img
vendor_dlkm.img: Linux rev 1.0 ext2 filesystem data, UUID=15718fdd-fd35-585a-a26d-2215dc1f0c1b, volume name "vendor_dlkm" (extents) (large files) (huge files)

vendor_dlkm.zip

hosiet avatar Aug 03 '22 21:08 hosiet

7z is required to extract ext4.

19:04:54.694 [main] INFO  Helper - 7z x build/unzip_boot/vendor_dlkm.img -y -obuild/unzip_boot/vendor_dlkm

I just submited a commit to support the "pack" task. Nicely have a try ~

cfig avatar Dec 27 '23 11:12 cfig