Commit Graph

92 Commits

Author SHA1 Message Date
Col_or 6bc31ffe48 vendor: soong: Accept back a value for TARGET_RECOVERY_OVERSCAN_PERCENT
* If the cflags doesn't have value, it may lead to an incomplete display.

Test:
    Before fixed: I:Scaling theme width 0.981481x and height 1.169271x, offsets x: 0 y: 107 w: 0 h: -107
    After fixed:  I:Scaling theme width 1.000000x and height 1.194271x, offsets x: 0 y: 107 w: 0 h: -107
Change-Id: I267290748f2896662696c781a83e141b771e3e2e
Signed-off-by: Col_or <color597@outlook.com>
2023-11-26 13:36:31 +08:00
Nebrassy 35f41f54f6 Merge "TWRP: export TW_SUPPORT_INPUT_1_2_HAPTICS" into android-12.1 2023-11-24 14:40:13 +00:00
nebrassy 8019caf0c9 TWRP: export TW_SUPPORT_INPUT_1_2_HAPTICS
Change-Id: I7878f4f89e66938430ebddfa5abc814bdd752a29
2023-11-23 16:13:41 +01:00
bigbiff 1514765cb6 Merge "TWRP: move TWRP makevars to BoardConfigSoong 1/2" into android-12.1 2023-11-14 02:09:12 +00:00
nebrassy ac1dfae958 TWRP: move TWRP makevars to BoardConfigSoong 1/2
Change-Id: I8665c1f3b77efd1c91831e46b7ecdb170fe353ba
2023-11-14 02:08:28 +00:00
captainthrowback a33af40e8c Merge "envsetup: export TOP" into android-12.1 2023-10-16 18:41:44 +00:00
Captain Throwback e9182617df envsetup: export TOP
In build systems where OUT_DIR_COMMON_BASE is used,
TOP cannot be identified if the directory is changed.
Exporting TOP when envsetup is run ensures that it
will always be set and croot will work as expected.

Change-Id: I6944ac7d3513ba9504e03baa5f9910bddb126d7c
2023-10-10 13:50:33 -04:00
bigbiff 5d22aab11c Merge "twrp: fscrypt: bypass FS_IOC_[G|S]ET_ENCRYPTION_POLICY" into android-12.1 2023-09-28 23:42:32 +00:00
steadfasterX 33c42f533a twrp: fscrypt: bypass FS_IOC_[G|S]ET_ENCRYPTION_POLICY
my (loooong) debugging sessions reg my decryption issues on FBEv2 revealed the following:

the issue occurs in [fscrypt.cpp](https://cs.android.com/android/platform/superproject/+/android-12.1.0_r27:system/extras/libfscrypt/fscrypt.cpp;l=334-353) - actually by this condition: [here](https://cs.android.com/android/platform/superproject/+/android-12.1.0_r27:system/extras/libfscrypt/fscrypt.cpp;l=337)

so what happens?

1. `ioctl(fd, FS_IOC_GET_ENCRYPTION_POLICY, &policy);` actually gives: `-1` with `errno=17` (i.e. "Invalid argument")!
2. Due to that it will return `EINVAL` which is WRONG as this is the expected errno when a FBE v2 policy has been found! Which is **NOT** the case as the ioctl fails with "invalid argument" instead. This alone is (at least) a design bug as it should be catched and handled differently.
3. anyways due to 2. we now assume it is encrypted (with FBE v2) - see: [fscrypt.cpp](https://cs.android.com/android/platform/superproject/+/android-12.1.0_r27:system/extras/libfscrypt/fscrypt.cpp;l=130)
4. the next design (ihmo) bug is that **REGARDLESS** of the fact if the directory is encrypted (or not) it checks if it can set a policy on it. IMHO this should be done ONLY when an encryption has been found.
5. setting the (constructed) policy on a *non-empty* AND *encrypted directory* [will fail](https://cs.android.com/android/platform/superproject/+/android-12.1.0_r27:system/extras/libfscrypt/fscrypt.cpp;l=340) because the dir is non-empty AND encrypted AND the ioctl to **SET** the policy fails (likely due to the same issue as in 1.)
6. as a result TWRP decryption fails (due to the `break` [here](https://cs.android.com/android/platform/superproject/+/android-12.1.0_r27:system/extras/libfscrypt/fscrypt.cpp;l=340-342))

so what is the bug here actually?

- Is it that the policy TWRP is trying to set (bc of maybe wrong options by me somewhere) is simply different then what Android is setting? I tested and tried a lot to compare the contents of `kern_policy` and `policy` without meaningful success (I am NOT a cpp pro!)
- Is the code in fscrypt.cpp simply useless (for TWRP)? I mean from my point it makes zero sense to add a policy on a directory which is encrypted already (for TWRP). imho it should be even **avoided (!)** as if it would not abort there it means the policy might be changed(!) and that can break Android. imho TWRP should not even try to do that but instead skip the whole part - but that means forking the fscrypt code (dunno if that is smth the devs want to do)

I mean even the comment in fscrypt.cpp states:

> FS_IOC_SET_ENCRYPTION_POLICY will set the policy if the directory is
> unencrypted; otherwise it will verify that the existing policy matches.

which is NOT the (full) truth. it will NOT "otherwise" verify but fail instead - in that specific scenario I encounter here (failing ioctl with invalid argument).

so [this condition](https://cs.android.com/android/platform/superproject/+/android-12.1.0_r27:system/extras/libfscrypt/fscrypt.cpp;l=355) now simply checks for the encryption state, too and all problems (I had) are solved.

I had added debug outputs everywhere (including the kernel) and all leads to the prob "Invalid argument" when the kernel is doin the mentioned ioctl on `FS_IOC_GET_ENCRYPTION_POLICY`.
The reason behind **why** that fails is still nothing I can tell. likely I miss smth in the kernel or kernel config.

ofc the secondary issue with `FS_IOC_SET_ENCRYPTION_POLICY` still could happen due to misconfigured policy options - but that does not explain why the `FS_IOC_GET_ENCRYPTION_POLICY` fails as that one should at least give the current policy (bc it **IS** encrypted). IMHO both GET and SET are related and a general issue within (likely) the kernel.

[FS_IOC_GET_ENCRYPTION_POLICY source/info](https://www.kernel.org/doc/html/latest/filesystems/fscrypt.html#fs-ioc-get-encryption-policy).

so as I do not have any further ideas I patch fscrypt.cpp with vendorsetup.sh on-the-fly (yea dirty as.. ) and get at least a working result.

Change-Id: I59eca3413e75712af3e23b195cd32b96704c0a93
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2023-09-28 23:42:26 +00:00
bigbiff 359e793742 Merge "twrp: Import libfscrypt from https://android.googlesource.com/platform/system/extras/" into android-12.1 2023-09-28 23:42:15 +00:00
Mohd Faraz 31d9055ff6 twrp: Import libfscrypt from https://android.googlesource.com/platform/system/extras/
Change-Id: I5e5c3395bb67984c90a94010e19712c007a6c312
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2023-09-13 20:48:55 +05:30
captainthrowback 3b222dfb70 Merge "makevars: Add TW_FRAMERATE" into android-12.1 2023-08-22 17:09:18 +00:00
bigbiff bde6f016cf Merge "makevars: Add TW_NO_FASTBOOT_BOOT" into android-12.1 2022-11-06 18:46:44 +00:00
Sushrut1101 79daea1594 makevars: Add TW_NO_FASTBOOT_BOOT
Signed-off-by: Sushrut1101 <guptasushrut@gmail.com>
Change-Id: Ifc0dcda77bff565436bdb1eb71a6909bddcf8b22
2022-11-06 18:46:31 +00:00
bigbiff a08a99aca8 Merge "Add TW_NO_FASTBOOT_BOOT flag" into android-12.1 2022-11-05 14:33:23 +00:00
Sushrut1101 93b80a8181 Add TW_NO_FASTBOOT_BOOT flag
* Some Devices that do not support hotbooting an image using fastboot
  boot (eg: mtk devices) face issues like battery level detection,
  unable to reboot to system, etc.
  When twrpfastboot is set to 1 in the kernel cmdline. Setting this flag
  to true will not add twrpfastboot=1 in the cmdline and therefore will
  fix those issues.

* Tested on evergo, fixed battery level detection, reboot to system and
  slot changing.

Change-Id: I3f2d0fb3ef71f42904f756b4c7dec1cc51905f40
Signed-off-by: Sushrut1101 <guptasushrut@gmail.com>
2022-11-05 02:14:27 +05:30
bigbiff d4f8738af9 Merge "twrp: makevars: Add TW_SUPPORT_INPUT_AIDL_HAPTICS_FQNAME and TW_SUPPORT_INPUT_AIDL_HAPTICS_FIX_OFF" into android-12.1 2022-10-30 18:33:31 +00:00
sekaiacg ecfd70ae62 twrp: makevars: Add TW_SUPPORT_INPUT_AIDL_HAPTICS_FQNAME and TW_SUPPORT_INPUT_AIDL_HAPTICS_FIX_OFF
Change-Id: I0dc8e6f55f3603329adcd925103752107d6f8bb5
2022-10-30 21:57:46 +05:30
bigbiff 86945ae9b7 Merge "twrp: makevars: Add vars for status bar icon offsets" into android-12.1 2022-08-23 18:11:35 +00:00
Mohd Faraz b0602da746 twrp: makevars: Add vars for status bar icon offsets
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
Signed-off-by: Yillié <yilliee@protonmail.com>
Change-Id: I5b00ec281717540f732789f191188ce8041eb083
(cherry picked from commit acdbc4b70ad3f765e49d72939118bccca61de9c7)
2022-08-23 14:09:59 -04:00
bigbiff 2fcc2a8a12 Merge "makevars: add TW_USE_FSCRYPT_POLICY" into android-12.1 2022-07-31 21:09:42 +00:00
bigbiff 8c929ba02b makevars: add TW_USE_FSCRYPT_POLICY
Change-Id: I88ddfaf3777b1b6c5ef24cdeb918e4243a2ea9e0
2022-07-31 21:09:32 +00:00
Nebrassy f531918c2f Merge "kernel: Fix the check for official builds" into android-12.1 2022-07-30 14:25:20 +00:00
Tim Schumacher 0e721b6a4e kernel: Fix the check for official builds
The check for official builds now only affects the case where a prebuilt
kernel was actually used, not the case where a device builds a kernel
from source as normal.

The check has also been turned around so that it only fails the build if
it's actually an official build, not an unofficial one.

Change-Id: I1280b16b90589742c2abe7f3f6f5975a3aaeea03
2022-07-30 14:25:10 +00:00
Nebrassy a811a5bd19 Merge "kernel: Add TARGET_FORCE_PREBUILT_KERNEL flag" into android-12.1 2022-07-30 14:24:35 +00:00
Sebastiano Barezzi 9d4bb8e43c kernel: Add TARGET_FORCE_PREBUILT_KERNEL flag
* TARGET_FORCE_PREBUILT_KERNEL should be useful when you don't have ready kernel sources (OEM releasing broken sources or releasing them lately)
* It lets you use kernel sources for userspace generated headers (generated_kernel_headers) while keeping using prebuilt kernel
* Keep in mind that generated kernel headers may not align with the ABI of kernel you're including
* This commit also partially revert commit a836d79, where TARGET_KERNEL_SOURCE would have been unset if TARGET_PREBUILT_KERNEL was defined (we already check in kernel.mk if kernel sources are present anyway)

Change-Id: I84acae890dabb5b9dbd48143ad58f6420c0cef75
2022-07-30 14:24:30 +00:00
Nebrassy cd1c21c4ae Merge "Revert "Revert "kernel: fix KERNEL_TOOLCHAIN_PATH_gcc and usage""" into android-12.1 2022-07-30 14:24:19 +00:00
Alessandro Astone c84395eada Revert "Revert "kernel: fix KERNEL_TOOLCHAIN_PATH_gcc and usage""
The fix was correct...

This reverts commit 168fd231b65f3bd575529984f552354f4c5e3e8b.

Change-Id: If550fd44f32b801553b8ac23cb2a91d3f29df557
2022-07-30 14:24:09 +00:00
Nebrassy 99ceb62934 Merge "lineage: config: Make LLVM kernel compile the default" into android-12.1 2022-07-30 14:23:53 +00:00
Alexander Koskovich ea442ffb45 lineage: config: Make LLVM kernel compile the default
* GCC was deprecated awhile ago, the large majority
   of devices should now be using this. Clang should
   be opt out as opposed to opt in.

Change-Id: Ie388aff8eca189663f2f615f7d059e47eaf2dce3
2022-07-30 14:23:42 +00:00
bigbiff 7a23f9e986 Merge "envsetup: Import cout() function from LineageOS" into android-12.1 2022-07-29 13:02:24 +00:00
me-cafebabe 4900ceb008 envsetup: Import cout() function from LineageOS
From commit 3952f6cb0d701223f0b60a52c9f10554a898e564 "Import CM build additions"

Change-Id: I0aaa1fde311fe7e477dde7e139ea37548429e5bb
2022-07-29 20:55:32 +08:00
Alexander Winkowski 73c3867f21 makevars: Add TW_FRAMERATE
Change-Id: I907b52cf2629bf3e2d9de6a78047dd8f51ce1fff
2022-06-25 18:59:04 +00:00
bigbiff 17c8ca6f58 Merge "soong: Add TARGET_LEGACY_HW_DISK_ENCRYPTION conditional" into android-12.1 2022-06-21 23:19:14 +00:00
Nolen Johnson 0e23dae5b8 soong: Add TARGET_LEGACY_HW_DISK_ENCRYPTION conditional
[cafebabe: Move to TWRP soong config namespace]

Change-Id: I2c67fe632d415353273839493a86cdd75bd93b23
2022-06-21 23:19:08 +00:00
bigbiff 32a95a6c97 Merge "soong: Allow to specify device specific cryptfs_hw module" into android-12.1 2022-06-21 23:18:40 +00:00
me-cafebabe bf884c9089 soong: Allow to specify device specific cryptfs_hw module
Change-Id: Ia0a00afd6952caadfcf0f276277569510faba7b6
2022-06-21 23:18:27 +00:00
bigbiff d5e5381746 Merge "soong: Import HW FDE configurations from LineageOS" into android-12.1 2022-06-21 23:18:05 +00:00
me-cafebabe b86f764f97 soong: Import HW FDE configurations from LineageOS
Part of this commit https://github.com/LineageOS/android_vendor_lineage/commit/a98d12f8e328334c4db0796f289d8ce95d36eb59

Change-Id: Ie894712a7ccf290120c2e90e0502b5952b093e63
Co-authored-by: Pig <pig.priv@gmail.com>
2022-06-12 20:29:29 +08:00
bigbiff 2ed91d7afb Merge "twrp-depmod: only run when TW_LOAD_VENDOR_MODULES is set (2/2)" into android-12.1 2022-05-28 17:48:06 +00:00
Captain Throwback 5a109b76f3 twrp-depmod: only run when TW_LOAD_VENDOR_MODULES is set (2/2)
Change-Id: Id9519c8fb38c7033eb1b34b70f97051e04cb5647
2022-05-28 17:47:57 +00:00
bigbiff 5aa96d0ee6 Merge "add twrpfastboot=1 to GENERIC_KERNEL_CMDLINE for all vendor_boot devices" into android-12.1 2022-05-28 14:03:40 +00:00
nebrassy 8364cb56be add twrpfastboot=1 to GENERIC_KERNEL_CMDLINE for all vendor_boot devices
Change-Id: Ic9844cb1f1cf0869d06b96a64b6e9dc713ba34e5
2022-05-28 14:03:29 +00:00
captainthrowback d8454ba98e Merge "roomservice: update default branch to 12.1" into android-12.1 2022-04-10 21:08:10 +00:00
Captain Throwback 23d2be09f5 roomservice: update default branch to 12.1
Change-Id: I3431fa191de60889b810061618419a88f4c88ef9
2022-04-10 17:03:56 -04:00
Nebrassy dec30d751e Merge changes I400987b5,I95a1050a into android-12
* changes:
  Update roomservice from PixelExperience
  build: Add support of generating kernel includes for prebuilt kernels
2021-11-29 14:35:05 +00:00
nebrassy a4cdcd264a Update roomservice from PixelExperience
https: //github.com/PixelExperience/vendor_aosp/commits/eleven/build/tools/roomservice.py

adapt to TeamWin repo structure

Change-Id: I400987b5ce6e4042a0c799d95633c2beecde7dcf
2021-11-29 13:07:47 +01:00
XiNGRZ 56e71a1ca7 build: Add support of generating kernel includes for prebuilt kernels
For prebuilt kernels, point TARGET_KERNEL_HEADERS_SOURCE to the dummy
kernel source used to generate headers for HALs.

Change-Id: I95a1050a7e0650faac112724b7bd6a300cdb6e4a
2021-11-29 13:05:55 +01:00
bigbiff 5db767565b Merge "modify logic for including cmdline for android 12" into android-12 2021-11-14 18:48:02 +00:00
nebrassy 090703a7b3 modify logic for including cmdline for android 12
Change-Id: I3ae1d36f3d292f0a2482a77d5c4584997990c8b3
2021-11-14 18:47:54 +00:00