ctwo: Initial device configuration

Change-Id: I2f1f1a6e13037ee45bdb67d7ffe926d1c4bd2c4a
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..9515b25
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,2 @@
+soong_namespace {
+}
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
new file mode 100644
index 0000000..734d1cf
--- /dev/null
+++ b/AndroidProducts.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2025 The LineageOS 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_MAKEFILES := \
+    $(LOCAL_DIR)/lineage_ctwo.mk
diff --git a/BoardConfig.mk b/BoardConfig.mk
new file mode 100644
index 0000000..44ce3c3
--- /dev/null
+++ b/BoardConfig.mk
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2025 The LineageOS 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.
+#
+
+DEVICE_PATH := device/motorola/ctwo
+
+# Inherit from motorola sm8650-common
+include device/motorola/sm8650-common/BoardConfigCommon.mk
+
+# Bootloader
+TARGET_BOOTLOADER_BOARD_NAME := ctwo
+
+# Recovery
+TARGET_RECOVERY_UI_MARGIN_HEIGHT := 90
+
+# Security
+BOOT_SECURITY_PATCH := 2025-10-01
+VENDOR_SECURITY_PATCH := $(BOOT_SECURITY_PATCH)
+
+# Verified Boot
+BOARD_AVB_ROLLBACK_INDEX := 19
+BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := 19
+
+# inherit from the proprietary version
+include vendor/motorola/ctwo/BoardConfigVendor.mk
diff --git a/device.mk b/device.mk
new file mode 100644
index 0000000..dc3d5d0
--- /dev/null
+++ b/device.mk
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2025 The LineageOS 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.
+#
+
+# AAPT
+PRODUCT_AAPT_CONFIG := normal
+PRODUCT_AAPT_PREF_CONFIG := 400dpi
+PRODUCT_AAPT_PREBUILT_DPI := xxxhdpi xxhdpi xhdpi hdpi
+
+# Boot animation
+TARGET_SCREEN_HEIGHT := 2712
+TARGET_SCREEN_WIDTH := 1220
+
+# Screen
+TARGET_SCREEN_DENSITY := 400
+
+# Soong namespaces
+PRODUCT_SOONG_NAMESPACES += $(LOCAL_PATH)
+
+# Inherit from motorola sm8650-common
+$(call inherit-product, device/motorola/sm8650-common/common.mk)
+
+# Inherit from vendor blobs
+$(call inherit-product, vendor/motorola/ctwo/ctwo-vendor.mk)
diff --git a/extract-files.py b/extract-files.py
new file mode 100755
index 0000000..2fdb5f1
--- /dev/null
+++ b/extract-files.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
+#
+# SPDX-FileCopyrightText: 2025 The LineageOS Project
+# SPDX-License-Identifier: Apache-2.0
+#
+
+from extract_utils.extract import extract_fns_user_type
+from extract_utils.extract_star import (
+    extract_star_firmware,
+    star_firmware_regex,
+)
+from extract_utils.fixups_blob import (
+    blob_fixup,
+    blob_fixups_user_type,
+)
+from extract_utils.fixups_lib import lib_fixups
+from extract_utils.main import (
+    ExtractUtils,
+    ExtractUtilsModule,
+)
+
+namespace_imports = [
+    'device/motorola/sm8650-common',
+    'vendor/motorola/sm8650-common',
+    'hardware/motorola',
+    'hardware/qcom-caf/sm8650',
+    'vendor/qcom/opensource/commonsys-intf/display',
+]
+
+blob_fixups: blob_fixups_user_type = {
+}
+
+extract_fns: extract_fns_user_type = {
+    star_firmware_regex: extract_star_firmware,
+}
+
+module = ExtractUtilsModule(
+    'ctwo',
+    'motorola',
+    blob_fixups=blob_fixups,
+    lib_fixups=lib_fixups,
+    namespace_imports=namespace_imports,
+    extract_fns=extract_fns,
+)
+
+if __name__ == '__main__':
+    utils = ExtractUtils.device(module)
+    utils.run()
diff --git a/lineage_ctwo.mk b/lineage_ctwo.mk
new file mode 100644
index 0000000..d6a8679
--- /dev/null
+++ b/lineage_ctwo.mk
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2025 The LineageOS 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.
+#
+
+# Inherit from those products. Most specific first.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
+
+# Inherit from ctwo device
+$(call inherit-product, device/motorola/ctwo/device.mk)
+
+# Inherit some common Lineage stuff.
+$(call inherit-product, vendor/lineage/config/common_full_phone.mk)
+
+PRODUCT_NAME := lineage_ctwo
+PRODUCT_DEVICE := ctwo
+PRODUCT_MANUFACTURER := motorola
+PRODUCT_BRAND := motorola
+PRODUCT_MODEL := motorola edge 50 ultra
+
+PRODUCT_GMS_CLIENTID_BASE := android-motorola
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..32947cf
--- /dev/null
+++ b/setup-makefiles.py
@@ -0,0 +1 @@
+#!./extract-files.py --regenerate_makefiles