In this commit i ported a script to set some props and choose the right device.
Other this i added a little init.recovery.qcom.rc fix to fully support stock OOS flash for OnePlus 7 Pro 5g
--- /dev/null
+#
+# Copyright (C) 2017 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.
+#
+
+# This contains the module build definitions for the hardware-specific
+# components for this device.
+#
+# As much as possible, those components should be built unconditionally,
+# with device-specific names to avoid collisions, to avoid device-specific
+# bitrot and build breakages. Building a component unconditionally does
+# *not* include it on all devices, so it is safe even with hardware-specific
+# components.
+
+LOCAL_PATH := $(call my-dir)
+
+ifeq ($(TARGET_DEVICE),guacamole)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
+
+include $(CLEAR_VARS)
+
+endif
+++ /dev/null
-#
-# Copyright 2016 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.
-#
-
-# This contains the module build definitions for the hardware-specific
-# components for this device.
-#
-# As much as possible, those components should be built unconditionally,
-# with device-specific names to avoid collisions, to avoid device-specific
-# bitrot and build breakages. Building a component unconditionally does
-# *not* include it on all devices, so it is safe even with hardware-specific
-# components.
-
-LOCAL_PATH := $(call my-dir)
-
-ifneq ($(filter guacamole,$(TARGET_DEVICE)),)
-include $(call all-makefiles-under,$(LOCAL_PATH))
-endif
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_COPY_OUT_VENDOR := vendor
+#Init
+TARGET_INIT_VENDOR_LIB := libinit_oneplus7pro
+TARGET_RECOVERY_DEVICE_MODULES := libinit_oneplus7pro
+TARGET_PLATFORM_DEVICE_BASE := /devices/soc/
+
# Recovery
BOARD_HAS_LARGE_FILESYSTEM := true
BOARD_HAS_NO_SELECT_BUTTON := true
--- /dev/null
+#
+# Copyright (C) 2017-2018 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := \
+ system/core/base/include \
+ system/core/init
+LOCAL_SRC_FILES := init_oneplus7pro.cpp
+LOCAL_MODULE := libinit_oneplus7pro
+
+include $(BUILD_STATIC_LIBRARY)
--- /dev/null
+/*
+ Copyright (C) 2017-2018 The Android Open Source Project
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cstdlib>
+#include <unistd.h>
+#include <fcntl.h>
+#include <android-base/logging.h>
+#include <android-base/properties.h>
+
+#include "property_service.h"
+#include "log.h"
+
+namespace android {
+namespace init {
+
+void load_op7pro(const char *model) {
+ property_set("ro.product.model", model);
+ property_set("ro.build.product", "OnePlus7Pro");
+ property_set("ro.product.device", "OnePlus7Pro");
+ property_set("ro.vendor.product.device", "OnePlus7Pro");
+ property_set("ro.display.series", "OnePlus 7 Pro");
+}
+
+void load_op7pro5g(const char *model) {
+ property_set("ro.product.model", model);
+ property_set("ro.build.product", "OnePlus7ProNR");
+ property_set("ro.product.device", "OnePlus7ProNR");
+ property_set("ro.vendor.product.device", "OnePlus7ProNR");
+ property_set("ro.display.series", "OnePlus 7 Pro 5G");
+}
+
+void vendor_load_properties() {
+ int rf_version = stoi(android::base::GetProperty("ro.boot.rf_version", ""));
+
+ switch (rf_version) {
+ case 1:
+ /* 5g Europe */
+ load_op7pro5g("GM1920");
+ break;
+ case 2:
+ /* T-Mobile */
+ load_op7pro("GM1915");
+ break;
+ case 3:
+ /* India*/
+ load_op7pro("GM1911");
+ break;
+ case 4:
+ /* Europe */
+ load_op7pro("GM1913");
+ break;
+ case 5:
+ /* Global / US Unlocked */
+ load_op7pro("GM1917");
+ break;
+ default:
+ LOG(ERROR) << __func__ << ": unexcepted rf version!";
+ }
+}
+
+} // namespace init
+} // namespace android
PRODUCT_DEVICE := guacamole
PRODUCT_NAME := omni_guacamole
PRODUCT_BRAND := OnePlus
-PRODUCT_MODEL := OnePlus GM1917
+PRODUCT_MODEL := GM1917
PRODUCT_MANUFACTURER := OnePlus
PRODUCT_BUILD_PROP_OVERRIDES += \
BUILD_PRODUCT=OnePlus7Pro \
TARGET_DEVICE=OnePlus7Pro
+PRODUCT_SYSTEM_PROPERTY_BLACKLIST += \
+ ro.product.model \
+ ro.product.device \
+ ro.product.name \
+ ro.display.series
+
# HACK: Set vendor patch level
PRODUCT_PROPERTY_OVERRIDES += \
- ro.vendor.build.security_patch=2099-12-31
\ No newline at end of file
+ ro.vendor.build.security_patch=2099-12-31
symlink /dev/block/bootdevice/by-name/oem_dycnvbk /dev/block/bootdevice/by-name/oem_dycnvbk_a
symlink /dev/block/bootdevice/by-name/oem_dycnvbk /dev/block/bootdevice/by-name/oem_dycnvbk_b
+ # this is for OnePlus 7 Pro 5g stock rom flashing
+ symlink /dev/block/bootdevice/by-name/mdm_oem_stanvbk /dev/block/bootdevice/by-name/mdm_oem_stanvbk_a
+ symlink /dev/block/bootdevice/by-name/mdm_oem_stanvbk /dev/block/bootdevice/by-name/mdm_oem_stanvbk_b
+
# this is not good way for Hydrogen payload reserve
write /dev/block/bootdevice/by-name/reserve 0
symlink /dev/block/bootdevice/by-name/reserve /dev/block/bootdevice/by-name/reserve_a