I want to make some changes in the system.img and flash it into my Nexus 5.
To modify the .img I first need to unpack it into filesystem, make the changes anf then repack into new system.img.
I'm following this guide for unpack/repack.
Steps I'm taking:
I. Clone ASOP scripts:
git clone https://android.googlesource.com/platform/system/extras
git clone https://android.googlesource.com/platform/external/libselinux/
git clone https://android.googlesource.com/platform/system/core/
II. Checkout specific version:
cd extras
git checkout android-5.1.1_r9
III. Compiling c files to create make_ext4fs (which is used to repack the filesystem into img)
cd ..
gcc -o make_ext4fs -Icore/libsparse/include -Ilibselinux/include -Icore/include -lz extras/ext4_utils/canned_fs_config.c extras/ext4_utils/make_ext4fs_main.c extras/ext4_utils/make_ext4fs.c extras/ext4_utils/ext4fixup.c extras/ext4_utils/ext4_utils.c extras/ext4_utils/allocate.c extras/ext4_utils/contents.c extras/ext4_utils/extent.c extras/ext4_utils/indirect.c extras/ext4_utils/uuid.c extras/ext4_utils/sha1.c extras/ext4_utils/wipe.c core/libsparse/backed_block.c core/libsparse/output_file.c core/libsparse/sparse.c core/libsparse/sparse_crc32.c core/libsparse/sparse_err.c core/libsparse/sparse_read.c
But above command is giving me error:
extras/ext4_utils/make_ext4fs_main.c: In function ‘main’:
extras/ext4_utils/make_ext4fs_main.c:187:20: error: ‘fs_config’ undeclared (first use in this function)
fs_config_func = fs_config;
^
extras/ext4_utils/make_ext4fs_main.c:187:20: note: each undeclared identifier is reported only once for each function it appears in
It says fs_config in undeclared. But this is ASOP code, provided by Android only.
What am I missing..?
I think I've included all the header files, but now I'm not sure.
Please help. This is very frustrating.
P.S. - I'm a noob in C. So great help if anyone can explain in simple terms.
Thank You