Skip to content

Commit

Permalink
FP3: update for android-11
Browse files Browse the repository at this point in the history
- Switch from omni-9.0 to aosp-11.0
- Enable retrofitted dynamic partitions
- Switch to common qcom-decrypt
- Update blobs for decryption

Change-Id: If63d2f3900afb14c06ea8ce84d5d4b3ca1c2e45a
  • Loading branch information
chaosmaster committed Jun 5, 2023
1 parent 4df59cd commit 76d2f52
Show file tree
Hide file tree
Showing 57 changed files with 383 additions and 836 deletions.
2 changes: 1 addition & 1 deletion AndroidProducts.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
#

PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/omni_FP3.mk
$(LOCAL_DIR)/twrp_FP3.mk
25 changes: 19 additions & 6 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := cortex-a53

TARGET_SUPPORTS_64_BIT_APPS := true

# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := msm8953
TARGET_NO_BOOTLOADER := true
Expand All @@ -38,9 +40,9 @@ TARGET_BOARD_PLATFORM := msm8953

# Kernel
BOARD_KERNEL_BASE := 0x80000000
BOARD_KERNEL_CMDLINE := console=ttyMSM0,115200,n8 androidboot.console=ttyMSM0 androidboot.hardware=qcom msm_rtb.filter=0x237
BOARD_KERNEL_CMDLINE += ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_serial_dm,0x78af000
BOARD_KERNEL_CMDLINE += firmware_class.path=/vendor/firmware_mnt/image androidboot.usbconfigfs=true loop.max_part=7
BOARD_KERNEL_CMDLINE := androidboot.console=ttyMSM0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1
BOARD_KERNEL_CMDLINE += androidboot.bootdevice=7824900.sdhci earlycon=msm_serial_dm,0x78af000 androidboot.usbconfigfs=true loop.max_part=7
BOARD_KERNEL_CMDLINE += androidboot.boot_devices=soc/7824900.sdhci androidboot.super_partition=system
BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb
BOARD_KERNEL_PAGESIZE := 2048
TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/Image.gz-dtb
Expand All @@ -50,24 +52,36 @@ TARGET_KERNEL_CONFIG := fp3_twrp_defconfig
TARGET_KERNEL_SOURCE := kernel/fairphone/sdm632
endif

# Retrofit dynamic partitions
BOARD_SUPER_PARTITION_BLOCK_DEVICES := system vendor product
BOARD_SUPER_PARTITION_METADATA_DEVICE := system
BOARD_SUPER_PARTITION_SYSTEM_DEVICE_SIZE := 3221225472
BOARD_SUPER_PARTITION_VENDOR_DEVICE_SIZE := 1073741824
BOARD_SUPER_PARTITION_PRODUCT_DEVICE_SIZE := 134217728
BOARD_SUPER_PARTITION_SIZE := 4429185024
BOARD_SUPER_PARTITION_GROUPS := dynamic_partitions
BOARD_DYNAMIC_PARTITIONS_SIZE := $(BOARD_SUPER_PARTITION_SIZE)
BOARD_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor odm product system_ext

# Partitions
BOARD_FLASH_BLOCK_SIZE := 131072
BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 67108864
BOARD_DTBOIMG_PARTITION_SIZE := 8388608
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472
BOARD_USERDATAIMAGE_PARTITION_SIZE := 52335451136
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
BOARD_USES_RECOVERY_AS_BOOT := true
TARGET_USERIMAGES_USE_EXT4 := true

# Platform
PLATFORM_VERSION := 16.1.0
PLATFORM_SECURITY_PATCH := 2030-01-01
VENDOR_SECURITY_PATCH := $(PLATFORM_SECURITY_PATCH)

# Crypto
TW_INCLUDE_CRYPTO := true
TW_INCLUDE_CRYPTO_FBE := true
BOARD_USES_QCOM_FBE_DECRYPTION := true
TW_USE_FSCRYPT_POLICY := 1

# TWRP
RECOVERY_SDCARD_ON_DATA := true
Expand All @@ -80,7 +94,6 @@ TW_SCREEN_BLANK_ON_BOOT := true
TW_THEME := portrait_hdpi
TW_USE_TOOLBOX := true
TW_OVERRIDE_SYSTEM_PROPS := "ro.build.fingerprint;ro.build.version.incremental"
PRODUCT_EXTRA_RECOVERY_KEYS := $(DEVICE_PATH)/releasekey
TARGET_USE_CUSTOM_LUN_FILE_PATH := /config/usb_gadget/g1/functions/mass_storage.0/lun.%d/file

# Debug flags
Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,15 @@ Rear Camera | 12 MP (f/1.8, 1/2.55", PDAF)
Front Camera | 8 MP (f/2.0, 1/4", HDR)

### Kernel Source
https://code.fairphone.com/projects/fairphone-3-gpl.html
https://code.fairphone.com/projects/fairphone-3/gpl.html

### Build with TWRP installer
To automatically build the twrp-installer, pick this:

```sh
https://gerrit.omnirom.org/#/c/android_build/+/33182/
```
### How to compile

```sh
. build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
export DTC_EXT=$PWD/prebuilts/misc/linux-x86/dtc/dtc
lunch omni_fp3-eng
mka recoveryimage
lunch twrp_FP3-eng
mka bootimage
```
### Copyright
```
Expand Down
Binary file modified prebuilt/Image.gz-dtb
Binary file not shown.
54 changes: 0 additions & 54 deletions recovery/root/etc/recovery.fstab

This file was deleted.

144 changes: 38 additions & 106 deletions recovery/root/init.recovery.qcom.rc
Original file line number Diff line number Diff line change
@@ -1,109 +1,41 @@
# Copyright (c) 2017-2018,2020 The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

import /init.recovery.qcom_decrypt.rc

on init
setprop sys.usb.configfs 1
#setprop prepdecrypt.setpatch true
#setprop prepdecrypt.loglevel 2

on property:ro.boot.usbcontroller=*
setprop sys.usb.controller ${ro.boot.usbcontroller}
write /sys/class/udc/${ro.boot.usbcontroller}/device/../mode peripheral

on fs
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice

chmod 0660 /dev/qseecom
chown system drmrpc /dev/qseecom
chmod 0664 /dev/ion
chown system system /dev/ion

install_keyring

setprop ro.board.platform msm8953
start boot-1-0
start prepdecrypt

on boot
setprop sys.usb.config adb

service prepdecrypt /sbin/prepdecrypt.sh
oneshot
disabled
user root
group root
seclabel u:r:recovery:s0

service hwservicemanager /sbin/hwservicemanager
user root
group root
disabled
onrestart setprop hwservicemanager.ready false
seclabel u:r:recovery:s0

service servicemanager /sbin/servicemanager
disabled
user root
group root readproc
seclabel u:r:recovery:s0
writepid /dev/cpuset/system-background/tasks

# Separate copy needed to use /sbin/linker64 instead of /system/bin/linker64
service sbinqseecomd /sbin/qseecomd
user root
group root
disabled
seclabel u:r:recovery:s0

service boot-1-0 /sbin/[email protected]
user root
group root
disabled
seclabel u:r:recovery:s0

service gatekeeper-1-0 /sbin/[email protected]
user root
group root
disabled
seclabel u:r:recovery:s0

service keymaster-4-0 /sbin/[email protected]
user root
group root
disabled
seclabel u:r:recovery:s0

# This helps fix ld.config.txt errors from the linker on Android 8.1+
service ldconfigtxt /sbin/touch /sbin/ld.config.txt
oneshot
seclabel u:r:recovery:s0

on boot
export LD_CONFIG_FILE /sbin/ld.config.txt
# save battery by switching to interactive once booted
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive

on property:crypto.ready=1
start sbinqseecomd

on property:crypto.ready=0
stop sbinqseecomd
stop keymaster-4-0
stop gatekeeper-1-0
stop hwservicemanager
stop keystore
stop servicemanager

on property:vendor.sys.listeners.registered=true
start hwservicemanager
start keymaster-4-0
start gatekeeper-1-0
start servicemanager

# Handled by TWRP
service keystore /sbin/keystore /tmp/misc/keystore
disabled
oneshot
user root
group root drmrpc readproc
seclabel u:r:recovery:s0
writepid /dev/cpuset/foreground/tasks

service keystore_auth /sbin/keystore_auth
disabled
oneshot
user system
group root
seclabel u:r:recovery:s0
Binary file removed recovery/root/sbin/[email protected]
Binary file not shown.
Binary file removed recovery/root/sbin/[email protected]
Binary file not shown.
Binary file removed recovery/root/sbin/[email protected]
Binary file not shown.
Binary file removed recovery/root/sbin/[email protected]
Binary file not shown.
Loading

0 comments on commit 76d2f52

Please sign in to comment.