Commit Graph

1314 Commits

Author SHA1 Message Date
Tao Bao
0b7dc1dfcd recovery: Use xxhdpi resources for 560dpi devices
Create a symbolic link to res-xxhdpi for res-560dpi. 560dpi devices
(like shamu) are currently using a fallback option of xhdpi (320dpi)
resources. Now they can get closer ones (480dpi), such as larger fonts
on UI screen.

Change-Id: I427c3091d7e9892d9a7a1886be6adca14c122b06
2015-06-24 18:59:23 +00:00
Elliott Hughes
719e4e5d9b Merge "Just use fstat in sysMapFile." 2015-06-24 00:34:45 +00:00
Elliott Hughes
f267dee1ca Just use fstat in sysMapFile.
Also turn on -Werror and remove a dead function.

Change-Id: I436f0a91c40e36db985190b3b98b0a4527cf0eeb
2015-06-23 12:31:02 -07:00
Elliott Hughes
ea13fe233e Merge "Allow sideloading without authentication." 2015-06-23 18:33:41 +00:00
Elliott Hughes
9813f5ba57 Allow sideloading without authentication.
Bug: http://b/22025550
Change-Id: I20f09ae442536f924f19ede0abf6a2bcc0a5cedf
2015-06-23 11:12:58 -07:00
Elliott Hughes
22ccc87a7d Merge "Unmount sdcard if no package file is selected." 2015-06-10 23:52:12 +00:00
Elliott Hughes
a1009c3468 Merge "Split WipeData into PreWipeData and PostWipeData." 2015-06-10 21:10:24 +00:00
Elliott Hughes
945548ef7b Split WipeData into PreWipeData and PostWipeData.
Bug: http://b/21760064
Change-Id: Idde268fe4d7e27586ca4469de16783f1ffdc5069
2015-06-10 14:09:31 -07:00
Sami Tolvanen
280cb6e90c Merge "Zero blocks before BLKDISCARD" 2015-06-10 18:11:13 +00:00
Sami Tolvanen
a3c75e3ea6 Zero blocks before BLKDISCARD
Due to observed BLKDISCARD flakiness, overwrite blocks that we want
to discard with zeros first to avoid later issues with dm-verity if
BLKDISCARD is not successful.

Bug: 20614277
Bug: 20881595
Change-Id: I4f6f2db39db990879ff10468c9db41606497bd6f
2015-06-10 17:09:48 +01:00
Sami Tolvanen
e6f6097a7d Merge "Revert "Zero blocks before BLKDISCARD"" 2015-06-10 15:58:28 +00:00
Sami Tolvanen
e82fa18d3d Revert "Zero blocks before BLKDISCARD"
This reverts commit 96392b97f6.

Change-Id: I77acc27158bad3cd8948390a3955197646a43a31
2015-06-10 15:58:12 +00:00
caozhiyuan
b4effb9807 Unmount sdcard if no package file is selected.
Change-Id: I12b4f880802135a98dbc11a19e74172a3a5ef921
2015-06-10 16:46:56 +08:00
Tao Bao
1a03b40090 Merge "uncrypt: Write status when it reboots to factory reset" 2015-06-10 00:43:16 +00:00
Tao Bao
2cf180f6cc Merge "Separate uncrypt into two modes" 2015-06-10 00:43:07 +00:00
Tao Bao
ac6aa7ede0 uncrypt: Write status when it reboots to factory reset
When it reboots into recovery for a factory reset, it still needs to
write the uncrypt status (-1) to the pipe.

Bug: 21511893
(cherry picked from commit 2c2cae8a4a)
Change-Id: Ia5a75c5edf3afbd916153da1b4de4db2f00d0209
2015-06-09 15:02:22 -07:00
Tao Bao
383b00d0e4 Separate uncrypt into two modes
uncrypt needs to be triggered to prepare the OTA package before
rebooting into the recovery. Separate uncrypt into two modes. In
mode 1, it uncrypts the OTA package, but will not reboot the
device. In mode 2, it wipes the /misc partition and reboots.

Needs matching changes in frameworks/base, system/core and
external/sepolicy to work properly.

Bug: 20012567
Bug: 20949086
(cherry picked from commit 158e11d673)
Change-Id: I349f6d368a0d6f6ee4332831c4cd4075a47426ff
2015-06-09 15:01:10 -07:00
Sami Tolvanen
69608fe754 Merge "Zero blocks before BLKDISCARD" 2015-06-09 21:17:20 +00:00
Sami Tolvanen
96392b97f6 Zero blocks before BLKDISCARD
Due to observed BLKDISCARD flakiness, overwrite blocks that we want
to discard with zeros first to avoid later issues with dm-verity if
BLKDISCARD is not successful.

Bug: 20614277
Bug: 20881595
Change-Id: I0280fe115b020dcab35f49041fb55b7f8e793da3
2015-06-09 21:57:06 +01:00
Tao Bao
3f9db6af3d Merge "recovery: Switch to clang" 2015-06-03 22:30:40 +00:00
Tao Bao
80e46e08de recovery: Switch to clang
And a few trival fixes to suppress warnings.

Change-Id: I38734b5f4434643e85feab25f4807b46a45d8d65
2015-06-03 11:30:03 -07:00
Tao Bao
227069d77f Merge "Fix build: fprintf without modifier" 2015-06-03 17:06:50 +00:00
Tao Bao
1eb9003b77 Fix build: fprintf without modifier
Change-Id: I66ae21a25a25fa3c70837bc54a7d406182d4cf37
2015-06-03 09:55:38 -07:00
Tao Bao
a69e608a52 Merge "Log update outputs in order" 2015-06-03 16:15:50 +00:00
Tao Bao
b6918c7c43 Log update outputs in order
Although stdout and stderr are both redirected to log file with no
buffering, we are seeing some outputs are mixed in random order.
This is because ui_print commands from the updater are passed to the
recovery binary via a pipe, which may interleave with other outputs
that go to stderr directly.

In recovery, adding ui::PrintOnScreenOnly() function to handle
ui_print command, which skips printing to stdout. Meanwhile, updater
prints the contents to stderr in addition to piping them to recovery.

Change-Id: Idda93ea940d2e23a0276bb8ead4aa70a3cb97700
2015-06-02 22:15:40 -07:00
Elliott Hughes
1441a9654f Merge "Really don't use TEMP_FAILURE_RETRY with close in recovery." 2015-05-29 18:02:57 +00:00
Tao Bao
74f5e0e09e Merge "Use f_bavail to calculate free space" 2015-05-29 06:21:07 +00:00
Elliott Hughes
b3ac676192 Really don't use TEMP_FAILURE_RETRY with close in recovery.
I missed one last time.

Bug: http://b/20501816
Change-Id: I9896ee2704237d61ee169f898680761e946e0a56
2015-05-28 23:06:17 -07:00
caozhiyuan
3b4977638f Use f_bavail to calculate free space
Failures are seen on devices with
Linux 3.10. And they are mainly due to this change:
https://lwn.net/Articles/546473/
The blocks reserved in this change is not the same thing as what we
think are reserved for common usage of root user. And this part is
included in free blocks but not in available blocks.

Change-Id: Ib29e12d775b86ef657c0af7fa7a944d2b1e12dc8
2015-05-29 13:32:49 +08:00
Sami Tolvanen
aa4df5c45b Merge "Handle BLKDISCARD failures" 2015-05-28 16:12:25 +00:00
Sami Tolvanen
cc2428c818 Handle BLKDISCARD failures
In the block updater, if BLKDISCARD fails, the error is silently
ignored and some of the blocks may not be erased. This means the
target partition will have inconsistent contents.

If the ioctl fails, return an error and abort the update.

Bug: 20614277
Change-Id: I33867ba9337c514de8ffae59f28584b285324067
2015-05-28 09:09:02 +01:00
Tao Bao
f272b9e777 Merge "Clean up the sleep()'s after poking init services" 2015-05-27 23:17:13 +00:00
Tao Bao
752386319c Clean up the sleep()'s after poking init services
Change-Id: I77564fe5c59e604f1377b278681b7d1bff53a77a
2015-05-27 14:48:56 -07:00
Tao Bao
73151b5101 Merge "recovery: change the way of rebooting when using power key combo" 2015-05-27 19:28:21 +00:00
Gaelle Nassiet
e5ce2a5a10 recovery: change the way of rebooting when using power key combo
The power key combo allow to reboot from recovery mode by pressing
power button 7 times in a row. It calls directly the function
android_reboot() and lead to permission denial errors because of SE
Linux rules enforcement.
The right way to reboot from recovery is to set the property
"sys.powerctl" and let init handle it.

Change-Id: Ic7b81e446c3ee13dfbad10cda13a6a1f93123b76
Signed-off-by: Gaelle Nassiet <gaellex.nassiet@intel.com>
2015-05-27 15:47:44 +02:00
Nick Kralevich
41928ce61d Merge "Revert "recovery: change the way of rebooting when using power key combo"" 2015-05-27 13:37:04 +00:00
Nick Kralevich
4e92ba4009 Revert "recovery: change the way of rebooting when using power key combo"
code doesn't compile:

  bootable/recovery/ui.cpp: In member function 'void RecoveryUI::ProcessKey(int, int)':
  bootable/recovery/ui.cpp:177:60: error: 'property_set' was not declared in this scope
                   property_set(ANDROID_RB_PROPERTY, "reboot,");
                                                            ^
  make: ***   [out/target/product/generic/obj/EXECUTABLES/recovery_intermediates/ui.o] Error 1

This reverts commit 074c1c2312.

Change-Id: I3e0a24279e202df29308ce41eaacc86bfde89e5a
2015-05-27 13:35:46 +00:00
Nick Kralevich
b48bdbeda0 Merge "recovery: change the way of rebooting when using power key combo" 2015-05-27 13:09:03 +00:00
Gaelle Nassiet
074c1c2312 recovery: change the way of rebooting when using power key combo
The power key combo allow to reboot from recovery mode by pressing
power button 7 times in a row. It calls directly the function
android_reboot() and lead to permission denial errors because of SE
Linux rules enforcement.
The right way to reboot from recovery is to set the property
"sys.powerctl" and let init handle it.

Change-Id: I5a6c3c49b27cef305815cef96da729390e19c9bc
Signed-off-by: Gaelle Nassiet <gaellex.nassiet@intel.com>
2015-05-27 15:03:06 +02:00
Dan Albert
a8cd96adee Merge "Stop using libstdc++." 2015-05-20 20:39:57 +00:00
Dan Albert
e49a9e527a Stop using libstdc++.
These are already getting libc++, so it isn't necessary. If any of the
other static libraries (such as adb) use new or delete from libc++,
there will be symbol collisions.

Change-Id: I55e43ec60006d3c2403122fa1174bde06f18e09f
2015-05-19 11:33:18 -07:00
Sami Tolvanen
6253753ab9 Merge "Add error and range checks to parse_range" 2015-05-18 08:08:54 +00:00
Elliott Hughes
cd7d9d8374 Merge "Don't use TEMP_FAILURE_RETRY on close in recovery." 2015-05-16 01:08:55 +00:00
Elliott Hughes
b47afedb42 Don't use TEMP_FAILURE_RETRY on close in recovery.
Bug: http://b/20501816
Change-Id: I35efcd8dcec7a6492ba70602d380d9980cdda31f
2015-05-15 16:19:20 -07:00
Sami Tolvanen
f2bac04e1b Add error and range checks to parse_range
Only trusted input is passed to parse_range, but check for invalid
input to catch possible problems in transfer lists.

Bug: 21033983
Bug: 21034030
Bug: 21034172
Bug: 21034406
Change-Id: Ia17537a2d23d5f701522fbc42ed38924e1ee3366
2015-05-15 18:48:28 +01:00
Elliott Hughes
3badd56326 Merge "init sets the default PATH itself, better." 2015-05-12 21:43:15 +00:00
Elliott Hughes
4fd3446b4e init sets the default PATH itself, better.
This fixes 'su' and 'strace' in the recovery image.

Change-Id: I83c2664d32a15da92bb6092fbdfc772184013c88
2015-05-12 14:35:31 -07:00
Dan Albert
3128176e7d Merge "Fix build following adb change." 2015-05-08 17:51:23 +00:00
Dan Albert
cc08a90cab Fix build following adb change.
Change-Id: I2e0fb7e880e205b0bca324ff53ffdb5df9e34baf
2015-05-08 10:50:54 -07:00
Elliott Hughes
77a2c8839f Merge "Add an alternate screen for viewing recovery logs." 2015-05-07 04:17:46 +00:00