Remove sdm845-userdebug build target
Remove the common sdm845-userdebug build target.
Move the common device configs to device-common.mk and
{beryllium,enchilada}/device.mk file.
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
diff --git a/Android.mk b/Android.mk
index c735535..ff72a48 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 beryllium enchilada sdm845, $(TARGET_DEVICE)),)
+ifneq ($(filter beryllium enchilada, $(TARGET_DEVICE)),)
LOCAL_PATH := $(call my-dir)
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index 0b21cf7..7c0b530 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -11,10 +11,8 @@
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/beryllium.mk \
- $(LOCAL_DIR)/enchilada.mk \
- $(LOCAL_DIR)/sdm845.mk
+ $(LOCAL_DIR)/enchilada.mk
COMMON_LUNCH_CHOICES := \
beryllium-userdebug \
- enchilada-userdebug \
- sdm845-userdebug
+ enchilada-userdebug
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index ca70e59..e496571 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -39,15 +39,12 @@
BOARD_RAMDISK_OFFSET := 0x01000000
BOARD_KERNEL_CMDLINE := console=ttyMSM0,115200n8 earlycon earlyprintk console=tty0 androidboot.console=ttyMSM0
BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc@0/1d84000.ufshc
-BOARD_KERNEL_CMDLINE += androidboot.hardware=sdm845
BOARD_KERNEL_CMDLINE += firmware_class.path=/vendor/firmware/ init=/init printk.devkmsg=on
BOARD_KERNEL_CMDLINE += deferred_probe_timeout=30
# Image Configuration
BOARD_FLASH_BLOCK_SIZE := 262144
BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864 #64M
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2998927360
-BOARD_USERDATAIMAGE_PARTITION_SIZE := 57453555712
BOARD_VENDORIMAGE_PARTITION_SIZE := 536870912
BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := ext4
diff --git a/beryllium/BoardConfig.mk b/beryllium/BoardConfig.mk
index d7da231..3a684a0 100644
--- a/beryllium/BoardConfig.mk
+++ b/beryllium/BoardConfig.mk
@@ -4,3 +4,10 @@
# Board Information
TARGET_BOOTLOADER_BOARD_NAME := beryllium
TARGET_BOARD_PLATFORM := beryllium
+
+# Kernel/boot.img Configuration
+BOARD_KERNEL_CMDLINE += androidboot.hardware=beryllium
+
+# Image Configuration
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 57453555712
diff --git a/beryllium/device.mk b/beryllium/device.mk
index c9af082..92319a0 100644
--- a/beryllium/device.mk
+++ b/beryllium/device.mk
@@ -14,11 +14,15 @@
# limitations under the License.
#
+PRODUCT_COPY_FILES := \
+ $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_RAMDISK)/fstab.beryllium \
+ $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.beryllium \
+ device/generic/sdm845/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.beryllium.rc \
+ device/generic/sdm845/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.beryllium.usb.rc \
+ device/generic/sdm845/common.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/beryllium.kl
+
# Build generic Audio HAL
-PRODUCT_PACKAGES := audio.primary.$(TARGET_DEVICE)
+PRODUCT_PACKAGES := audio.primary.beryllium
# Build generic lights HAL
-PRODUCT_PACKAGES += lights.$(TARGET_DEVICE)
-
-RAMDISK_FSTAB_TARGET := $(LOCAL_PATH)/fstab.ramdisk
-$(call inherit-product, device/generic/sdm845/sdm845/device.mk)
\ No newline at end of file
+PRODUCT_PACKAGES += lights.beryllium
diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk
index 5c9066c..a45a468 100644
--- a/build/tasks/kernel.mk
+++ b/build/tasks/kernel.mk
@@ -1,4 +1,4 @@
-ifneq ($(filter beryllium enchilada sdm845, $(TARGET_DEVICE)),)
+ifneq ($(filter beryllium enchilada, $(TARGET_DEVICE)),)
IMAGE_GZ := device/generic/sdm845/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/Image.gz
DTB := $(wildcard device/generic/sdm845/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/*.dtb)
diff --git a/device-common.mk b/device-common.mk
index 67785b4..ca555a5 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -14,6 +14,10 @@
# limitations under the License.
#
+# copied from crosshatch
+# setup dalvik vm configs
+$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
+
# Enable updating of APEXes
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
@@ -77,6 +81,17 @@
wpa_supplicant.conf \
wificond
+PRODUCT_PACKAGES += \
+ pd-mapper \
+ qrtr-ns \
+ qrtr-cfg \
+ qrtr-lookup \
+ rmtfs \
+ tqftpserv
+
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/qcom/init.qcom.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.qcom.rc
+
PRODUCT_PROPERTY_OVERRIDES += \
wifi.interface=wlan0 \
wifi.supplicant_scan_interval=15
@@ -201,4 +216,6 @@
# Copy firmware files
$(call inherit-product-if-exists, $(LOCAL_PATH)/firmware/device.mk)
-PRODUCT_SOONG_NAMESPACES += external/mesa3d
+PRODUCT_SOONG_NAMESPACES += \
+ device/generic/sdm845 \
+ external/mesa3d
diff --git a/enchilada/BoardConfig.mk b/enchilada/BoardConfig.mk
index 2f2d327..536b0e4 100644
--- a/enchilada/BoardConfig.mk
+++ b/enchilada/BoardConfig.mk
@@ -4,3 +4,10 @@
# Board Information
TARGET_BOOTLOADER_BOARD_NAME := enchilada
TARGET_BOARD_PLATFORM := enchilada
+
+# Kernel/boot.img Configuration
+BOARD_KERNEL_CMDLINE += androidboot.hardware=enchilada
+
+# Image Configuration
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2998927360
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 57453555712
diff --git a/enchilada/device.mk b/enchilada/device.mk
index 1454d29..9b87fee 100644
--- a/enchilada/device.mk
+++ b/enchilada/device.mk
@@ -14,11 +14,15 @@
# limitations under the License.
#
+PRODUCT_COPY_FILES := \
+ $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_RAMDISK)/fstab.enchilada \
+ $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.enchilada \
+ device/generic/sdm845/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.enchilada.rc \
+ device/generic/sdm845/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.enchilada.usb.rc \
+ device/generic/sdm845/common.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/enchilada.kl
+
# Build generic Audio HAL
-PRODUCT_PACKAGES := audio.primary.$(TARGET_DEVICE)
+PRODUCT_PACKAGES := audio.primary.enchilada
# Build generic lights HAL
-PRODUCT_PACKAGES += lights.$(TARGET_DEVICE)
-
-RAMDISK_FSTAB_TARGET := $(LOCAL_PATH)/fstab.ramdisk
-$(call inherit-product, device/generic/sdm845/sdm845/device.mk)
+PRODUCT_PACKAGES += lights.enchilada
diff --git a/sdm845.mk b/sdm845.mk
deleted file mode 100644
index d3c8aee..0000000
--- a/sdm845.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-ifndef TARGET_KERNEL_USE
-TARGET_KERNEL_USE := mainline
-endif
-
-KERNEL_MODS := $(wildcard device/generic/sdm845/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/sdm845/device.mk)
-$(call inherit-product, device/generic/sdm845/device-common.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
-
-# Product overrides
-PRODUCT_NAME := sdm845
-PRODUCT_DEVICE := sdm845
-PRODUCT_BRAND := AOSP
diff --git a/sdm845/BoardConfig.mk b/sdm845/BoardConfig.mk
deleted file mode 100644
index 52bb3d8..0000000
--- a/sdm845/BoardConfig.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-include device/generic/sdm845/BoardConfigCommon.mk
-
-# Copied from https://github.com/LineageOS/android_device_oneplus_sdm845-common/blob/lineage-16.0/BoardConfigCommon.mk
-# Board Information
-TARGET_BOOTLOADER_BOARD_NAME := sdm845
-#TARGET_BOARD_PLATFORM := sdm845
diff --git a/sdm845/device.mk b/sdm845/device.mk
deleted file mode 100644
index f80a3db..0000000
--- a/sdm845/device.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# 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_SOONG_NAMESPACES += \
- device/generic/sdm845
-
-# copied from crosshatch
-# setup dalvik vm configs
-$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
-
-# Allow to override ramdisk until we can produce fully generic builds
-RAMDISK_FSTAB_TARGET ?= $(LOCAL_PATH)/fstab.ramdisk
-
-PRODUCT_COPY_FILES := \
- $(RAMDISK_FSTAB_TARGET):$(TARGET_COPY_OUT_RAMDISK)/fstab.sdm845 \
- $(RAMDISK_FSTAB_TARGET):$(TARGET_COPY_OUT_VENDOR)/etc/fstab.sdm845 \
- device/generic/sdm845/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.sdm845.rc \
- device/generic/sdm845/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.sdm845.usb.rc \
- device/generic/sdm845/common.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/sdm845.kl
-
-PRODUCT_PACKAGES += \
- pd-mapper \
- qrtr-ns \
- qrtr-cfg \
- qrtr-lookup \
- rmtfs \
- tqftpserv
-
-PRODUCT_COPY_FILES += \
- device/generic/sdm845/qcom/init.qcom.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.qcom.rc
diff --git a/sdm845/fstab.ramdisk b/sdm845/fstab.ramdisk
deleted file mode 100644
index 4d972e7..0000000
--- a/sdm845/fstab.ramdisk
+++ /dev/null
@@ -1,4 +0,0 @@
-/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
-/devices/platform/soc@0/8804000.sdhci/mmc_host/mmc* auto auto defaults voldmanaged=sdcard1:auto