From aca358a13392b3b0848cad547f59c9cdbca7d051 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Fri, 12 Feb 2021 04:17:20 +0000 Subject: hikey960: Add deferred-free-helper.ko and page_pool.ko to the ramdisk The new deferred-free-helper and page pool modules for dmabuf heaps are prerequisites for the system heap, so we need to include them in the initrd along with the system_heap.ko Signed-off-by: John Stultz Change-Id: I0b3717ab1f1d5f9f87363af46e4059de46ae76a3 --- hikey960.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hikey960.mk b/hikey960.mk index 03d0b962..243b0028 100644 --- a/hikey960.mk +++ b/hikey960.mk @@ -43,6 +43,8 @@ ifneq ($(HIKEY_USES_GKI),) HIKEY_MODS := $(wildcard $(HIKEY_MOD_DIR)/*.ko) SDCARDFS_KO := $(wildcard $(HIKEY_MOD_DIR)/sdcardfs*.ko) CMA_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/cma_heap.ko) + DEFERRED_FREE_KO := $(wildcard $(HIKEY_MOD_DIR)/deferred-free-helper.ko) + PAGE_POOL_KO := $(wildcard $(HIKEY_MOD_DIR)/page_pool.ko) SYSTEM_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/system_heap.ko) ION_CMA_HEAP_KO := $(wildcard $(HIKEY_MOD_DIR)/ion_cma_heap*.ko) ifneq ($(HIKEY_MODS),) @@ -50,6 +52,8 @@ ifneq ($(HIKEY_USES_GKI),) BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \ $(CMA_HEAP_KO) \ $(SYSTEM_HEAP_KO) \ + $(DEFERRED_FREE_KO) \ + $(PAGE_POOL_KO) \ $(ION_CMA_HEAP_KO) \ $(SDCARDFS_KO) endif -- cgit v1.2.3 From a8cd4d963758cbcaaaf83a1f6c864c27f01f1034 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Tue, 2 Feb 2021 04:31:01 +0000 Subject: hikey960: fstab.hikey960 Add new dynamic partitions to the vendor fstab While we boot up properly with the dynamic partitions in only the ramdisk fstab, Yongqin noted adb remount was failing recently. On looking into the issue, I realized one issue is we don't have the dynamic paritions listed in the vendor fstab which causes some of the remount logic to not find the partitions. This patch adds the dynamic partitions and unifies the fstab file for hikey960 so we have the same one for both the ramdisk and vendor image. NOTE: adb remount still does not fully work with this change. We will need a follow on patch to fix that. Signed-off-by: John Stultz Change-Id: Idf9c463162398ef89db31fbf69d205d1a47e2cdd --- fstab.ramdisk960 | 4 ---- hikey960/device-hikey960.mk | 2 +- hikey960/fstab.hikey960 | 6 ++++-- 3 files changed, 5 insertions(+), 7 deletions(-) delete mode 100644 fstab.ramdisk960 diff --git a/fstab.ramdisk960 b/fstab.ramdisk960 deleted file mode 100644 index 098386d5..00000000 --- a/fstab.ramdisk960 +++ /dev/null @@ -1,4 +0,0 @@ -system /system ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect -vendor /vendor ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect -system_ext /system_ext ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect -product /product ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect diff --git a/hikey960/device-hikey960.mk b/hikey960/device-hikey960.mk index d9010354..46ffbe72 100644 --- a/hikey960/device-hikey960.mk +++ b/hikey960/device-hikey960.mk @@ -28,7 +28,7 @@ PRODUCT_COPY_FILES += $(TARGET_PREBUILT_KERNEL):kernel \ $(TARGET_PREBUILT_DTB):hi3660-hikey960.dtb PRODUCT_COPY_FILES += $(LOCAL_PATH)/fstab.hikey960:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.hikey960 \ - device/linaro/hikey/fstab.ramdisk960:$(TARGET_COPY_OUT_RAMDISK)/fstab.hikey960 \ + $(LOCAL_PATH)/fstab.hikey960:$(TARGET_COPY_OUT_RAMDISK)/fstab.hikey960 \ device/linaro/hikey/hikey960/init.hikey960.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey960.rc \ device/linaro/hikey/init.hikey960.power.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey960.power.rc \ device/linaro/hikey/hikey960/init.hikey960.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.hikey960.usb.rc \ diff --git a/hikey960/fstab.hikey960 b/hikey960/fstab.hikey960 index 0a254ceb..53e1ae4b 100644 --- a/hikey960/fstab.hikey960 +++ b/hikey960/fstab.hikey960 @@ -11,5 +11,7 @@ /devices/platform/soc/ff37f000.dwmmc1/mmc_host/mmc* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata /devices/platform/soc/ff200000.hisi_usb/ff100000.dwc3/xhci-hcd.*.auto/usb* auto auto defaults voldmanaged=usbdisk:auto,encryptable=userdata /devices/platform/soc/f4000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/nvme/nvme* auto auto defaults voldmanaged=nvmedisk:auto,encryptable=userdata -/dev/block/by-name/system /system ext4 ro,errors=panic wait,first_stage_mount -/dev/block/by-name/vendor /vendor ext4 ro,errors=panic wait,first_stage_mount +system /system ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect +vendor /vendor ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect +system_ext /system_ext ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect +product /product ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect -- cgit v1.2.3 From e8fe717c88f80162d69307352ba06bf1121c861f Mon Sep 17 00:00:00 2001 From: John Stultz Date: Tue, 2 Feb 2021 04:31:01 +0000 Subject: hikey960: Add /metadata support (reusing cache partition) With dynamic partitions we need /metadata mounted to properly make 'adb remount' work. So this makes use of the unused cache partition to mount it as metadata (along with the needed build env values). With this patch 'adb remount' works. Signed-off-by: John Stultz Change-Id: I33da79ec15b453dbdc3b8a3180863abeb67d4cb6 --- hikey960/BoardConfig.mk | 2 ++ hikey960/fstab.hikey960 | 1 + sepolicy/file_contexts | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hikey960/BoardConfig.mk b/hikey960/BoardConfig.mk index 939723b0..b3a059fd 100644 --- a/hikey960/BoardConfig.mk +++ b/hikey960/BoardConfig.mk @@ -51,6 +51,7 @@ TARGET_COPY_OUT_SYSTEM_EXT := system_ext BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4 TARGET_COPY_OUT_PRODUCT := product BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_USES_METADATA_PARTITION := true #Dynamic Partition details TARGET_USE_DYNAMIC_PARTITIONS := true @@ -59,6 +60,7 @@ BOARD_SUPER_PARTITION_SIZE := 4915724288 BOARD_SUPER_PARTITION_GROUPS := hikey960_dynamic_partitions BOARD_HIKEY960_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor system_ext product BOARD_HIKEY960_DYNAMIC_PARTITIONS_SIZE := 4915724288 +BOARD_SUPER_PARTITION_METADATA_DEVICE := super BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE := true TARGET_RECOVERY_FSTAB := device/linaro/hikey/hikey960/fstab.hikey960 diff --git a/hikey960/fstab.hikey960 b/hikey960/fstab.hikey960 index 53e1ae4b..63326f60 100644 --- a/hikey960/fstab.hikey960 +++ b/hikey960/fstab.hikey960 @@ -8,6 +8,7 @@ #/dev/block/platform/soc/ff3b0000.ufs/by-name/userdata /data ext4 discard,noauto_da_alloc,data=ordered,user_xattr,barrier=1 wait /dev/block/by-name/userdata /data f2fs discard,noatime,nosuid,nodev wait,check,fileencryption=software,quota /dev/block/by-name/userdata /data ext4 discard,noatime,nosuid,nodev,noauto_da_alloc,data=ordered,user_xattr,barrier=1,inlinecrypt wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,quota +/dev/block/by-name/cache /metadata ext4 noatime,nosuid,nodev,discard wait,formattable /devices/platform/soc/ff37f000.dwmmc1/mmc_host/mmc* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata /devices/platform/soc/ff200000.hisi_usb/ff100000.dwc3/xhci-hcd.*.auto/usb* auto auto defaults voldmanaged=usbdisk:auto,encryptable=userdata /devices/platform/soc/f4000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/nvme/nvme* auto auto defaults voldmanaged=nvmedisk:auto,encryptable=userdata diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 6a1f8d3d..1e712113 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -35,7 +35,7 @@ /dev/block/platform/soc/f723d000\.dwmmc0/by-name/userdata u:object_r:userdata_block_device:s0 # for HiKey960 Board -/dev/block/platform/soc/ff3b0000\.ufs/by-name/cache u:object_r:cache_block_device:s0 +/dev/block/platform/soc/ff3b0000\.ufs/by-name/cache u:object_r:metadata_block_device:s0 /dev/block/platform/soc/ff3b0000\.ufs/by-name/userdata u:object_r:userdata_block_device:s0 -- cgit v1.2.3 From 980b13085254f83937912453f8d6ad18ada248d0 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Fri, 19 Feb 2021 04:36:53 +0000 Subject: hikey960: flash-all: Make sure to format cache partition We are re-using the cache partition as /metadata, so make sure we format it when flashing to avoid quirks due to outdated data left behind on the metadata parititon. Signed-off-by: John Stultz Change-Id: I03d254785f9f8d3fde49b0dc3e19e22c542fd0ea --- installer/hikey960/flash-all.sh | 1 + installer/hikey960/uefi-flash-all.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/installer/hikey960/flash-all.sh b/installer/hikey960/flash-all.sh index 2828089a..a2c97a0c 100755 --- a/installer/hikey960/flash-all.sh +++ b/installer/hikey960/flash-all.sh @@ -26,4 +26,5 @@ fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img fastboot flash dts "${ANDROID_PRODUCT_OUT}"/dt.img fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img +fastboot format cache fastboot reboot diff --git a/installer/hikey960/uefi-flash-all.sh b/installer/hikey960/uefi-flash-all.sh index 9c7301dc..c2f06aff 100755 --- a/installer/hikey960/uefi-flash-all.sh +++ b/installer/hikey960/uefi-flash-all.sh @@ -46,6 +46,7 @@ function flashing_atf_uefi () { fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img + fastboot format cache } function upgrading_ptable_1mb_aligned () { -- cgit v1.2.3