From e68a7bc350ab4ab0b47012befff9eb7966f61692 Mon Sep 17 00:00:00 2001 From: J0SH1X Date: Wed, 13 Jul 2022 08:36:10 +0000 Subject: [PATCH 1/3] add fajita support --- Android.mk | 2 +- AndroidProducts.mk | 6 ++++-- build/tasks/kernel.mk | 2 +- fajita/BoardConfig.mk | 14 ++++++++++++++ fajita/device.mk | 29 +++++++++++++++++++++++++++++ fajita/fajita.mk | 24 ++++++++++++++++++++++++ fajita/fstab.ramdisk | 3 +++ 7 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 fajita/BoardConfig.mk create mode 100644 fajita/device.mk create mode 100644 fajita/fajita.mk create mode 100644 fajita/fstab.ramdisk diff --git a/Android.mk b/Android.mk index be7fc78e..26408907 100644 --- a/Android.mk +++ b/Android.mk @@ -20,7 +20,7 @@ # to only building on ARM if they include assembly. Individual makefiles # are responsible for having their own logic, for fine-grained control. -ifneq ($(filter axolotl beryllium enchilada, $(TARGET_DEVICE)),) +ifneq ($(filter axolotl beryllium enchilada fajita, $(TARGET_DEVICE)),) LOCAL_PATH := $(call my-dir) diff --git a/AndroidProducts.mk b/AndroidProducts.mk index 0f666b04..ef92306f 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -12,9 +12,11 @@ PRODUCT_MAKEFILES := \ axolotl:$(LOCAL_DIR)/axolotl/axolotl.mk \ beryllium:$(LOCAL_DIR)/beryllium/beryllium.mk \ - enchilada:$(LOCAL_DIR)/enchilada/enchilada.mk + enchilada:$(LOCAL_DIR)/enchilada/enchilada.mk \ + fajita:$(LOCAL_DIR)/fajita/fajita.mk COMMON_LUNCH_CHOICES := \ axolotl-userdebug \ beryllium-userdebug \ - enchilada-userdebug + enchilada-userdebug \ + fajita-userdebug diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk index a16de142..acea8a4b 100644 --- a/build/tasks/kernel.mk +++ b/build/tasks/kernel.mk @@ -1,4 +1,4 @@ -ifneq ($(filter axolotl beryllium enchilada, $(TARGET_DEVICE)),) +ifneq ($(filter axolotl beryllium enchilada fajita, $(TARGET_DEVICE)),) IMAGE_GZ := device/generic/sdm845/shared/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/Image.gz DTB := $(wildcard device/generic/sdm845/shared/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/*.dtb) diff --git a/fajita/BoardConfig.mk b/fajita/BoardConfig.mk new file mode 100644 index 00000000..3c278172 --- /dev/null +++ b/fajita/BoardConfig.mk @@ -0,0 +1,14 @@ +include device/generic/sdm845/shared/BoardConfig.mk + +# Copied from https://github.com/LineageOS/android_device_oneplus_sdm845-common/blob/lineage-16.0/BoardConfigCommon.mk +# Board Information +TARGET_BOOTLOADER_BOARD_NAME := fajita +TARGET_BOARD_PLATFORM := fajita +TARGET_SCREEN_DENSITY := 400 + +# Kernel/boot.img Configuration +BOARD_KERNEL_CMDLINE += androidboot.hardware=fajita + +# Image Configuration +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2998927360 +BOARD_USERDATAIMAGE_PARTITION_SIZE := 57453555712 diff --git a/fajita/device.mk b/fajita/device.mk new file mode 100644 index 00000000..8f13b396 --- /dev/null +++ b/fajita/device.mk @@ -0,0 +1,29 @@ +# +# Copyright (C) 2011 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +PRODUCT_COPY_FILES := \ + $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_RAMDISK)/fstab.fajita \ + $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.fajita \ + device/generic/sdm845/shared/etc/audio.sdm845.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio.fajita.xml \ + device/generic/sdm845/shared/init.sdm845.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.fajita.rc \ + device/generic/sdm845/shared/init.sdm845.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.fajita.usb.rc \ + device/generic/sdm845/shared/key_layout.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/fajita.kl + +# Build generic Audio HAL +PRODUCT_PACKAGES := audio.primary.fajita + +# Build generic lights HAL +PRODUCT_PACKAGES += lights.fajita diff --git a/fajita/fajita.mk b/fajita/fajita.mk new file mode 100644 index 00000000..d015585b --- /dev/null +++ b/fajita/fajita.mk @@ -0,0 +1,24 @@ +ifndef TARGET_KERNEL_USE +TARGET_KERNEL_USE := mainline +endif + +KERNEL_MODS := $(wildcard device/generic/sdm845/shared/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/*.ko) + +# Following modules go to vendor partition +# msm.ko is too big (31M) for ramdisk +VENDOR_KERN_MODS := %/qcom_q6v5_adsp.ko %/qcom_q6v5_mss.ko %/qcom_q6v5_pas.ko +BOARD_VENDOR_KERNEL_MODULES := $(filter $(VENDOR_KERN_MODS),$(KERNEL_MODS)) + +# All other modules go to ramdisk +BOARD_GENERIC_RAMDISK_KERNEL_MODULES := $(filter-out $(VENDOR_KERN_MODS),$(KERNEL_MODS)) + +# Inherit the full_base and device configurations +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, device/generic/sdm845/fajita/device.mk) +$(call inherit-product, device/generic/sdm845/shared/device.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) + +# Product overrides +PRODUCT_NAME := fajita +PRODUCT_DEVICE := fajita +PRODUCT_BRAND := AOSP diff --git a/fajita/fstab.ramdisk b/fajita/fstab.ramdisk new file mode 100644 index 00000000..e03e0769 --- /dev/null +++ b/fajita/fstab.ramdisk @@ -0,0 +1,3 @@ +/dev/block/platform/soc@0/1d84000.ufshc/by-name/system /system ext4 noatime,ro,errors=panic wait,first_stage_mount,slotselect +/dev/block/platform/soc@0/1d84000.ufshc/by-name/vendor /vendor ext4 noatime,ro,errors=panic wait,first_stage_mount,slotselect +/dev/block/platform/soc@0/1d84000.ufshc/by-name/userdata /data ext4 discard,noatime,noauto_da_alloc,data=ordered,user_xattr,barrier=1 wait,formattable,quota From a544ba727c3285c071ae355452360fbdb3c57cc7 Mon Sep 17 00:00:00 2001 From: sc-ah Date: Wed, 13 Jul 2022 13:53:15 +0200 Subject: [PATCH 2/3] sdm845: add support for Oneplus6T --- Android.mk | 2 +- AndroidProducts.mk | 6 ++++-- build/tasks/kernel.mk | 2 +- fajita/BoardConfig.mk | 14 ++++++++++++++ fajita/device.mk | 29 +++++++++++++++++++++++++++++ fajita/fajita.mk | 24 ++++++++++++++++++++++++ fajita/fstab.ramdisk | 3 +++ 7 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 fajita/BoardConfig.mk create mode 100644 fajita/device.mk create mode 100644 fajita/fajita.mk create mode 100644 fajita/fstab.ramdisk diff --git a/Android.mk b/Android.mk index be7fc78e..26408907 100644 --- a/Android.mk +++ b/Android.mk @@ -20,7 +20,7 @@ # to only building on ARM if they include assembly. Individual makefiles # are responsible for having their own logic, for fine-grained control. -ifneq ($(filter axolotl beryllium enchilada, $(TARGET_DEVICE)),) +ifneq ($(filter axolotl beryllium enchilada fajita, $(TARGET_DEVICE)),) LOCAL_PATH := $(call my-dir) diff --git a/AndroidProducts.mk b/AndroidProducts.mk index 0f666b04..ef92306f 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -12,9 +12,11 @@ PRODUCT_MAKEFILES := \ axolotl:$(LOCAL_DIR)/axolotl/axolotl.mk \ beryllium:$(LOCAL_DIR)/beryllium/beryllium.mk \ - enchilada:$(LOCAL_DIR)/enchilada/enchilada.mk + enchilada:$(LOCAL_DIR)/enchilada/enchilada.mk \ + fajita:$(LOCAL_DIR)/fajita/fajita.mk COMMON_LUNCH_CHOICES := \ axolotl-userdebug \ beryllium-userdebug \ - enchilada-userdebug + enchilada-userdebug \ + fajita-userdebug diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk index a16de142..acea8a4b 100644 --- a/build/tasks/kernel.mk +++ b/build/tasks/kernel.mk @@ -1,4 +1,4 @@ -ifneq ($(filter axolotl beryllium enchilada, $(TARGET_DEVICE)),) +ifneq ($(filter axolotl beryllium enchilada fajita, $(TARGET_DEVICE)),) IMAGE_GZ := device/generic/sdm845/shared/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/Image.gz DTB := $(wildcard device/generic/sdm845/shared/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/*.dtb) diff --git a/fajita/BoardConfig.mk b/fajita/BoardConfig.mk new file mode 100644 index 00000000..3c278172 --- /dev/null +++ b/fajita/BoardConfig.mk @@ -0,0 +1,14 @@ +include device/generic/sdm845/shared/BoardConfig.mk + +# Copied from https://github.com/LineageOS/android_device_oneplus_sdm845-common/blob/lineage-16.0/BoardConfigCommon.mk +# Board Information +TARGET_BOOTLOADER_BOARD_NAME := fajita +TARGET_BOARD_PLATFORM := fajita +TARGET_SCREEN_DENSITY := 400 + +# Kernel/boot.img Configuration +BOARD_KERNEL_CMDLINE += androidboot.hardware=fajita + +# Image Configuration +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2998927360 +BOARD_USERDATAIMAGE_PARTITION_SIZE := 57453555712 diff --git a/fajita/device.mk b/fajita/device.mk new file mode 100644 index 00000000..8f13b396 --- /dev/null +++ b/fajita/device.mk @@ -0,0 +1,29 @@ +# +# Copyright (C) 2011 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +PRODUCT_COPY_FILES := \ + $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_RAMDISK)/fstab.fajita \ + $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.fajita \ + device/generic/sdm845/shared/etc/audio.sdm845.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio.fajita.xml \ + device/generic/sdm845/shared/init.sdm845.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.fajita.rc \ + device/generic/sdm845/shared/init.sdm845.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.fajita.usb.rc \ + device/generic/sdm845/shared/key_layout.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/fajita.kl + +# Build generic Audio HAL +PRODUCT_PACKAGES := audio.primary.fajita + +# Build generic lights HAL +PRODUCT_PACKAGES += lights.fajita diff --git a/fajita/fajita.mk b/fajita/fajita.mk new file mode 100644 index 00000000..d015585b --- /dev/null +++ b/fajita/fajita.mk @@ -0,0 +1,24 @@ +ifndef TARGET_KERNEL_USE +TARGET_KERNEL_USE := mainline +endif + +KERNEL_MODS := $(wildcard device/generic/sdm845/shared/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/*.ko) + +# Following modules go to vendor partition +# msm.ko is too big (31M) for ramdisk +VENDOR_KERN_MODS := %/qcom_q6v5_adsp.ko %/qcom_q6v5_mss.ko %/qcom_q6v5_pas.ko +BOARD_VENDOR_KERNEL_MODULES := $(filter $(VENDOR_KERN_MODS),$(KERNEL_MODS)) + +# All other modules go to ramdisk +BOARD_GENERIC_RAMDISK_KERNEL_MODULES := $(filter-out $(VENDOR_KERN_MODS),$(KERNEL_MODS)) + +# Inherit the full_base and device configurations +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, device/generic/sdm845/fajita/device.mk) +$(call inherit-product, device/generic/sdm845/shared/device.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) + +# Product overrides +PRODUCT_NAME := fajita +PRODUCT_DEVICE := fajita +PRODUCT_BRAND := AOSP diff --git a/fajita/fstab.ramdisk b/fajita/fstab.ramdisk new file mode 100644 index 00000000..e03e0769 --- /dev/null +++ b/fajita/fstab.ramdisk @@ -0,0 +1,3 @@ +/dev/block/platform/soc@0/1d84000.ufshc/by-name/system /system ext4 noatime,ro,errors=panic wait,first_stage_mount,slotselect +/dev/block/platform/soc@0/1d84000.ufshc/by-name/vendor /vendor ext4 noatime,ro,errors=panic wait,first_stage_mount,slotselect +/dev/block/platform/soc@0/1d84000.ufshc/by-name/userdata /data ext4 discard,noatime,noauto_da_alloc,data=ordered,user_xattr,barrier=1 wait,formattable,quota From 7e2f43577561932e1164ae28506040cefd80f1c4 Mon Sep 17 00:00:00 2001 From: J0SH1X Date: Tue, 26 Jul 2022 11:09:17 +0000 Subject: [PATCH 3/3] sdm845: use memfd instead of ashmem --- shared/init.sdm845.rc | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/init.sdm845.rc b/shared/init.sdm845.rc index b49fe945..f0598313 100644 --- a/shared/init.sdm845.rc +++ b/shared/init.sdm845.rc @@ -30,6 +30,7 @@ on early-boot chown graphics graphics /sys/kernel/debug/sync/sw_sync chmod 777 /sys/kernel/debug/sync/sw_sync chown graphics graphics /sys/kernel/debug/sync/info + setprop sys.use_memfd true on zygote-start mkdir /data/vendor/wifi 0770 wifi wifi