安卓7.1去掉一个vendor分区

安卓7.1默认有2个vendor分区,编译完之后发现这2个分区的内容一模一样,这样就造成emmc空间浪费,所以就想办法减少一个分区,修改方法如下:

Index: device/rockchip/rk3288/parameter.txt
===================================================================
--- device/rockchip/rk3288/parameter.txt	(revision 1893)
+++ device/rockchip/rk3288/parameter.txt	(working copy)
@@ -7,4 +7,4 @@
 MACHINE: 3288
 CHECK_MASK: 0x80
 PWR_HLD: 0,0,A,0,1
-CMDLINE: console=ttyFIQ0 androidboot.baseband=N/A androidboot.selinux=permissive androidboot.hardware=rk30board androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00002000@0x00004000(trust),0x00002000@0x00006000(misc),0x00008000@0x00008000(resource),0x0000C000@0x00010000(kernel),0x00010000@0x0001C000(boot),0x00010000@0x0002C000(recovery),0x00038000@0x0003C000(backup),0x00040000@0x00074000(cache),0x00400000@0x000B4000(system),0x00008000@0x004B4000(metadata),0x00038000@0x004BC000(vendor0),0x00038000@0x004f4000(vendor1),0x00001000@0x0052c000(oem),-@0x0052d000(userdata)
+CMDLINE: console=ttyFIQ0 androidboot.baseband=N/A androidboot.selinux=permissive androidboot.hardware=rk30board androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00002000@0x00004000(trust),0x00002000@0x00006000(misc),0x00008000@0x00008000(resource),0x0000C000@0x00010000(kernel),0x00010000@0x0001C000(boot),0x00010000@0x0002C000(recovery),0x00038000@0x0003C000(backup),0x00040000@0x00074000(cache),0x00400000@0x000B4000(system),0x00008000@0x004B4000(metadata),0x001A0000@0x004BC000(vendor1),-@0x0065C000(userdata)

===================================================================
--- device/rockchip/rk3288/BoardConfig.mk	(revision 1893)
+++ device/rockchip/rk3288/BoardConfig.mk	(working copy)
@@ -96,7 +96,7 @@
 #Calculate partition size from parameter.txt
 USE_DEFAULT_PARAMETER := $(shell test -f $(TARGET_DEVICE_DIR)/parameter.txt && echo true)
 ifeq ($(strip $(USE_DEFAULT_PARAMETER)), true)
-  BOARD_VENDORIMAGE_PARTITION_SIZE := $(shell python device/rockchip/common/get_partition_size.py $(TARGET_DEVICE_DIR)/parameter.txt vendor0)
+  BOARD_VENDORIMAGE_PARTITION_SIZE := $(shell python device/rockchip/common/get_partition_size.py $(TARGET_DEVICE_DIR)/parameter.txt vendor1)
   #$(info Calculated BOARD_VENDORIMAGE_PARTITION_SIZE=$(BOARD_VENDORIMAGE_PARTITION_SIZE) use $(TARGET_DEVICE_DIR)/parameter.txt)
 else
   BOARD_VENDORIMAGE_PARTITION_SIZE ?= 52428800
@@ -109,8 +109,3 @@
 
 # Enable optee service
 PRODUCT_HAVE_OPTEE := true
-
-
-#openssh
-
-BOARD_SUPPORT_OPENSSH := false
\ No newline at end of file
install.cpp 这个文件修改的目的是ota升级的时候会拷贝vendor0分区,这里不返回的话升级过程会出错
Index: bootable/recovery/updater/install.cpp
===================================================================
--- bootable/recovery/updater/install.cpp	(revision 1893)
+++ bootable/recovery/updater/install.cpp	(working copy)
@@ -1931,6 +1931,11 @@
 
 
         printf("Start to load %s from update.zip.\n", src_name.c_str());
+		if(!strcmp(src_name.c_str(),"vendor0.img")){
+			printf("update vendor0 return\n");
+			Success =true;
+			goto done;
+		}
         loader_entry = mzFindZipEntry(zip, src_name.c_str());
         if (loader_entry == NULL){
             printf("Can't find %s in update.zip.\n", src_name.c_str());

你可能感兴趣的:(android)