Files
android_vendor_pawlet/config/common.mk
T
oxmc 8f33626a21 recovery: build as a separate on-demand image; A/B failsafe via tryboot
Recovery is no longer embedded in boot.img -- that forced recovery.img into
the vendor image size check and overflowed the padded 2GB vendor partition.
Instead:

- common.mk gates recovery with PRODUCT_BUILD_RECOVERY_IMAGE (default false),
  so the normal build never touches it. Build it on demand with the new
  `precovery` helper (PAWLET_BUILD_RECOVERY=1 m recoveryimage) and flash the
  result to the recovery partition.
- pawlet-recoveryboot.sh enters recovery via reboot,3 (separate partition)
  again, and gains a boot-loop failsafe: a /metadata counter (cleared on
  boot_completed via the .rc) drops the device into recovery after BOOT_MAX
  consecutive boots that reach early init but never complete.
- BootControl comments restored to A/B-via-tryboot (a failed trial reverts to
  the active slot; recovery is a separate partition via reboot,3).
2026-07-17 05:11:02 -07:00

152 lines
6.9 KiB
Makefile

#
# Copyright (C) 2025 oxmc / PawletOS
#
# SPDX-License-Identifier: Apache-2.0
#
# Common product config inherited by every PawletOS device.
# Include from each device's device.mk:
# $(call inherit-product, vendor/pawlet/config/common.mk)
#
# ---------------------------------------------------------------------------
# Soong namespace for vendor/pawlet HALs and apps
# ---------------------------------------------------------------------------
PRODUCT_SOONG_NAMESPACES += vendor/pawlet
# ---------------------------------------------------------------------------
# Brand
# ---------------------------------------------------------------------------
PRODUCT_BRAND ?= PawletOS
# ---------------------------------------------------------------------------
# Device name used in version strings (defaults to TARGET_DEVICE)
# ---------------------------------------------------------------------------
PAWLET_BUILD ?= $(TARGET_DEVICE)
# ---------------------------------------------------------------------------
# A/B (Seamless) system updates
# ---------------------------------------------------------------------------
AB_OTA_UPDATER := true
AB_OTA_PARTITIONS := \
boot \
system \
system_ext \
vendor
PRODUCT_PACKAGES += \
update_engine \
update_engine_client \
update_verifier
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.verified_boot.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.verified_boot.xml
# ---------------------------------------------------------------------------
# A/B: allow downgrade on non-user builds
# ---------------------------------------------------------------------------
ifneq ($(strip $(AB_OTA_PARTITIONS) $(AB_OTA_POSTINSTALL_CONFIG)),)
ifneq ($(TARGET_BUILD_VARIANT),user)
PRODUCT_PRODUCT_PROPERTIES += \
ro.ota.allow_downgrade=true
endif
endif
# ---------------------------------------------------------------------------
# Recovery is NOT part of the normal build: if it were, AOSP forces recovery.img
# into the vendor image size check (RECOVERY_FROM_BOOT_PATCH) and the padded
# 2GB vendor.img + recovery.img overflows the 2GB partition. Build recovery on
# demand instead, with the `precovery` helper (PAWLET_BUILD_RECOVERY=1 m
# recoveryimage), and flash the result to the recovery partition manually.
PRODUCT_BUILD_RECOVERY_IMAGE := $(if $(PAWLET_BUILD_RECOVERY),true,false)
# ---------------------------------------------------------------------------
# ADB security
# ---------------------------------------------------------------------------
ifeq ($(TARGET_BUILD_VARIANT),user)
PRODUCT_SYSTEM_EXT_PROPERTIES += ro.adb.secure=1
else
PRODUCT_SYSTEM_EXT_PROPERTIES += ro.adb.secure=0
endif
# ---------------------------------------------------------------------------
# Enforce privapp-permissions whitelist
# ---------------------------------------------------------------------------
PRODUCT_PRODUCT_PROPERTIES += \
ro.control_privapp_permissions=enforce
# ---------------------------------------------------------------------------
# This is PawletOS — declare the platform feature
# ---------------------------------------------------------------------------
PRODUCT_COPY_FILES += \
vendor/pawlet/config/permissions/me.pawlet.android.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/me.pawlet.android.xml \
vendor/pawlet/config/permissions/privapp-permissions-dev.oxmc.configprovisioner.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-dev.oxmc.configprovisioner.xml \
vendor/pawlet/config/permissions/privapp-permissions-me.pawlet.settings.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-me.pawlet.settings.xml \
vendor/pawlet/config/permissions/privapp-permissions-microg.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/privapp-permissions-microg.xml
# ---------------------------------------------------------------------------
# PawletOS platform resource package
# Exports device strings, icons, and OS metadata accessible to all apps via:
# context.createPackageContext("me.pawlet.android", 0).getResources()
# ---------------------------------------------------------------------------
PRODUCT_PACKAGES += \
PawletPlatform
# ---------------------------------------------------------------------------
# PawletOS first-party apps
# Privapp permissions and default-permissions are declared in each app's
# Android.bp and installed automatically by the build system.
# ---------------------------------------------------------------------------
PRODUCT_PACKAGES += \
Updater \
BgUpd \
PawletSetupWizard
# bg-upd's own sepolicy domain — lives in its own repo (packages/apps/BgUpd/sepolicy),
# included unconditionally since it's a core PawletOS system app, not an optional one.
BOARD_SEPOLICY_DIRS += packages/apps/BgUpd/sepolicy
# ---------------------------------------------------------------------------
# MicroG — open-source Google Play Services replacement
# ---------------------------------------------------------------------------
$(call inherit-product, vendor/pawlet/config/microg.mk)
# ---------------------------------------------------------------------------
# PawletOS build-time framework resource overlay (adds new drawables)
# ---------------------------------------------------------------------------
PRODUCT_PACKAGE_OVERLAYS += vendor/pawlet/overlay/static
# ---------------------------------------------------------------------------
# PawletOS resource overlay (framework customisations)
# ---------------------------------------------------------------------------
PRODUCT_PACKAGES += \
pawlet-framework-res-overlay
# ---------------------------------------------------------------------------
# Boot and shutdown animations
# ---------------------------------------------------------------------------
PRODUCT_COPY_FILES += \
vendor/pawlet/media/bootanimation.zip:$(TARGET_COPY_OUT_PRODUCT)/media/bootanimation.zip \
vendor/pawlet/media/shutdownanimation.zip:$(TARGET_COPY_OUT_PRODUCT)/media/shutdownanimation.zip
# ---------------------------------------------------------------------------
# MusicFX — system sound effects processor (equalizer, reverb)
# ---------------------------------------------------------------------------
PRODUCT_PACKAGES += \
MusicFX
# ---------------------------------------------------------------------------
# Monet / Material You — ThemePicker + Wallpaper & style
# ---------------------------------------------------------------------------
# ThemePicker (com.android.wallpaper) is added per-device product mk file.
# This overlay enables Monet color scheme, icon shape, font, and dark mode
# sections inside the app.
PRODUCT_PACKAGES += \
ThemePickerPawletOverlay \
pawlet-systemui-overlay
# ---------------------------------------------------------------------------
# Version properties
# ---------------------------------------------------------------------------
$(call inherit-product, vendor/pawlet/config/version.mk)