g12-common: Properly support AVB and non-AVB targets
authorBruno Martins <bgcngm@gmail.com>
Sun, 22 Oct 2023 22:34:42 +0000 (23:34 +0100)
committerNolen Johnson <johnsonnolen@gmail.com>
Mon, 23 Oct 2023 20:08:48 +0000 (16:08 -0400)
The devkits do not support AVB, therefore a separate fstab must be used.
Copied over from existing fstab, with references to AVB removed as well
as mounting of /dev/block/tee partition skipped.

Change-Id: Id943a4f959a2e500c59b1def14a7abee69d8839c

g12.mk
init-files/Android.mk [new file with mode: 0644]
init-files/fstab_no_avb.amlogic [new file with mode: 0644]

diff --git a/g12.mk b/g12.mk
index 7d77e3627ef24393b5b5db49074dbffdb92aab47..ee90a757c3e33e5ce05c66dd8a7207fbaa532a92 100644 (file)
--- a/g12.mk
+++ b/g12.mk
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2021-2022 The LineageOS Project
+# Copyright (C) 2021-2023 The LineageOS Project
 #
 # SPDX-License-Identifier: Apache-2.0
 #
@@ -80,7 +80,6 @@ PRODUCT_PACKAGES += \
 
 # Init-Files
 PRODUCT_COPY_FILES += \
-    $(LOCAL_PATH)/init-files/fstab.amlogic:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.amlogic \
     $(LOCAL_PATH)/init-files/init.amlogic.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.rc \
     $(LOCAL_PATH)/init-files/init.amlogic.board.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.board.rc \
     $(LOCAL_PATH)/init-files/init.amlogic.media.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.amlogic.media.rc \
@@ -88,6 +87,9 @@ PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/init-files/init.recovery.amlogic.rc:recovery/root/init.recovery.amlogic.rc \
     $(LOCAL_PATH)/init-files/ueventd.rc:$(TARGET_COPY_OUT_VENDOR)/etc/ueventd.rc
 
+PRODUCT_PACKAGES += \
+    fstab.amlogic
+
 ## Kernel Modules
 PRODUCT_PACKAGES += \
     mali \
diff --git a/init-files/Android.mk b/init-files/Android.mk
new file mode 100644 (file)
index 0000000..5ebe716
--- /dev/null
@@ -0,0 +1,13 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE           := fstab.amlogic
+LOCAL_MODULE_TAGS      := optional
+LOCAL_MODULE_CLASS     := ETC
+ifneq ($(TARGET_HAS_TEE),false)
+LOCAL_SRC_FILES        := fstab.amlogic
+else
+LOCAL_SRC_FILES        := fstab_no_avb.amlogic
+endif
+LOCAL_MODULE_PATH      := $(TARGET_OUT_VENDOR_ETC)
+include $(BUILD_PREBUILT)
diff --git a/init-files/fstab_no_avb.amlogic b/init-files/fstab_no_avb.amlogic
new file mode 100644 (file)
index 0000000..176b797
--- /dev/null
@@ -0,0 +1,25 @@
+## Dynamic partitions
+odm                   /odm                ext4      ro,barrier=1,discard                                             wait,logical,first_stage_mount
+product               /product            ext4      ro,barrier=1,discard                                             wait,logical,first_stage_mount
+system                /system             ext4      ro,barrier=1,discard                                             wait,logical,first_stage_mount
+system_ext            /system_ext         ext4      ro,barrier=1,discard                                             wait,logical,first_stage_mount
+vendor                /vendor             ext4      ro,barrier=1,discard                                             wait,logical,first_stage_mount
+
+## Block devices
+/dev/block/boot       /boot               emmc      defaults                                                         recoveryonly
+/dev/block/dtbo       /dtbo               emmc      defaults                                                         defaults
+/dev/block/cache      /cache              ext4      noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic    wait,check,formattable
+/dev/block/data       /data               ext4      noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic    wait,check,fileencryption=aes-256-xts:aes-256-cts:v1,quota,formattable,reservedsize=32M,checkpoint=block
+/dev/block/metadata   /metadata           ext4      noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic    wait,check,formattable,first_stage_mount
+/dev/block/misc       /misc               emmc      defaults                                                         defaults
+/dev/block/param      /mnt/vendor/param   ext4      noatime,nosuid,nodev,nodelalloc,nomblk_io_submit,errors=panic    wait,check,quota,formattable
+/dev/block/recovery   /recovery           emmc      defaults                                                         recoveryonly
+
+## Virtual devices
+/dev/block/loop       auto                loop      defaults                                                         voldmanaged=loop:auto
+/dev/block/zram0      none                swap      defaults                                                         wait,zramsize=268435456
+
+## Removable devices
+/devices/*.sd*/mmc_host/sd*                                    auto             auto      defaults                   voldmanaged=sdcard1:auto,encryptable=userdata
+/devices/*dwc3/xhci-hcd.0.auto/usb?/*/host*/target*/block/sd*  auto             auto      defaults                   voldmanaged=usb:auto,encryptable=userdata
+/devices/*dwc3/xhci-hcd.0.auto/usb?/*/host*/target*/block/sr*  auto             auto      defaults                   voldmanaged=sr0:auto,encryptable=userdata