Commit Graph

139 Commits

Author SHA1 Message Date
bigbiff
aed1bdfe59 get_args: process /data/cache/command
Change-Id: I744cdc5a72f53fd1224de242e30ff261e6104900
2021-09-25 20:52:58 +00:00
Captain Throwback
b326961682 etc: include hwservicemanager for TW_INCLUDE_CRYPTO
A recent change removed the inclusion of hwservicemanager
and vndservicemanager with only this flag

Change-Id: I9b8cb05a6bd053b794599167bcc8bf0591b2e184
2021-09-04 15:06:54 +00:00
Mohd Faraz
29cab7f160 etc: vndservice and hwservice managers are required by other hals
* Export vendor paths for boot-hal as some libs are present in vendor
 * hwservicemanager and vndservicemanager are also required by health hal amd boot hal

Change-Id: I9017e0692cdb917db86629588726ba11eafd1e81
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2021-08-28 23:54:49 +00:00
Captain Throwback
2bf400c47c etc: don't start both health-hal services automatically
should be started in device tree init.recovery.rc

Change-Id: Ie2711a8053d0ad9dacd6d337f7a1902c9320334f
2021-08-28 21:43:18 +00:00
bigbiff
5c083cc3f0 super partition: include lpdump utility
Change-Id: Ifaac3b660ae3d46d9f1589470dcf6fd7c21b8ef8
2021-06-25 22:45:22 +00:00
bigbiff
477006a4a0 fastboot: allow device to start required healthd and boot-hal services
Change-Id: Iac1d20ce26d49e7a99071c968d8c8e654e5ff1c6
2021-06-25 18:36:36 -04:00
bigbiff
2e344ab7fb fscrypt: integrate v1 processing into TWRP
Change-Id: I3bf9c14b818f9c3e0570c44c82bf0769fcec907f
2021-05-18 20:35:53 -04:00
bigbiff
a957f078be FsCrypt update: support fscrypt policies v1 and v2
This patchset introduces support decryption for Android 11.

In this update we deprecate ext4crypt. To specify the
policy version to use, use TW_USE_FSCRYPT_POLICY := 1 or
TW_USE_FSCRYPT_POLICY := 2. By default policy version will
be set to 2 if this variable is omitted.

Change-Id: I62a29c1bef36c259ec4b11259f71be613d20a112
2021-05-18 20:35:51 -04:00
nebrassy
9c1709b963 Health hal 2.1
Change-Id: I58df03c469c213e58c7152430d6f15de80d00f77
2021-05-04 11:47:45 +02:00
bigbiff
e2eae2fe74 boot-hal: add 1.1 HAL to TWRP
Change-Id: I51678c96f522e67c3681e404240dd98f6b07994e
2021-04-24 23:18:28 +00:00
bigbiff
98203ceebe nano: make executables class
Also fix bad separator in Android.mk

Change-Id: I756f8ac42ccb604f191e9439cd7978cfa0ce0995
2021-03-03 20:39:52 -05:00
nebrassy
5078965777 Include nano in TWRP by default
Use 'TW_EXCLUDE_NANO := true' to exclude from build

Will be excluded by default if 'TW_OEM_BUILD := true' is set

Change-Id: I812399ef9f3f5d3c7d4baf981924d49255c16e5a
2021-03-03 19:39:45 -05:00
nebrassy
cd79c90d27 mount binderfs
Change-Id: Ic32176d1c0150031982ec3d50e9ff0e8ac4fe517
2021-01-19 09:55:04 +01:00
bigbiff
91bd7a7ff1 adb: get adb working and cleanup pixelflinger
- update recovery init.rc
- add libdl bootstrap
- cleanup libpixelflinger import
- logd and adbd permissive for now
2021-01-03 17:36:52 -05:00
bigbiff
673c7ae01e Merge tag 'android-11.0.0_r16' into android-10.0
Android 11.0.0 release 16 - twrp bringup patch
2020-12-16 19:06:18 -05:00
bigbiff
1f9e4847ce twrpinstall: create library for twrpinstall
This library will need to mirror AOSP for any changes to installing
packages. The library has been separated out in order to make importing
updates from AOSP into the TWRP project.

twinstall.cpp has been removed from the recovery binary and added to
this library. It has been refactored for libziparchive.

Sideload has been reworked to use the newer methods from AOSP on
flashing packages through adb sideload.

We are also removing old libraries for adb and verifier.

Lastly before flashing a zip or image, we want to unlock block devices
for writing so that when an OTA is flashed to the inactive slot,
the flash will succeed.

Change-Id: I6d8702fc9031ffaf9f666b4ba375dc7d9362e473
2020-12-02 13:43:42 -05:00
Captain Throwback
ddb0a40afd TWRP_REQUIRED_MODULES: add more criteria to exclude packages
Only include hwservicemanager if CRYPTO flag is set and
only include servicemanager if FBE is included.

Only include health-hal if device uses dynamic partitions

Change-Id: I056d0246e406dc9f00bda65247455741ef986a37
2020-11-11 19:00:36 +00:00
Captain Throwback
49df5475db init: include more services in TWRP by default
vndservicemanager should be included with crypto support

boot and health services are needed for bootctrl and fastbootd

hwservicemanager and servicemanager should be included
regardless of crypto status

Change-Id: Ie76dac11b733c4549c2d55301cf614fe82905884
2020-10-23 21:55:18 +00:00
Captain Throwback
bff7617e2f init.rc: move "start logd" to logd rc file
Change-Id: I1ff512206a60056eb96f25e83db417382c9a44e5
2020-10-14 23:24:50 +00:00
Captain Throwback
ca2ba939c9 init: add services to build
hwservicemanager and servicemanager are needed for decryption
and fastbootd in TWRP. Include these services by default since
they are standard Android services and independent of device
tree or SoC.

Change-Id: Id0ec73d9a6ca0289c7b4f67e9dcf541b2157c04e
2020-10-14 12:55:58 -04:00
Captain Throwback
82c6693ec8 init.rc: clean up redundant "on fs" section
Change-Id: Ie5340ce0d31383117602df907ee3cc0b8ec7100c
2020-10-13 15:10:59 -04:00
bigbiff
ad58e1bfae repack: move sbin to /system ramdisk and update repacking
for android-10

This will support updating the ramdisk to a different
compression format and co-exist with magisk.

We are also cleaning up and removing non android-10
api makefile actions.

We are also moving twrp repacking to its own class. We
check the new ramdisk format and if it's different
we have magisk compress using the new ramdisk format.

Change-Id: I770030aae7797e75817178b2f0fccd9f39dc23af
2020-09-08 10:08:33 -04:00
bigbiff
437b93a087 Merge remote-tracking branch 'origin/android-9.0' into android-10.0
Change-Id: Ie850f431f0d2c39c86b9c10701676a24770ab447
2020-05-10 20:06:41 -04:00
bigbiff
63d7add7cf logd: make logd run and relink logcat
Change-Id: I5a2984ea2649bebd923d42e6b984856b36b18fbd
2020-03-31 18:00:59 -04:00
Andreas Schneider
a4e510ee54 init: ueventd already needs /acct
Change-Id: Ifae7078aedc1a520ee003160fb17c8893041cb09
(cherry picked from commit ec350e9d0d)
2020-03-30 17:06:17 -04:00
Andreas Schneider
ec350e9d0d init: ueventd already needs /acct
Change-Id: Ifae7078aedc1a520ee003160fb17c8893041cb09
2020-03-30 21:02:48 +00:00
theimpulson
d95dcd207c bootable: Move to optional tags everywhere
FAILED:
bootable/recovery/etc/Android.mk: error: init.recovery.ldconfig.rc: LOCAL_MODULE_TAGS := eng is obsolete. See https://android.googlesource.com/platform/build/+/master/Changes.md#LOCAL_MODULE_TAGS
build/make/core/base_rules.mk:171: error: done.
18:29:38 ckati failed with: exit status 1

Change-Id: I056f019aa3249c185b808140bcef45a4777d21b3
Signed-off-by: theimpulson <aayushgupta219@gmail.com>
2020-03-23 15:09:31 -04:00
bigbiff
d58ba18272 AOSP10 TWRP Merge: fix conflicts and update libraries needed
This allows flame to boot TWRP. Still will need to work on
super partition for vendor and system access.

The plan will be to cherry-pick any updates to android-9.0
through gerrit.twrp.me to this branch as a WIP.
2020-03-23 11:18:29 -04:00
bigbiff
26d5d5f0b9 Merge tag 'android-10.0.0_r25' into aosp10-4
Android 10.0.0 release 25
2020-03-23 09:56:16 -04:00
Kiyoung Kim
ea2b683f6e Do not execute linkerconfig from recovery
Linkerconfig binary itself should be built as static, so size of
executable is hard to be reduced. However, this used lots of space from
recovery so only small space left in it. To avoid this linker config
from recovery should be generated within build time and use prebuilt
one. Prebuilt ld.config.txt will be located under /system/etc as before,
and init will copy the file into /linkerconfig so we can use same
location for both recovery and normal boot.

Bug: 146384333
Test: m -j passed && crosshatch bootloader worked with this change
Change-Id: I96300f1c8301167234787274820086a4c6ea0e6e
2019-12-17 15:05:54 +09:00
Kiyoung Kim
3a88a1748b Generate linker config from recovery init
Generate linker config from recovery init to be used from recovery
processes.

Bug: 139638519
Test: Tested from crosshatch
Change-Id: I777a8baf08254b07375b8039bb252864637e29e7
2019-12-12 14:40:37 +09:00
Tom Cherry
8834b4ea0a Merge "Fixed typo during stopping fastboot" 2019-11-13 20:18:22 +00:00
Dmytro Prokopchuk
df35405a4b Fixed typo during stopping fastboot
Change-Id: I0a589d068807e255654c7e62831423f944b5cdc3
Signed-off-by: Dmytro Prokopchuk <dmytro.prokopchuk@globallogic.com>
2019-11-13 13:30:17 +02:00
Tom Cherry
bcd3f35462 Move init and ueventd scripts from / to /system/etc
There is no reason for these scripts to continue to exist in /, when
they are better suited for /system/etc.  There are problems keeping
them at / as well, particularly that they cannot be updated with
overlayfs.

Bug: 131087886
Bug: 140313207
Test: build/boot + boot to recovery
Merged-In: I1fb6690d4302a1884d8521c21a9754b2ca710d5a
Change-Id: I1fb6690d4302a1884d8521c21a9754b2ca710d5a
2019-11-07 11:29:06 -08:00
Tom Cherry
0a19ef8cb6 Stop setting usb config from recovery init script
We used to set sys.usb.config to adb in the init script. And the purpose
is to start adbd. This is a duplicate of code because we always check and
reset the usb config in recovery_main.

Test: check adbd starts
Change-Id: I6e2842ff8aebf6ccf3bd3f2ae85323899a2b9de4
2019-11-06 23:04:36 -08:00
Tianjie Xu
7d5c341962 Start adbd in user mode if bootloader is unlocked
During automatic tests, we sometimes want to reboot the device out of
the rescue party remotely. And per http://go/recovery-adb-access, one
option is to start adbd in user build if the device has an unlocked
bootloader. This should not add more surface of attack. Because verified
boot is off with the unlocked bootloader, and the user can always flash
a custom recovery image that always starts adbd.

Bug: 141247819
Test: check adbd doesn't start in user build, unlock bootloader, and
check adbd starts.

Change-Id: I851746245f862cb4dfb01e6c3ad035f2c9f9ccec
2019-10-30 10:26:56 -07:00
Captain Throwback
170964d5bb Add ld.config.txt for Android 8.x+ trees
- Fixes the ld.config.txt errors in recovery log which may prevent
  decryption and shell commands from working properly

Change-Id: I0e057525cdda39e8ac10115d37e2cb882b9c4844
2019-10-21 19:46:30 -04:00
Captain Throwback
986130473e Clean up logd init file
- Remove unnecessary services

Change-Id: I4c9227cd49eeef1176d321ae61ca3ca8c3f54596
2019-04-29 17:45:31 -04:00
big biff
6b9ee0e0b2 Merge "Revert "Fix ld.config.txt errors on Android 8.1 system root devices"" into android-9.0 2019-03-15 00:40:46 +01:00
Captain Throwback
5ab596451a mksh: add mkshrc when using TW_USE_TOOLBOX
Fixes broken shell prompt in Terminal and adb shell

Before: https://del.dog/7vphlkc
After: https://del.dog/vhkjgo8

Add as prebuilt with suffix "_twrp" to avoid conflict
with original mkshrc and rename via POST_INSTALL_CMD

Prebuilt version adjusts TMPDIR variable from
"/data/local/tmp" to "/tmp" for TWRP

Change-Id: I42a1b2a8c114f66dbe659c07485f1dfae8a5d314
2019-03-07 18:34:15 +01:00
Captain Throwback
5cb78dc280 Revert "Fix ld.config.txt errors on Android 8.1 system root devices"
This reverts commit 1ccdefab79.

Reason for revert: Causes delay during boot resulting in failed decryption on FDE devices. Recommend having device maintainers specify this variable manually in rc file and include actual ld.config.txt (or placeholder) in ramdisk directly.

Change-Id: Ib2410675396b38522d690c6057057d164cc0cff2
2019-01-22 19:28:02 +01:00
Tao Bao
a89c21c9e5 Start charger at /system/bin/charger.
Bug: 114042635
Test: Boot into recovery mode on walleye. Check that charger keeps
      working.
Change-Id: I818536a6d261c860dd6f6c08774c2355e14f4236
2018-09-14 15:52:29 -07:00
Hridya Valsaraju
e4ef453914 Fix sideload for user devices by adding a new sideload config
Bug: 113563995
Test: Tested the 'adb sideload' command on marlin user/userdebug builds
and walleye user/userdebug builds

Change-Id: I00d565547b85f2db87012e4a08316609e03395ac
2018-09-07 15:02:43 -07:00
Ethan Yonker
58f2132bc3 Merge AOSP android-9.0.0_r3
Fix conflicts and make it build in 5.1, 6.0, 7.1, 8.1, and 9.0

Change-Id: Ida0a64c29ff27d339b7f42a18d820930964ac6e4
2018-08-24 11:17:39 -05:00
Elliott Hughes
a4495b5ee2 Add /dev/stdin, /dev/stdout, and /dev/stderr in recovery too.
Now these are in the main image, there's some chance of code assuming
they're present in recovery too (or command-line users using them out
of habit).

Bug: http://b/31824379
Test: builds
Change-Id: Ia19272cd1959685765099f3e15d1d1e63babd279
2018-08-23 08:31:59 -07:00
Hridya Valsaraju
20c81b308d Add fastboot mode to recovery
Add a fastboot mode to recovery that can be
entered with command line args or with the ui.

Add usb property triggers to switch between
fastboot and adb configurations.

Allow switching between fastboot and adb through
usb commands by opening a unix socket. adbd/fastbootd
writes to this socket, which interrupts the ui and
switches to the new mode.

Test: Use fastboot mode
Bug: 78793464
Change-Id: I7891bb84427ec734a21a872036629b95ab3fb13c
2018-08-13 21:18:18 -07:00
Tom Cherry
aceb244401 Merge "ueventd is now at /system/bin/ueventd" 2018-08-07 16:08:55 +00:00
Ethan Yonker
1ccdefab79 Fix ld.config.txt errors on Android 8.1 system root devices
Change-Id: I17dcb8a2d77519799292d1c0fb5d94de21d7e6cb
2018-07-27 19:02:21 +02:00
Hridya Valsaraju
cfb3c92302 Move recovery from /sbin to /system/bin
Executables should be in /system/bin
rather than sbin.

Bug: 78793464
Test: boot into recovery, try adb sideload
Change-Id: I194589119a099d29e56b0648f0906a5ae2aa6770
2018-07-26 17:12:40 -07:00
Tom Cherry
b2fd16841a ueventd is now at /system/bin/ueventd
Bug: 79758715
Test: boot into recovery
Change-Id: I9bf47b2487993e275419befdc9718cc0ac8d3ea7
2018-07-24 15:58:29 -07:00