Files
android_vendor_pawlet/config/common.mk
T
oxmc 4e9f147e55 hwupdate: PawletOS hardware/peripheral firmware update subsystem
Adds pawlethwd, a native C++ system_ext daemon (coredomain) that detects
peripherals, checks the hardware update catalog (ota.php?mode=hardware),
verifies payloads, and flashes firmware via authorized handler plugins.

- daemon/: manifest parse, libcurl HTTP + sha256, sysfs USB detection,
  catalog client, dlopen handler registry (fixed path + ABI + allowlist),
  state persistence, orchestration engine, AIDL service, main.
- aidl/: IPawletHardwareUpdate (getComponents/getPendingUpdates/checkNow/...).
- include/pawlet/hwh_abi.h: stable C plugin ABI.
- handlers/usbdfu/: libpawlethwh_usbdfu.so, DFU 1.1 download over libusb.
- sepolicy/: pawlethwd domain, pawlet_hw_data_file, service type.
- schemas/, etc/supported_hardware.default.json, README design doc.
- hwupdate.mk wires packages + ro.pawlet.hardware.manifest + sepolicy dir;
  inherited from config/common.mk.

Trust: a server-named installer handler is honored only if allowlisted in
the immutable supported_hardware.json, maps to a fixed dm-verity-protected
.so path, is ABI/id-checked, and every payload is sha256-verified before a
handler runs.
2026-07-18 01:11:15 -07:00

157 lines
7.2 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)
# ---------------------------------------------------------------------------
# Hardware update subsystem (pawlethwd) — peripheral firmware updates
# ---------------------------------------------------------------------------
$(call inherit-product, vendor/pawlet/hwupdate/hwupdate.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)