sm8650-common: Initial configuration

Change-Id: Ie30473077ee50835b1c5f9363dc7965245fce64c
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..f1820b7
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,10 @@
+//
+// Copyright (C) 2025 The LineageOS Project
+// SPDX-License-Identifier: Apache-2.0
+//
+
+soong_namespace {
+    imports: [
+        "hardware/motorola",
+    ],
+}
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
new file mode 100644
index 0000000..1817b7a
--- /dev/null
+++ b/BoardConfigCommon.mk
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2025 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+COMMON_PATH := device/motorola/sm8650-common
+
+# A/B
+AB_OTA_PARTITIONS += \
+    boot \
+    dtbo \
+    init_boot \
+    product \
+    recovery \
+    system \
+    system_ext \
+    vbmeta \
+    vbmeta_system \
+    vendor \
+    vendor_boot \
+    system_dlkm \
+    vendor_dlkm
+
+# Architecture
+TARGET_ARCH := arm64
+TARGET_ARCH_VARIANT := armv8-2a-dotprod
+TARGET_CPU_ABI := arm64-v8a
+TARGET_CPU_VARIANT := generic
+TARGET_CPU_VARIANT_RUNTIME := kryo385
+
+# Bootloader
+TARGET_NO_BOOTLOADER := true
+
+# Platform
+BOARD_USES_QCOM_HARDWARE := true
+TARGET_BOARD_PLATFORM := pineapple
+
+# Inherit the proprietary files
+include vendor/motorola/sm8650-common/BoardConfigVendor.mk
diff --git a/common.mk b/common.mk
new file mode 100644
index 0000000..a5ba689
--- /dev/null
+++ b/common.mk
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2025 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+# Enable project quotas and casefolding for emulated storage without sdcardfs
+$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
+
+# Installs gsi keys into ramdisk, to boot a GSI with verified boot.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/developer_gsi_keys.mk)
+
+# Add common definitions for Qualcomm
+$(call inherit-product, hardware/qcom-caf/common/common.mk)
+
+# A/B
+$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk)
+
+AB_OTA_POSTINSTALL_CONFIG += \
+    RUN_POSTINSTALL_system=true \
+    POSTINSTALL_PATH_system=system/bin/otapreopt_script \
+    FILESYSTEM_TYPE_system=ext4 \
+    POSTINSTALL_OPTIONAL_system=true
+
+AB_OTA_POSTINSTALL_CONFIG += \
+    RUN_POSTINSTALL_vendor=true \
+    POSTINSTALL_PATH_vendor=bin/checkpoint_gc \
+    FILESYSTEM_TYPE_vendor=ext4 \
+    POSTINSTALL_OPTIONAL_vendor=true
+
+PRODUCT_PACKAGES += \
+    checkpoint_gc \
+    otapreopt_script
+
+# Inherit from vendor blobs
+$(call inherit-product, vendor/motorola/sm8650-common/sm8650-common-vendor.mk)
diff --git a/extract-files.py b/extract-files.py
new file mode 100755
index 0000000..90dd20b
--- /dev/null
+++ b/extract-files.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
+#
+# SPDX-FileCopyrightText: 2025 The LineageOS Project
+# SPDX-License-Identifier: Apache-2.0
+#
+
+from extract_utils.fixups_blob import (
+    blob_fixup,
+    blob_fixups_user_type,
+)
+from extract_utils.fixups_lib import (
+    lib_fixup_remove,
+    lib_fixups,
+    lib_fixups_user_type,
+)
+
+from extract_utils.main import (
+    ExtractUtils,
+    ExtractUtilsModule,
+)
+
+namespace_imports = [
+    'device/motorola/sm8650-common',
+    'hardware/motorola',
+    'hardware/qcom-caf/sm8650',
+    'hardware/qcom-caf/wlan',
+    'vendor/qcom/opensource/commonsys/display',
+    'vendor/qcom/opensource/dataservices',
+]
+
+
+libs_add_vendor_suffix = (
+)
+
+libs_remove = (
+)
+
+
+def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs):
+    if partition != 'vendor':
+        return None
+
+    return f'{lib}_{partition}'
+
+
+lib_fixups: lib_fixups_user_type = {
+    **lib_fixups,
+    libs_add_vendor_suffix: lib_fixup_vendor_suffix,
+    libs_remove: lib_fixup_remove,
+}
+
+
+blob_fixups: blob_fixups_user_type = {
+}
+
+module = ExtractUtilsModule(
+    'sm8650-common',
+    'motorola',
+    blob_fixups=blob_fixups,
+    lib_fixups=lib_fixups,
+    namespace_imports=namespace_imports,
+)
+
+if __name__ == '__main__':
+    utils = ExtractUtils.device(module)
+    utils.run()
diff --git a/proprietary-files.txt b/proprietary-files.txt
new file mode 100644
index 0000000..f4a7d9b
--- /dev/null
+++ b/proprietary-files.txt
@@ -0,0 +1 @@
+# TODO: Bringup proprietary-files.txt
diff --git a/setup-makefiles.py b/setup-makefiles.py
new file mode 100755
index 0000000..bed22a9
--- /dev/null
+++ b/setup-makefiles.py
@@ -0,0 +1 @@
+#!./extract-files.py --regenerate_makefiles
\ No newline at end of file