From: deadman96385 Date: Thu, 26 Mar 2020 04:24:29 +0000 (-0500) Subject: source bootctrl changes X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=89ba59021c914fa49e768babfbf1510ae87c341e;p=GitHub%2Fmoto-9609%2Ftwrp_device_motorola_troika.git source bootctrl changes --- diff --git a/BoardConfig.mk b/BoardConfig.mk index ae422a3..5361fc7 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -55,6 +55,9 @@ TARGET_PREBUILT_KERNEL := device/motorola/troika/prebuilt/Image.gz-dtb TARGET_BOARD_PLATFORM := exynos5 TARGET_BOARD_PLATFORM_GPU := mali-g72 +PRODUCT_SOONG_NAMESPACES += device/motorola/troika +TARGET_RECOVERY_DEVICE_MODULES += android.hardware.boot@1.0-impl.exynos + # Partitions BOARD_FLASH_BLOCK_SIZE := 262144 diff --git a/bootctrl/Android.bp b/bootctrl/Android.bp index 05df943..3d20c86 100644 --- a/bootctrl/Android.bp +++ b/bootctrl/Android.bp @@ -17,7 +17,6 @@ cc_library_shared { defaults: ["hidl_defaults"], relative_install_path: "hw", vendor: true, - recovery_available: true, srcs: ["BootControl.cpp"], shared_libs: [ diff --git a/bootctrl/BootControl.cpp b/bootctrl/BootControl.cpp index 2f2b8c6..53637eb 100644 --- a/bootctrl/BootControl.cpp +++ b/bootctrl/BootControl.cpp @@ -40,14 +40,14 @@ bool BootControl::readMetadata(bctl_metadata_t& data) { in.read(reinterpret_cast(&data), sizeof(bctl_metadata_t)); if (!validateMetadata(data)) - return -1; + return false; return !in.eof() && !in.fail(); } bool BootControl::writeMetadata(bctl_metadata_t& data) { if (!validateMetadata(data)) - return -1; + return false; // We use std::ios::in | std::ios::out even though we only write so that // we don't truncate or append to the file, but rather overwrite the file @@ -119,7 +119,7 @@ Return BootControl::markBootSuccessful(markBootSuccessful_cb _hidl_cb) { if (readMetadata(data)) { active_slot = !data.slot_info[0].is_active; - data.slot_info[active_slot].boot_successful = 0; + data.slot_info[active_slot].boot_successful = 1; data.slot_info[active_slot].tries_remaining = 0; if (success) diff --git a/device.mk b/device.mk index 00329d6..6ba103b 100644 --- a/device.mk +++ b/device.mk @@ -12,9 +12,6 @@ PRODUCT_PACKAGES += \ update_engine \ update_verifier -PRODUCT_PACKAGES += \ - bootctrl.exynos9610 - AB_OTA_POSTINSTALL_CONFIG += \ RUN_POSTINSTALL_system=true \ POSTINSTALL_PATH_system=system/bin/otapreopt_script \ @@ -24,7 +21,6 @@ AB_OTA_POSTINSTALL_CONFIG += \ # Enable update engine sideloading by including the static version of the # boot_control HAL and its dependencies. PRODUCT_STATIC_BOOT_CONTROL_HAL := \ - bootctrl.exynos9610 \ libgptutils \ libz \ libcutils