Files
pawlet_rpi5/device.mk
T
oxmc ff34391e4b rpi5: partition layout, boot setup, slow_storage, BootControl, wrimg for Android 16
Partition layout:
- BoardConfig: system 8 GB, vendor 2 GB
- mkimg: matching system/vendor partition sizes
- fstab: remove discard from metadata; make discard opt-in via
  BOARD_STORAGE_SUPPORTS_DISCARD to avoid boot-time I/O stalls
- wrimg: grow userdata to fill remaining device space on flash

Boot:
- mkbootimg: use stamp file for rpiboot; uppercase FAT volume label
- rpi5: set androidboot.boot_devices for by-name symlink creation
- wrimg: stamp androidboot.slot_suffix in cmdline.txt after each A/B write
- rpi5: disable AVB (no vbmeta partition in this layout)

A/B / BootControl:
- sepolicy: add BootControl HAL policy and fix partition file_contexts
- wrimg: switch to PARTLABEL-based device detection; fix system_ext brackets

Initial repo setup:
- Separate into standalone pawlet_rpi5 repository
- Disable recovery/TWRP; fix include paths and package names
- Align to upstream KonstaKANG rpi5 base
2026-06-11 09:14:16 -07:00

221 lines
9.0 KiB
Makefile

#
# Copyright (C) 2021-2023 KonstaKANG
#
# SPDX-License-Identifier: Apache-2.0
#
DEVICE_PATH := device/pawlet/rpi5
# ADB, wireless debugging on userdebug/eng builds
ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
PRODUCT_SYSTEM_PROPERTIES += \
persist.adb.tcp.port=5555 \
persist.sys.usb.config=adb
endif
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
$(call inherit-product, frameworks/native/build/tablet-7in-xhdpi-2048-dalvik-heap.mk)
# PawletOS vendor (HALs, updater, version props, A/B OTA config)
$(call inherit-product, vendor/pawlet/config/common.mk)
# PawletOS RPI HALs and configs
$(call inherit-product, vendor/pawlet/config/rpi_common.mk)
# APEX
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
OVERRIDE_PRODUCT_COMPRESSED_APEX := false
# API level
PRODUCT_SHIPPING_API_LEVEL := 36
# Audio
PRODUCT_PACKAGES += \
com.android.hardware.audio.rpi
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/audio/audio_effects_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects_config.xml \
$(DEVICE_PATH)/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
$(DEVICE_PATH)/audio/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml \
frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \
frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml
# Bluetooth
PRODUCT_PACKAGES += \
com.android.hardware.bluetooth.rpi
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml
# Camera
PRODUCT_PACKAGES += \
com.android.hardware.camera.external.rpi
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/camera/external/external_camera_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/external_camera_config.xml
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.camera.external.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.external.xml
PRODUCT_PACKAGES += \
com.android.hardware.camera.libcamera
$(call soong_config_set,libcamera,ipa,pisp)
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/camera/libcamera/camera_hal.yaml:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/camera_hal.yaml
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.camera.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.xml \
frameworks/native/data/etc/android.hardware.camera.concurrent.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.concurrent.xml \
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/camera/media_profiles_V1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml
# CEC
PRODUCT_PACKAGES += \
com.android.hardware.tv.hdmi.cec.rpi \
com.android.hardware.tv.hdmi.connection.rpi
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.hdmi.cec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.hdmi.cec.xml
# DRM
PRODUCT_PACKAGES += \
com.android.hardware.drm.clearkey
# Emergency info
PRODUCT_PACKAGES += \
EmergencyInfo
# Ethernet
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml
# FFmpeg
PRODUCT_PACKAGES += \
com.android.hardware.media.c2.ffmpeg
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/media/media_codecs_ffmpeg_c2.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_ffmpeg_c2.xml
# Gatekeeper
PRODUCT_PACKAGES += \
com.android.hardware.gatekeeper.nonsecure
# Graphics
PRODUCT_PACKAGES += \
com.android.hardware.egl.mesa \
com.android.hardware.graphics.allocator.minigbm_gbm_mesa \
com.android.hardware.graphics.composer.drm_hwcomposer \
com.android.hardware.vulkan.broadcom
# Health
PRODUCT_PACKAGES += \
com.android.hardware.health.rpi
# Kernel
PRODUCT_COPY_FILES += \
device/brcm/rpi5-kernel/Image:$(PRODUCT_OUT)/kernel # normally: $(DEVICE_PATH)-kernel
# Keymint
PRODUCT_PACKAGES += \
com.android.hardware.keymint.rust_nonsecure
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.keystore.app_attest_key.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.keystore.app_attest_key.xml
# Lights
PRODUCT_PACKAGES += \
com.android.hardware.light.rpi
# Media
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/media/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_c2_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_c2_audio.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_c2_tv.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_c2_tv.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_c2_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_c2_video.xml
# Power
PRODUCT_PACKAGES += \
com.android.hardware.power
# Ramdisk
# Set BOARD_STORAGE_SUPPORTS_DISCARD := true in BoardConfig.mk (or a device
# variant makefile) to enable TRIM on the metadata partition. Only do this if
# your storage device actually supports discard (SD cards, SSDs) — USB flash
# drives typically don't, and requesting discard on them stalls jbd2.
ifeq ($(BOARD_STORAGE_SUPPORTS_DISCARD),true)
_FSTAB_SRC := $(DEVICE_PATH)/ramdisk/fstab.rpi5.discard
else
_FSTAB_SRC := $(DEVICE_PATH)/ramdisk/fstab.rpi5
endif
PRODUCT_COPY_FILES += \
$(_FSTAB_SRC):$(TARGET_COPY_OUT_RAMDISK)/fstab.rpi5 \
$(_FSTAB_SRC):$(TARGET_COPY_OUT_VENDOR)/etc/fstab.rpi5 \
$(DEVICE_PATH)/ramdisk/fstab.zram.25p:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.zram.25p \
$(DEVICE_PATH)/ramdisk/fstab.zram.50p:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.zram.50p \
$(DEVICE_PATH)/ramdisk/fstab.zram.75p:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.zram.75p \
$(DEVICE_PATH)/ramdisk/fstab.zram.none:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.zram.none \
$(DEVICE_PATH)/ramdisk/init.rpi5.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.rpi5.rc \
$(DEVICE_PATH)/ramdisk/init.rpi5.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.rpi5.usb.rc \
$(DEVICE_PATH)/ramdisk/ueventd.rpi5.rc:$(TARGET_COPY_OUT_VENDOR)/etc/ueventd.rc
# ZRAM: default 50% of RAM as compressed swap
PRODUCT_VENDOR_PROPERTIES += \
persist.vendor.zram.size=50p
# Seccomp
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/seccomp_policy/mediacodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \
$(DEVICE_PATH)/seccomp_policy/mediaswcodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediaswcodec.policy
# Soong
PRODUCT_SOONG_NAMESPACES += $(DEVICE_PATH)
# Storage
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)
# Suspend
PRODUCT_PACKAGES += \
com.android.hardware.suspend_blocker.rpi
# Thermal
PRODUCT_PACKAGES += \
com.android.hardware.thermal
# Touchscreen
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml
# USB
PRODUCT_PACKAGES += \
com.android.hardware.usb \
com.android.hardware.usb.gadget.rpi
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml
# Virtualization
$(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk)
# Wifi
PRODUCT_PACKAGES += \
com.android.hardware.wifi \
com.android.hardware.wifi.hostapd.rpi \
com.android.hardware.wifi.supplicant.rpi \
libwpa_client \
wificond
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml