diff --git a/BoardConfig.mk b/BoardConfig.mk index 02e3f8f..511d700 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -24,6 +24,7 @@ TARGET_2ND_CPU_VARIANT := cortex-a53 TARGET_BOARD_PLATFORM := msm8937 TARGET_BOARD_PLATFORM_GPU := qcom-adreno505 TARGET_BOARD_SUFFIX := _64 +BOARD_USES_QCOM_HARDWARE := true # Bootloader TARGET_BOOTLOADER_BOARD_NAME := msm8937 @@ -36,6 +37,12 @@ BOARD_KERNEL_BASE := 0x80000000 BOARD_KERNEL_PAGESIZE := 2048 BOARD_KERNEL_TAGS_OFFSET := 0x00000100 BOARD_RAMDISK_OFFSET := 0x01000000 + +# Kernel - prebuilt +TARGET_FORCE_PREBUILT_KERNEL := true +ifeq ($(TARGET_FORCE_PREBUILT_KERNEL),true) +TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/Image.gz-dtb +else BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb TARGET_KERNEL_CONFIG := FIH-msm8937_defconfig TARGET_KERNEL_SOURCE := kernel/nokia/ND1 @@ -44,17 +51,14 @@ TARGET_KERNEL_BINARIES: $(KERNEL_OUT) $(KERNEL_CONFIG) $(KERNEL_HEADERS_INSTALL) $(MAKE) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(TARGET_ARCH) $(ARM_CROSS_COMPILE) modules $(MAKE) -C $(KERNEL_SRC) O=$(KERNEL_OUT) INSTALL_MOD_PATH=../../$(KERNEL_MODULES_INSTALL) ARCH=$(TARGET_ARCH) $(ARM_CROSS_COMPILE) modules_install -# Kernel - prebuilt -TARGET_FORCE_PREBUILT_KERNEL := true -ifeq ($(TARGET_FORCE_PREBUILT_KERNEL),true) -TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/Image.gz-dtb endif # Encryption -TARGET_CRYPTFS_HW_PATH := vendor/qcom/opensource/commonsys/cryptfs_hw +TW_INCLUDE_CRYPTO := true +TW_INCLUDE_CRYPTO_FBE := true TARGET_HW_DISK_ENCRYPTION := true - -# Keymaster +BOARD_USES_QCOM_FBE_DECRYPTION := true +TARGET_KEYMASTER_WAIT_FOR_QSEE := true TARGET_PROVIDES_KEYMASTER := true # Partitions @@ -87,15 +91,14 @@ TW_BRIGHTNESS_PATH := "/sys/class/leds/lcd-backlight/brightness" TW_SCREEN_BLANK_ON_BOOT := true TARGET_RECOVERY_QCOM_RTC_FIX := true TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888" -TARGET_RECOVERY_FSTAB := device/nokia/ND1/recovery/root/etc/twrp.fstab +TARGET_RECOVERY_FSTAB := device/nokia/ND1/twrp.fstab BOARD_SUPPRESS_SECURE_ERASE := true RECOVERY_SDCARD_ON_DATA := true RECOVERY_GRAPHICS_USE_LINELENGTH := true -TW_USE_TOOLBOX := true TW_EXCLUDE_TWRPAPP := true - -# Qcom Hardware -BOARD_USES_QCOM_HARDWARE := true +TWRP_INCLUDE_LOGCAT := true +TARGET_USES_LOGD := true +TARGET_USES_MKE2FS := true # Hack: prevent anti rollbackTARGET_PROVIDES_KEYMASTER PLATFORM_SECURITY_PATCH := 2099-12-31 diff --git a/omni.dependencies b/omni.dependencies index e894a00..5c214ff 100644 --- a/omni.dependencies +++ b/omni.dependencies @@ -1,14 +1,26 @@ [ { - "remote": "omnirom", - "repository": "android_vendor_qcom_opensource_commonsys", - "target_path": "vendor/qcom/opensource/commonsys", - "revision": "android-9.0" + "remote": "andrewgigena", + "repository": "android_kernel_nokia_ND1", + "target_path": "kernel/nokia/ND1", + "revision": "twrp" }, { - "remote": "andrewgigena", - "repository": "android_kernel_nokia_ND1", - "target_path": "kernel/nokia/ND1", - "revision": "twrp" + "remote": "TeamWin", + "repository": "android_device_qcom_common", + "target_path": "device/qcom/common", + "revision": "android-9.0" + }, + { + "remote": "TeamWin", + "repository": "android_hardware_qcom_bootctrl", + "target_path": "hardware/qcom/bootctrl", + "revision": "android-9.0" + }, + { + "remote": "TeamWin", + "repository": "android_device_qcom_twrp-common", + "target_path": "device/qcom/twrp-common", + "revision": "android-9.0" } ] diff --git a/omni_ND1.mk b/omni_ND1.mk index 180282d..93c680c 100644 --- a/omni_ND1.mk +++ b/omni_ND1.mk @@ -36,4 +36,5 @@ PRODUCT_PACKAGES += \ # Encryption PRODUCT_PACKAGES += \ - libcryptfs_hw + qcom_decrypt \ + qcom_decrypt_fbe \ No newline at end of file diff --git a/prebuilt/Image.gz-dtb b/prebuilt/Image.gz-dtb index 8cf1b49..4659b22 100644 Binary files a/prebuilt/Image.gz-dtb and b/prebuilt/Image.gz-dtb differ diff --git a/recovery/root/etc/twrp.fstab b/recovery/root/etc/twrp.fstab index 7b476ea..0fdf558 100644 --- a/recovery/root/etc/twrp.fstab +++ b/recovery/root/etc/twrp.fstab @@ -1,16 +1,59 @@ -# mount point fstype device device2 flags -/system ext4 /dev/block/bootdevice/by-name/system -/system_image emmc /dev/block/bootdevice/by-name/system -/data ext4 /dev/block/bootdevice/by-name/userdata flags=encryptable=footer -/cache ext4 /dev/block/bootdevice/by-name/cache -/recovery emmc /dev/block/bootdevice/by-name/recovery flags=backup=1 -/persist ext4 /dev/block/bootdevice/by-name/persist flags=backup=1;display="Persist";mounttodecrypt -/boot emmc /dev/block/bootdevice/by-name/boot -/misc emmc /dev/block/bootdevice/by-name/misc +# Copyright (c) 2012-2024, 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. +# +# mount point fstype device device2 flags -/efs1 emmc /dev/block/bootdevice/by-name/modemst1 flags=display="EFS";backup=1 -/efs2 emmc /dev/block/bootdevice/by-name/modemst2 flags=backup=1;subpartitionof=/efs1 -/firmware vfat /dev/block/bootdevice/by-name/modem flags=display="Firmware";mounttodecrypt +# System partitions +/system ext4 /dev/block/bootdevice/by-name/system flags=backup=1;display="System" +/system_image emmc /dev/block/bootdevice/by-name/system flags=backup=1;display="System Image" +/cache ext4 /dev/block/bootdevice/by-name/cache flags=backup=1;display="Cache" +/boot emmc /dev/block/bootdevice/by-name/boot flags=backup=1;display="Bootloader" +/recovery emmc /dev/block/bootdevice/by-name/recovery flags=backup=1;display="Recovery" +/data ext4 /dev/block/bootdevice/by-name/userdata flags=encryptable=footer;length=-16384;display="Internal Storage" -/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=removable;storage;wipeingui;display="Micro SDCard" -/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=removable;storage;wipeingui;display="USB OTG" \ No newline at end of file +# Modem and related partitions +/misc emmc /dev/block/bootdevice/by-name/misc flags=backup=1;display="Misc" +/modem ext4 /dev/block/bootdevice/by-name/modem flags=backup=1;display="Modem" +/bluetooth emmc /dev/block/bootdevice/by-name/bluetooth flags=backup=1;display="Bluetooth" +/dsp ext4 /dev/block/bootdevice/by-name/dsp flags=backup=1;display="DSP" + +# EFS (Embedded File System) partitions +/efs1 emmc /dev/block/bootdevice/by-name/modemst1 flags=backup=1;display="EFS1" +/efs2 emmc /dev/block/bootdevice/by-name/modemst2 flags=backup=1;display="EFS2" +/efsc emmc /dev/block/bootdevice/by-name/fsc flags=backup=1;display="EFSC" +/efsg emmc /dev/block/bootdevice/by-name/fsg flags=backup=1;display="EFSG" + +# FIH partitions +/box ext4 /dev/block/bootdevice/by-name/box flags=backup=1;display="Box" +/hidden ext4 /dev/block/bootdevice/by-name/hidden flags=backup=1;display="Hidden" +/cda ext4 /dev/block/bootdevice/by-name/cda flags=backup=1;display="CDA" +/securefs ext4 /dev/block/bootdevice/by-name/securefs flags=backup=1;display="SecureFS" +/elabel emmc /dev/block/bootdevice/by-name/elabel flags=backup=1;display="ELabel" +/persist ext4 /dev/block/bootdevice/by-name/persist flags=backup=1;display="Persist" + +# External storage partitions +/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="External SD";storage;wipeingui;removable +/usbstorage vfat /dev/block/sda1 /dev/block/sda flags=fsflags=utf8;display="USB Storage";storage;removable \ No newline at end of file diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc old mode 100755 new mode 100644 index fcdb941..6324dad --- a/recovery/root/init.recovery.qcom.rc +++ b/recovery/root/init.recovery.qcom.rc @@ -1,22 +1,37 @@ +# Copyright (c) 2012-2024, 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 prepdecrypt.loglevel 2 + setprop ro.board.platform msm8937 # Important for decryption + on fs # needed to make qseecomd work in recovery 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 - -on property:ro.crypto.state=encrypted - start sbinqseecomd - -# separate copy needed to use /sbin/linker64 instead of /system/bin/linker64 -service sbinqseecomd /sbin/qseecomd - oneshot - disabled - user root - group root - seclabel u:r:recovery:s0 - -on property:ro.crypto.fs_crypto_blkdev=/dev/block/dm-0 - stop sbinqseecomd diff --git a/recovery/root/init.recovery.usb.rc b/recovery/root/init.recovery.usb.rc index 8019736..3eb6c3a 100644 --- a/recovery/root/init.recovery.usb.rc +++ b/recovery/root/init.recovery.usb.rc @@ -1,3 +1,30 @@ +# Copyright (c) 2012-2024, 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. +# + on fs write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/idVendor 18D1 diff --git a/recovery/root/sbin/qseecomd b/recovery/root/vendor/bin/qseecomd similarity index 100% rename from recovery/root/sbin/qseecomd rename to recovery/root/vendor/bin/qseecomd diff --git a/recovery/root/vendor/lib64/hw/keystore.msm8937.so b/recovery/root/vendor/lib64/hw/keystore.msm8937.so index ee758d6..defd13d 100644 Binary files a/recovery/root/vendor/lib64/hw/keystore.msm8937.so and b/recovery/root/vendor/lib64/hw/keystore.msm8937.so differ diff --git a/recovery/root/vendor/lib64/ld-android.so b/recovery/root/vendor/lib64/ld-android.so new file mode 100644 index 0000000..902e772 Binary files /dev/null and b/recovery/root/vendor/lib64/ld-android.so differ diff --git a/recovery/root/vendor/lib64/lib-sec-disp.so b/recovery/root/vendor/lib64/lib-sec-disp.so new file mode 100644 index 0000000..c80bdb9 Binary files /dev/null and b/recovery/root/vendor/lib64/lib-sec-disp.so differ diff --git a/recovery/root/vendor/lib64/libGPreqcancel.so b/recovery/root/vendor/lib64/libGPreqcancel.so new file mode 100644 index 0000000..fdfb90f Binary files /dev/null and b/recovery/root/vendor/lib64/libGPreqcancel.so differ diff --git a/recovery/root/vendor/lib64/libGPreqcancel_svc.so b/recovery/root/vendor/lib64/libGPreqcancel_svc.so new file mode 100644 index 0000000..341f786 Binary files /dev/null and b/recovery/root/vendor/lib64/libGPreqcancel_svc.so differ diff --git a/recovery/root/vendor/lib64/libQSEEComAPI.so b/recovery/root/vendor/lib64/libQSEEComAPI.so index 0df9f56..51090f9 100644 Binary files a/recovery/root/vendor/lib64/libQSEEComAPI.so and b/recovery/root/vendor/lib64/libQSEEComAPI.so differ diff --git a/recovery/root/vendor/lib64/libStDrvInt.so b/recovery/root/vendor/lib64/libStDrvInt.so new file mode 100644 index 0000000..7b66193 Binary files /dev/null and b/recovery/root/vendor/lib64/libStDrvInt.so differ diff --git a/recovery/root/vendor/lib64/libdiag.so b/recovery/root/vendor/lib64/libdiag.so index d077af6..282e39e 100644 Binary files a/recovery/root/vendor/lib64/libdiag.so and b/recovery/root/vendor/lib64/libdiag.so differ diff --git a/recovery/root/vendor/lib64/libdrm.so b/recovery/root/vendor/lib64/libdrm.so deleted file mode 100644 index ce60250..0000000 Binary files a/recovery/root/vendor/lib64/libdrm.so and /dev/null differ diff --git a/recovery/root/vendor/lib64/libdrmfs.so b/recovery/root/vendor/lib64/libdrmfs.so index c573dac..d4dd5da 100644 Binary files a/recovery/root/vendor/lib64/libdrmfs.so and b/recovery/root/vendor/lib64/libdrmfs.so differ diff --git a/recovery/root/vendor/lib64/libdrmtime.so b/recovery/root/vendor/lib64/libdrmtime.so new file mode 100644 index 0000000..e95ed94 Binary files /dev/null and b/recovery/root/vendor/lib64/libdrmtime.so differ diff --git a/recovery/root/vendor/lib64/libqisl.so b/recovery/root/vendor/lib64/libqisl.so new file mode 100644 index 0000000..b7132c8 Binary files /dev/null and b/recovery/root/vendor/lib64/libqisl.so differ diff --git a/recovery/root/vendor/lib64/librpmb.so b/recovery/root/vendor/lib64/librpmb.so index 8b4bd30..e29ea20 100644 Binary files a/recovery/root/vendor/lib64/librpmb.so and b/recovery/root/vendor/lib64/librpmb.so differ diff --git a/recovery/root/vendor/lib64/libsecureui.so b/recovery/root/vendor/lib64/libsecureui.so new file mode 100644 index 0000000..ad7e5c8 Binary files /dev/null and b/recovery/root/vendor/lib64/libsecureui.so differ diff --git a/recovery/root/vendor/lib64/libsecureui_svcsock.so b/recovery/root/vendor/lib64/libsecureui_svcsock.so new file mode 100644 index 0000000..3afc571 Binary files /dev/null and b/recovery/root/vendor/lib64/libsecureui_svcsock.so differ diff --git a/recovery/root/vendor/lib64/libssd.so b/recovery/root/vendor/lib64/libssd.so index a51c771..1312013 100644 Binary files a/recovery/root/vendor/lib64/libssd.so and b/recovery/root/vendor/lib64/libssd.so differ diff --git a/recovery/root/vendor/lib64/libtime_genoff.so b/recovery/root/vendor/lib64/libtime_genoff.so new file mode 100644 index 0000000..1adee1e Binary files /dev/null and b/recovery/root/vendor/lib64/libtime_genoff.so differ