Skip to content

Commit

Permalink
avicii: Fixed A/B slot switching
Browse files Browse the repository at this point in the history
  • Loading branch information
sreeshankark committed Nov 12, 2022
1 parent 0099ddf commit 53bb868
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 54 deletions.
8 changes: 3 additions & 5 deletions Android.bp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
soong_namespace {

imports: [
"hardware/qcom/bootctrl",
"device/qcom/common/gpt-utils",
],

"hardware/qcom/bootctrl",
"device/qcom/common/gpt-utils",
],
}
2 changes: 1 addition & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

LOCAL_PATH := $(call my-dir)

ifeq ($(TARGET_DEVICE), avicii)
ifeq ($(TARGET_DEVICE),avicii)
include $(call all-subdir-makefiles,$(LOCAL_PATH))
endif
6 changes: 2 additions & 4 deletions AndroidProducts.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
#

PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/twrp_avicii.mk
$(LOCAL_DIR)/pbrp_avicii.mk

COMMON_LUNCH_CHOICES := \
twrp_avicii-user \
twrp_avicii-userdebug \
twrp_avicii-eng
pbrp_aviciiv2-eng
34 changes: 7 additions & 27 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := cortex-a76


# Enable CPUSets
ENABLE_CPUSETS := true
ENABLE_SCHEDBOOST := true
Expand Down Expand Up @@ -78,6 +79,9 @@ TARGET_BOARD_PLATFORM := $(TARGET_BOOTLOADER_BOARD_NAME)
TARGET_USES_HARDWARE_QCOM_BOOTCTRL := true
QCOM_BOARD_PLATFORMS += $(TARGET_BOARD_PLATFORM)

# Properties
TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop

# Partition Info
BOARD_FLASH_BLOCK_SIZE := 262144 # (BOARD_KERNEL_PAGESIZE * 64)
BOARD_USES_PRODUCTIMAGE := true
Expand All @@ -90,7 +94,7 @@ TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true

BOARD_BUILD_SYSTEM_ROOT_IMAGE := false

TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/recovery/root/system/etc/recovery.fstab
# Dynamic/Logical Partitions
BOARD_ONEPLUS_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor
BOARD_ONEPLUS_DYNAMIC_PARTITIONS_SIZE := 7511998464
Expand All @@ -111,8 +115,7 @@ TARGET_RECOVERY_DEVICE_MODULES += \
libion \
libxml2 \
[email protected] \
[email protected] \
[email protected]
[email protected]

# Use mke2fs to create ext4 images
TARGET_USES_MKE2FS := true
Expand All @@ -128,7 +131,7 @@ BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
BOARD_USES_METADATA_PARTITION := true
BOARD_USES_QCOM_FBE_DECRYPTION := true
PLATFORM_SECURITY_PATCH := 2127-12-31
PLATFORM_VERSION := 16.1.0
PLATFORM_VERSION := 99.87.36
PLATFORM_VERSION_LAST_STABLE := $(PLATFORM_VERSION)
TW_INCLUDE_CRYPTO := true
TW_INCLUDE_CRYPTO_FBE := true
Expand Down Expand Up @@ -157,7 +160,6 @@ TW_OVERRIDE_SYSTEM_PROPS := \
RECOVERY_LIBRARY_SOURCE_FILES += \
$(TARGET_OUT_SHARED_LIBRARIES)/libion.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libxml2.so \
$(TARGET_OUT_SHARED_LIBRARIES)/[email protected] \
$(TARGET_OUT_SYSTEM_EXT_SHARED_LIBRARIES)/[email protected] \
$(TARGET_OUT_SYSTEM_EXT_SHARED_LIBRARIES)/[email protected]

Expand All @@ -169,25 +171,3 @@ RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/debuggerd
TARGET_RECOVERY_DEVICE_MODULES += strace
RECOVERY_BINARY_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/strace

#
# For local builds only
#
# TWRP zip installer
ifneq ($(wildcard bootable/recovery/installer/.),)
USE_RECOVERY_INSTALLER := true
RECOVERY_INSTALLER_PATH := bootable/recovery/installer
endif

# Custom TWRP Versioning
ifneq ($(wildcard device/common/version-info/.),)
CUSTOM_TWRP_VERSION_PREFIX := CPTB

include device/common/version-info/custom_twrp_version.mk

ifeq ($(CUSTOM_TWRP_VERSION),)
CUSTOM_TWRP_VERSION := $(shell date +%Y%m%d)-01
endif
endif
#
# end local build flags
#
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The phone is avialable in 2 variants based on region: AC2001 (India) & AC2003 (E

source build/envsetup.sh
lunch twrp_avicii-eng
lunch pbrp_avicii-eng
mka adbd recoveryimage
Expand Down
27 changes: 16 additions & 11 deletions device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

LOCAL_PATH := device/oneplus/avicii

# Enable project quotas and casefolding for emulated storage without sdcardfs
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)

# A/B support
AB_OTA_UPDATER := true

Expand Down Expand Up @@ -47,16 +50,22 @@ PRODUCT_SHIPPING_API_LEVEL := 29

# Boot control HAL
PRODUCT_PACKAGES += \
android.hardware.boot@1.1-impl \
android.hardware.boot@1.0-impl \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
bootctrl.$(PRODUCT_PLATFORM) \
bootctrl.$(PRODUCT_PLATFORM).recovery

[email protected] \
[email protected] \
[email protected] \
[email protected] \
bootctrl.$(PRODUCT_PLATFORM).recovery \
bootctrl.$(PRODUCT_PLATFORM)

PRODUCT_PACKAGES_DEBUG += \
bootctl

# Health HAL
PRODUCT_PACKAGES += \
[email protected]


# Dynamic partitions
PRODUCT_USE_DYNAMIC_PARTITIONS := true
Expand All @@ -65,10 +74,6 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true
PRODUCT_PACKAGES += \
[email protected] \
fastbootd

# Health HAL
PRODUCT_PACKAGES += \
[email protected]

# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
Expand Down
4 changes: 2 additions & 2 deletions gpt-utils/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ cc_library {
name: "libgptutils",
defaults: ["libgptutils_defaults"],
vendor_available: true,
recovery_available: true,
}
}

6 changes: 3 additions & 3 deletions twrp_avicii.mk → pbrp_avicii.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ $(call inherit-product, vendor/pb/config/common.mk)

# Release name
PRODUCT_RELEASE_NAME := avicii

PRODUCT_CODENAME := avicii
# Device identifier. This must come after all inclusions
PRODUCT_DEVICE := avicii
PRODUCT_NAME := twrp_avicii
PRODUCT_NAME := pbrp_avicii
PRODUCT_BRAND := OnePlus
PRODUCT_MODEL := AC2001
PRODUCT_MODEL := Nord
PRODUCT_MANUFACTURER := oneplus
Binary file modified prebuilt/kernel
Binary file not shown.
Binary file added recovery/root/system/lib64/hw/[email protected]
Binary file not shown.

0 comments on commit 53bb868

Please sign in to comment.