1

我想在system.img中进行一些更改并将其闪存到我的 Nexus 5 中。

要修改 .img,我首先需要将其解压缩到文件系统中,进行更改然后重新打包到新的 system.img 中。

我正在按照本指南进行解包/重新打包。

我正在采取的步骤:

一、克隆ASOP脚本:

  1. git clone https://android.googlesource.com/platform/system/extras
  2. git clone https://android.googlesource.com/platform/external/libselinux/
  3. git clone https://android.googlesource.com/platform/system/core/

二、结帐特定版本:

  1. cd extras
  2. git checkout android-5.1.1_r9

三、编译c文件创建make_ext4fs(用于将文件系统重新打包成img)

  1. cd ..
  2. 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

但是上面的命令给了我错误:

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

它说 fs_config 未声明。但这是 ASOP 代码,仅由 Android 提供。

我错过了什么..?

我想我已经包含了所有的头文件,但现在我不确定。

请帮忙。这非常令人沮丧。

PS - 我是 C 的菜鸟。如果有人能用简单的术语解释的话,会有很大的帮助。

谢谢你

4

0 回答 0