Commit Graph

1284 Commits

Author SHA1 Message Date
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
Elliott Hughes c049163234 Add an alternate screen for viewing recovery logs.
This makes it easier to go back and forth without losing current output.

Also make the display more like regular more(1).

Bug: http://b/20834540
Change-Id: Icc5703e9c8a378cc7072d8ebb79e34451267ee1b
2015-05-06 21:17:05 -07:00
Tao Bao 7ff339ea1b Merge "uncrypt: Switch to C++" 2015-05-06 19:21:41 +00:00
Tao Bao 381f455cac uncrypt: Switch to C++
Also apply some trivial changes like int -> bool and clean-ups.

Change-Id: Ic55fc8b82d7e91b321f69d10175be23d5c04eb92
2015-05-06 11:43:11 -07:00
Tao Bao aeb980bd89 Merge "uncrypt: package on non-data partition should follow the right path" 2015-05-06 01:18:11 +00:00
Tao Bao fb4ccef1df uncrypt: package on non-data partition should follow the right path
Fix the accidental change of behavior in [1]. OTA packages not on /data
partition should still go through the path that has validity checks and
wipe_misc() steps.

[1]: commit eaf33654c1.

Change-Id: Ice9a049f6259cd2368d2fb95a991f8a6a0120bdd
2015-05-05 17:51:28 -07:00
Elliott Hughes 41c7ef5400 Merge "Track adb_thread_create API change." 2015-05-05 21:40:47 +00:00
Elliott Hughes 921431ffc0 Track adb_thread_create API change.
Change-Id: Ia3f30f3ba85c0246d4b667fb7723cfcdce299d4a
2015-05-05 14:37:53 -07:00
Tao Bao c7f64fdf08 Merge "Keep multiple kernel logs" 2015-05-05 21:20:47 +00:00
Tao Bao bef39710ff Keep multiple kernel logs
Currently we are keeping one copy of the kernel log (LAST_KMSG_FILE).
This CL changes to keep up to KEEP_LOG_COUNT copies for kernel logs.

Bug: http://b/18092237
Change-Id: I1bf5e230de3efd6a48a5b2ae5a34241cb4d9ca90
2015-05-05 14:09:29 -07:00
Tao Bao f8f8832179 Merge "Turn on text display for debuggable builds" 2015-05-04 17:05:20 +00:00
Tao Bao 785d22c88c Turn on text display for debuggable builds
For userdebug and eng builds, turn on the text display automatically
if no command is specified.

Bug: http://b/17489952
Change-Id: I3d42ba2848b968da12164ddfda915ca69dcecba1
2015-05-04 09:59:29 -07:00
Elliott Hughes 59e1e3e78f Merge "Fix mips64 minadbd_test build." 2015-05-02 05:39:07 +00:00
Elliott Hughes dbb20c4863 Fix mips64 minadbd_test build.
Looks like the mips64 linker isn't as good as the others at GCing
unused stuff, which means it needs libcutils.

Change-Id: I5f768e44514350fb81e5360351db3e9cc4201702
2015-05-01 22:29:01 -07:00
Elliott Hughes 6bc2d538ae Merge "Move minadb over to new API." 2015-05-02 00:34:42 +00:00
Elliott Hughes 30cea3dcaf Merge "Fix minadb_test build breakage." 2015-05-02 00:26:00 +00:00
Elliott Hughes 3e7d82c621 Fix minadb_test build breakage.
Change-Id: I98bb900debb7d7dd57d3f8f84d605163ec192b03
2015-05-01 17:25:24 -07:00
Elliott Hughes 4039933c62 Move minadb over to new API.
Change-Id: I889bcf2222245c7665287513669cae8831e37081
2015-05-01 17:07:44 -07:00
Elliott Hughes 34c7731a0b Merge "Check all lseek calls succeed." 2015-04-30 04:11:41 +00:00
Elliott Hughes 7bad7c4646 Check all lseek calls succeed.
Also add missing TEMP_FAILURE_RETRYs on read, write, and lseek.

Bug: http://b/20625546
Change-Id: I03b198e11c1921b35518ee2dd005a7cfcf4fd94b
2015-04-29 17:46:43 -07:00
Elliott Hughes 8c389e9c76 Merge "Stop using adb_strtok, and check argument validity." 2015-04-28 17:52:17 +00:00
Elliott Hughes ba45ddf37c Stop using adb_strtok, and check argument validity.
Change-Id: I323ffda71b82cc939aed446f9c9fb86ca78df153
2015-04-28 09:40:19 -07:00
Elliott Hughes 6725ebc7b4 Merge "Revert "Revert "init re-execs to set its security context now.""" 2015-04-24 20:29:34 +00:00
Elliott Hughes 6f76dd58f4 Revert "Revert "init re-execs to set its security context now.""
This reverts commit c819dbe95b.

Bug: http://b/19702273
Change-Id: I5c75b148a12e644dd247a4df4f67dc9b4b9ff8cf
2015-04-24 12:42:46 -07:00
Nick Kralevich c690332c5e Merge "Revert "init re-execs to set its security context now."" 2015-04-24 16:59:11 +00:00
Nick Kralevich c819dbe95b Revert "init re-execs to set its security context now."
shamu isn't booting now

This reverts commit c57453d537.

Change-Id: I8efbf6260f5fcf983e5056fac6d03916415b944e
2015-04-24 16:58:33 +00:00
Elliott Hughes 38a82cace5 Merge "init re-execs to set its security context now." 2015-04-24 03:27:53 +00:00
Elliott Hughes c57453d537 init re-execs to set its security context now.
Change-Id: I0a014f8dddfe775159903b5d6fa632733fef692c
2015-04-23 20:26:56 -07:00
Sami Tolvanen 0de2351e6a Merge "Don't remove existing explicitly stashed blocks" 2015-04-17 16:54:34 +00:00
Sami Tolvanen 43b748f254 Don't remove existing explicitly stashed blocks
When automatically stashing overlapping blocks, should the stash
file already exist due to an explicit stash command, it's not safe
to remove the stash file after the command has completed.

Note that it is safe to assume that the stash file will remain in
place during the execution of the next command, so we don't have
take other measures to preserve overlapping blocks.

The stash file itself will be removed by a free command when it's
no longer needed.

Bug: 20297065
Change-Id: I8ff1a798b94086adff183c5aac03260eb947ae2c
2015-04-17 13:07:08 +01:00
Tao Bao 4381767aa6 Merge "imgdiff: Avoid infinite loop if inflate fails" 2015-04-16 20:55:38 +00:00