1

There is a vendor image in my device I want to change (unpack/mount, doing changes, pack/umount).

My purpose is to update boot.img with my new kernel (in rooted device).

Unfortinatly it does not working due incompatible versions between a new compiled kernel (my compilation) to the previous kernel modules stored in vendor.img.

As I figure it, I need to update the old "ko" executables stored in vendor.img in my product.

The first step is to do "dd" from my device and "adb pull" it out to my build environment. While I tried to do mount on vendor.img I discovered It not working due "shared_blockes" attribute block it to mount as "RW" (dmesg wrote: "...unsupported optional features (4000)"), To solve it, running the following command

e2fsck -y -E unshare_blocks vendor.img

will disable "share_blocks" feature prevented me to do mount as RW, Of course doing mount RW working correctly !

In the last phase, I tried to replace files in vendor filesystem and then I discovered another challenge into my way, Unfortunately, there was a problem with limited space in the file-system,

For example: In case I want to replace kernel module called "abc.ko", Delete the file doesn't show any new free space in the file-system ! In this point I cant update the old kernel modules with new one (compatible to the new compiled kernel), Of course running "df -h ." returned not free space and 100% used, Anyone have any idea what I need to do ?

Thanks,

3

1 Answer 1

0

assuming vendor is standalone partition (for super partition refer to other question)

adb pull /dev/block/platform/bootdevice/by-name/vendor vendor.img
dd if=/dev/zero bs=1G seek=1 count=0 of=vendor.img
resize2fs vendor.img 1G
e2fsck -E unshare_blocks vendor.img
e2fsck -yf vendor.img
adb push vendor.img /dev/block/platform/bootdevice/by-name/vendor

that will resize to 1G total

1
  • Thanks, but it's no help me because you cannot enlarge vendor partition.
    – sivandahan
    Sep 19, 2021 at 13:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .