zenfone8: Switch to /vendor_dlkm for kernel modules

 * This lets us flash /vendor regardless of the kernel situation.

Change-Id: Ie1c18354b26006e416d06474f5844ceef3cfbaf3
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 819da92..2426713 100755
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -35,7 +35,8 @@
     vbmeta \
     vbmeta_system \
     vendor \
-    vendor_boot
+    vendor_boot \
+    vendor_dlkm
 
 # Architecture
 TARGET_ARCH := arm64
@@ -266,6 +267,7 @@
 BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
 BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_VENDOR_DLKMIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_BOOTIMAGE_PARTITION_SIZE := 100663296
 BOARD_KERNEL_BINARIES := kernel
 BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 100663296
@@ -277,13 +279,15 @@
 TARGET_COPY_OUT_PRODUCT := product
 TARGET_COPY_OUT_SYSTEM_EXT := system_ext
 TARGET_COPY_OUT_VENDOR := vendor
+TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm
 
 BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST := \
     system \
     system_ext \
     odm \
     product \
-    vendor
+    vendor \
+    vendor_dlkm
 
 BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := 7512192768 # BOARD_SUPER_PARTITION_SIZE - 4MB
 BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions
diff --git a/gpt-utils/gpt-utils.h b/gpt-utils/gpt-utils.h
index 6ca5d6a..262cc5b 100644
--- a/gpt-utils/gpt-utils.h
+++ b/gpt-utils/gpt-utils.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013,2016,2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013,2016,2020-2022 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -87,7 +87,7 @@
 
 #define AB_PTN_LIST                     PTN_SWAP_LIST, \
             "boot", "modem", "odm", "product", "system", "system_ext", "vendor", \
-            "vendor_boot"
+            "vendor_dlkm", "vendor_boot"
 
 #define BOOT_DEV_DIR    "/dev/block/bootdevice/by-name"
 
diff --git a/proprietary-files-vendor.txt b/proprietary-files-vendor.txt
index 2d5dd8f..6296c72 100644
--- a/proprietary-files-vendor.txt
+++ b/proprietary-files-vendor.txt
@@ -2075,7 +2075,7 @@
 vendor/lib/libxml.so
 vendor/lib/libxtadapter.so
 vendor/lib/mediadrm/libwvdrmengine.so
-vendor/lib/modules/modules.blocklist
+vendor/lib/modules/modules.blocklist:vendor_dlkm/lib/modules/modules.blocklist
 vendor/lib/nfc_nci_nxp.so
 vendor/lib/qcrilMarshal.so
 vendor/lib/qcrild_libqcrilnrutils.so
diff --git a/ramdisk/fstab.default b/ramdisk/fstab.default
index 13edaa0..7cb04c2 100644
--- a/ramdisk/fstab.default
+++ b/ramdisk/fstab.default
@@ -39,6 +39,7 @@
 system_ext                                              /system_ext            ext4    ro,barrier=1,discard                                 wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
 product                                                 /product               ext4    ro,barrier=1,discard                                 wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
 vendor                                                  /vendor                ext4    ro,barrier=1,discard                                 wait,slotselect,avb,logical,first_stage_mount
+vendor_dlkm                                             /vendor_dlkm           ext4    ro,barrier=1,discard                                 wait,slotselect,avb,logical,first_stage_mount
 odm                                                     /odm                   ext4    ro,barrier=1,discard                                 wait,slotselect,avb,logical,first_stage_mount
 /dev/block/by-name/metadata                             /metadata              ext4    noatime,nosuid,nodev,discard                         wait,check,formattable,first_stage_mount
 /dev/block/bootdevice/by-name/persist                   /mnt/vendor/persist    ext4    noatime,nosuid,nodev,barrier=1                       wait
diff --git a/regen-vendor.sh b/regen-vendor.sh
index bd48c70..6bdd609 100755
--- a/regen-vendor.sh
+++ b/regen-vendor.sh
@@ -1313,7 +1313,11 @@
 function as_module() {
     sed -i "s|vendor/$1$|-vendor/$1|g" $_output_file
 }
+function add_on() {
+    sed -i "s|vendor/$1$|vendor/$1:vendor_dlkm/$1|g" $_output_file
+}
 
+add_on "lib/modules/modules.blocklist"
 presign "app/com.qualcomm.qti.gpudrivers.lahaina.api30/com.qualcomm.qti.gpudrivers.lahaina.api30.apk"
 as_module "etc/vintf/manifest/android.hardware.gnss@2.1-service-qti.xml"
 as_module "etc/vintf/manifest/android.hardware.neuralnetworks@1.3-service-qti.xml"