Commit Graph

9577 Commits

Author SHA1 Message Date
Tao Bao 5393149d53 am d107e6dc: am a69e608a: Merge "Log update outputs in order"
* commit 'd107e6dc104dfb6e5043cedaf348f354f7cd46cc':
  Log update outputs in order
2015-06-03 18:36:16 +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 028d216c83 am 227069d7: Merge "Fix build: fprintf without modifier"
* commit '227069d77f90aa7965d4cd5ab4f4a5302194fc73':
  Fix build: fprintf without modifier
2015-06-03 17:17:50 +00: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 d107e6dc10 am a69e608a: Merge "Log update outputs in order"
* commit 'a69e608a521f7818cc0f17ba86710bd5b18137f2':
  Log update outputs in order
2015-06-03 16:28:46 +00: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
that c7b631b7a2 gui: set tw_file to the currently flashed file name without path
To allow themes to show more of the file name on narrow displays.

Change-Id: I4962eed5e4a01f73a3cde126f2ba56428209fccc
2015-06-01 23:36:57 +02:00
Tao Bao 497aef84d5 am 2c51ec95: am 02b64725: Merge "uncrypt: Write status when it reboots to factory reset" into mnc-dev
* commit '2c51ec953c434992ea4d64001a54ec08f8543984':
  uncrypt: Write status when it reboots to factory reset
2015-06-01 16:16:15 +00:00
Tao Bao 2c51ec953c am 02b64725: Merge "uncrypt: Write status when it reboots to factory reset" into mnc-dev
* commit '02b6472546b899ebc16029371eb75364059871d2':
  uncrypt: Write status when it reboots to factory reset
2015-06-01 16:03:51 +00:00
Elliott Hughes ae579dd5ce am 7132e792: am b5dabd25: Really don\'t use TEMP_FAILURE_RETRY with close in recovery.
* commit '7132e79266f827b5420f6a6df399e890e0501a62':
  Really don't use TEMP_FAILURE_RETRY with close in recovery.
2015-06-01 15:48:59 +00:00
Sami Tolvanen bf8c00ab59 am 07ec625a: am 92eea1bc: Handle BLKDISCARD failures
* commit '07ec625a61263ea760db93c106d966d4406fbc54':
  Handle BLKDISCARD failures
2015-06-01 15:48:59 +00:00
Elliott Hughes 7132e79266 am b5dabd25: Really don\'t use TEMP_FAILURE_RETRY with close in recovery.
* commit 'b5dabd25e1d04ce134837b49fbef889e511d4d35':
  Really don't use TEMP_FAILURE_RETRY with close in recovery.
2015-06-01 15:26:54 +00:00
Sami Tolvanen 07ec625a61 am 92eea1bc: Handle BLKDISCARD failures
* commit '92eea1bc414a7b6faedaf812c33ede17403fcaf7':
  Handle BLKDISCARD failures
2015-06-01 15:26:53 +00:00
Ethan Yonker 74db84e026 Fix double free crash during encrypted backups
Calling flush_libtar_buffer would inadvertantly set buffer_status
when no buffer is currently allocated. Later when we called
free_libtar_buffer, this would attempt to free the write_buffer
and cause a crash. This patch checks the value of buffer_status in
flush_libtar_buffer to prevent us from freeing the buffer when it
is not necessary.

Change-Id: Ic5b462fe5881be6e9c6fcc355b369bc90477f737
2015-06-01 09:55:04 -05:00
that 5267a21667 gui: move retainaspect handling to the resource ctors
LoadResources should only decide on the resource type,
everything else is handled by the resources themselves.

Change-Id: I30f68293960c23560979f650efc4393992cf5824
2015-06-01 03:03:28 +02:00
Agontuk a29361a8e6 Don't try to read temparature file if TW_NO_CPU_TEMP is set to true.
Otherwise, recovery log gets filled up with
"I:Cannot find file /sys/class/thermal/thermal_zone0/temp"

This also fixes build warnings due to duplicate definition of TW_NO_CPU_TEMP.

Change-Id: Ib7fdcd103d6684249c38c8b14ec85f2faba158f6
2015-06-01 02:56:19 +02:00
Ethan Yonker d6966f4426 Fix unable to uncheck the mount read only check box
Change-Id: I1bbc25df6f35f79549f1eb06feb4db9ec0475aa5
2015-05-30 14:52:21 -05:00
Tao Bao 02b6472546 Merge "uncrypt: Write status when it reboots to factory reset" into mnc-dev 2015-05-29 22:02:27 +00:00
Tao Bao 2c2cae8a4a 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
Change-Id: I1a725820f1e1875146e49b5a6f28af2fbf284fc7
2015-05-29 14:24:02 -07:00
Elliott Hughes cbff4f36eb am 8339bc67: am 5944bcd8: am 1441a965: Merge "Really don\'t use TEMP_FAILURE_RETRY with close in recovery."
* commit '8339bc672a0c5a31d286fb55ff22341d73efc119':
  Really don't use TEMP_FAILURE_RETRY with close in recovery.
2015-05-29 18:50:49 +00:00
Elliott Hughes 8339bc672a am 5944bcd8: am 1441a965: Merge "Really don\'t use TEMP_FAILURE_RETRY with close in recovery."
* commit '5944bcd8eba6f012c1439972c050a2dc874765ae':
  Really don't use TEMP_FAILURE_RETRY with close in recovery.
2015-05-29 18:30:30 +00:00
Elliott Hughes 5944bcd8eb am 1441a965: Merge "Really don\'t use TEMP_FAILURE_RETRY with close in recovery."
* commit '1441a9654feee7e32ec6b39b1992c27635feb50f':
  Really don't use TEMP_FAILURE_RETRY with close in recovery.
2015-05-29 18:16:47 +00:00
Elliott Hughes b5dabd25e1 Really don't use TEMP_FAILURE_RETRY with close in recovery.
I missed one last time.

Bug: http://b/20501816
Change-Id: I9896ee2704237d61ee169f898680761e946e0a56
(cherry picked from commit b3ac676192)
2015-05-29 11:03:44 -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
Xuefer 46bdc96815 remove useless memset and \n
fgets reads up to one byte less than size then with \0 at the end
adding \n after \0 is useless too

Change-Id: I7758d7a8f885bdde2b491a9cb75800f831d77c1f
2015-05-29 17:56:19 +02:00
ramsudharsan 8335324d2a minuitwrp: remove unused variable
Change-Id: I0beb3b349efd4f08491c92bb51c12caf3653cb73
Signed-off-by: ramsudharsan <ramsudharsanm@gmail.com>
2015-05-29 17:32:02 +02:00
Sami Tolvanen 92eea1bc41 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
(cherry picked from commit cc2428c818)
2015-05-29 09:02:14 +01:00
Tao Bao fe47833b09 am f827034f: am eec204be: am 74f5e0e0: Merge "Use f_bavail to calculate free space"
* commit 'f827034fe191b02fd25bd605cdb57816d023446a':
  Use f_bavail to calculate free space
2015-05-29 06:54:30 +00:00
Tao Bao f827034fe1 am eec204be: am 74f5e0e0: Merge "Use f_bavail to calculate free space"
* commit 'eec204be63ed115f6a8fec941224fad3d5b6a720':
  Use f_bavail to calculate free space
2015-05-29 06:41:07 +00:00
Tao Bao eec204be63 am 74f5e0e0: Merge "Use f_bavail to calculate free space"
* commit '74f5e0e09e16ba38d007fdc4aeede20129c817bc':
  Use f_bavail to calculate free space
2015-05-29 06:32:54 +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
Tao Bao 921e3c3104 am 127ab1fc: resolved conflicts for merge of 158e11d6 to mnc-dev-plus-aosp
* commit '127ab1fc2d6eab382d4464bc1b5b6cbd30bbc6d1':
  Separate uncrypt into two modes
2015-05-29 01:23:55 +00:00
Tao Bao 127ab1fc2d resolved conflicts for merge of 158e11d6 to mnc-dev-plus-aosp
Change-Id: I164cdc4915b6ca1b623b206c0ccbb12e0fc3fa77
2015-05-28 16:25:37 -07:00
Tao Bao 158e11d673 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
Change-Id: I14d25cb62770dd405cb56824d05d649c3a94f315
2015-05-28 14:44:52 -07:00
Sami Tolvanen dfcaf47351 am e938682e: am cd391c23: am aa4df5c4: Merge "Handle BLKDISCARD failures"
* commit 'e938682e0ed9bc326b940bba31dc0c8472e81848':
  Handle BLKDISCARD failures
2015-05-28 17:39:33 +00:00
Sami Tolvanen e938682e0e am cd391c23: am aa4df5c4: Merge "Handle BLKDISCARD failures"
* commit 'cd391c23882cfa876c06fdf26146469489f41e8b':
  Handle BLKDISCARD failures
2015-05-28 17:19:37 +00:00
Sami Tolvanen cd391c2388 am aa4df5c4: Merge "Handle BLKDISCARD failures"
* commit 'aa4df5c45b99438282db3a94cb7682c480e0eccd':
  Handle BLKDISCARD failures
2015-05-28 16:21:04 +00:00
Sami Tolvanen aa4df5c45b Merge "Handle BLKDISCARD failures" 2015-05-28 16:12:25 +00:00
Ethan Yonker a2719156c2 Add resize2fs and ability to run resize2fs via GUI
Note: Only works on ext2/3/4 partitions. Only tested on ext4.

We can use this in some cases to resize the data partition if an
incorrect fstab caused recovery to not reserve the 16KB for a
crypto footer.

Sometimes the BoardConfig for a custom ROM does not have the
correct size for the system partition and if the ROM flashes a
raw system image, that image will not take up the full block
device. Running resize2fs can fix the size and may allow more
room in the system partition for customizations like busybox or
a larger gapps package.

Sometimes flashing a factory image may flash userdata with an
image with a file system that does not take up the full size of
the block device (e.g. factory images for the Nexus 6 will flash
userdata with a ~24GB userdata image, wasting ~30GB of space).
Using resize2fs we can easily fix this issue without having to do
a full format data.

Change-Id: I631f5c6f567bbc6a9241e5dd95f1e435820a1b13
2015-05-28 09:47:25 -05: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 0b78610085 am d026a28c: am 9a5e2a26: am f272b9e7: Merge "Clean up the sleep()\'s after poking init services"
* commit 'd026a28c22dfb15728b6db88d5b8e9b093de2fd7':
  Clean up the sleep()'s after poking init services
2015-05-28 00:09:06 +00:00
Tao Bao d026a28c22 am 9a5e2a26: am f272b9e7: Merge "Clean up the sleep()\'s after poking init services"
* commit '9a5e2a2611997d7803f079b8adb3535b6abc80fb':
  Clean up the sleep()'s after poking init services
2015-05-27 23:49:09 +00:00
Tao Bao f505e7035c am e6f54e74: am 7b126d77: am 73151b51: Merge "recovery: change the way of rebooting when using power key combo"
* commit 'e6f54e743a5919549431d28667df5c5bd4500e97':
  recovery: change the way of rebooting when using power key combo
2015-05-27 23:36:45 +00:00
Tao Bao 9a5e2a2611 am f272b9e7: Merge "Clean up the sleep()\'s after poking init services"
* commit 'f272b9e777de92f96b9298889bf145e40c5db2e3':
  Clean up the sleep()'s after poking init services
2015-05-27 23:35:47 +00:00
Tao Bao f272b9e777 Merge "Clean up the sleep()'s after poking init services" 2015-05-27 23:17:13 +00:00
Tao Bao e6f54e743a am 7b126d77: am 73151b51: Merge "recovery: change the way of rebooting when using power key combo"
* commit '7b126d77e85fce7f34f3888bfa34081d7d347b02':
  recovery: change the way of rebooting when using power key combo
2015-05-27 23:14:27 +00:00