Commit graph

675 commits

Author SHA1 Message Date
Kenny Root
dd92a4d625 am 58c60900: Merge "verifier: update to support certificates using SHA-256"
* commit '58c60900ac3682fab08f64373bdd1020713b48f7':
  verifier: update to support certificates using SHA-256
2013-09-25 10:19:33 -07:00
Kenny Root
58c60900ac Merge "verifier: update to support certificates using SHA-256" 2013-09-25 17:14:59 +00:00
Doug Zongker
30362a6ad1 verifier: update to support certificates using SHA-256
(cherry picked from commit bac7fba027)

Change-Id: I01c38d7fea088622a8b0bbf2c833fa2d969417af
2013-09-25 10:11:46 -07:00
Nick Kralevich
46ab1b6138 updater: Delete dead code
set_perm and set_perm_recursive are no longer used. Delete.

(cherry picked from commit 08ef9a9570)

Change-Id: I1bcc90ae19af9df4f0705496c5876987159f75ac
2013-09-17 10:20:45 -07:00
The Android Automerger
c287321e9c merge in klp-release history after reset to klp-dev 2013-09-12 06:00:47 -07:00
Doug Zongker
1306a7effa am cc2958fd: fix secure adb in recovery
* commit 'cc2958fd7f32f79d1a034eee005e04afeb310a87':
  fix secure adb in recovery
2013-09-11 13:39:03 -07:00
Doug Zongker
cc2958fd7f fix secure adb in recovery
Recovery's init.rc was missing a line (added to the main system's
init.rc in change Ic97fd464440ff4a29fc9da7ad15949ac5215ade3) is
required for secure adb to work.

Change-Id: Id79b94d2abb4cbe3cca7cabeb4bc5faf7205e56b
2013-09-11 13:24:32 -07:00
Nick Kralevich
d456944f02 Don't apply permission changes to symlink.
Bug: 10183961
Bug: 10186213
Bug: 8985290
Change-Id: I57cb14af59682c5f25f1e091564548bdbf20f74e
2013-09-10 17:13:23 -07:00
Nick Kralevich
af677d786e am e461251e: Don\'t apply permission changes to symlink.
* commit 'e461251e2caa5561cf6a315bffaebfd4eb896b1d':
  Don't apply permission changes to symlink.
2013-09-10 15:50:08 -07:00
Nick Kralevich
e461251e2c Don't apply permission changes to symlink.
Bug: 10183961
Bug: 10186213
Bug: 8985290
Change-Id: I57cb14af59682c5f25f1e091564548bdbf20f74e
2013-09-10 15:34:19 -07:00
The Android Automerger
c4a3a4bcc8 merge in klp-release history after reset to klp-dev 2013-09-10 14:28:02 -07:00
Nick Kralevich
cc421662d7 am 5dbdef0e: updater: introduce and set_metadata and set_metadata_recursive
* commit '5dbdef0e5b8a841fadc64d016d10ce81a962b284':
  updater: introduce and set_metadata and set_metadata_recursive
2013-09-10 11:18:24 -07:00
Nick Kralevich
5ae88e8998 am 3328e3bc: Revert "Update OTA installer to understand SELinux filesystem labels"
* commit '3328e3bc81161c2a57ea94d304162276facdd826':
  Revert "Update OTA installer to understand SELinux filesystem labels"
2013-09-10 11:18:24 -07:00
Nick Kralevich
5dbdef0e5b updater: introduce and set_metadata and set_metadata_recursive
Introduce two new updater functions:

* set_metadata
* set_metadata_recursive

Long term, these functions are intended to be more flexible replacements
for the following methods:

* set_perm
* set_perm_recursive

Usage:

  set_metadata("filename", "key1", "value1", "key2", "value2", ...)
  set_metadata_recursive("dirname", "key1", "value1", "key2", "value2", ...)

Description:

set_metadata() and set_metadata_recursive() set the attributes on a file/directory
according to the key/value pairs provided. Today, the following keys are
supported:

* uid
* gid
* mode (set_perm_extd only)
* fmode (set_perm_extd_recursive only)
* dmode (set_perm_extd_recursive only)
* selabel
* capabilities

Unknown keys are logged as warnings, but are not fatal errors.

Examples:

* set_metadata("/system/bin/netcfg", "selabel", "u:object_r:system_file:s0");

This sets the SELinux label of /system/bin/netcfg to u:object_r:system_file:s0.
No other changes occur.

* set_metadata("/system/bin/netcfg", "uid", 0, "gid", 3003, "mode", 02750, "selabel", "u:object_r:system_file:s0", "capabilities", 0x0);

This sets /system/bin/netcfg to uid=0, gid=3003, mode=02750,
selinux label=u:object_r:system_file:s0, and clears the capabilities
associated with the file.

* set_metadata_recursive("/system", "uid", 0, "gid", 0, "fmode", 0644, "dmode", 0755, "selabel", "u:object_r:system_file:s0", "capabilities", 0x0);

All files and directories under /system are set to uid=0, gid=0,
and selinux label=u:object_r:system_file:s0. Directories are set to
mode=0755.  Files are set to mode=0644 and all capabilities are cleared.

Bug: 10183961
Bug: 10186213
Bug: 8985290
Change-Id: Ifdcf186a7ed45265511dc493c4036e1ac5e3d0af
2013-09-10 10:24:24 -07:00
Nick Kralevich
3328e3bc81 Revert "Update OTA installer to understand SELinux filesystem labels"
This reverts commit 627eb30f73.

Bug: 10183961
Bug: 10186213
2013-09-09 10:47:14 -07:00
Doug Zongker
15ae0e7867 recovery: fix use of init reboot method
We need to set the system property to "reboot,", not an empty string.

Bug: 10605007
Change-Id: I776e0d273764cf254651ab2b25c2743395b990e0
2013-09-03 15:17:18 -07:00
Doug Zongker
f187a5438d am 3b5a987c: recovery: fix use of init reboot method
* commit '3b5a987cd7fd76c038e9875b430028216d21ace3':
  recovery: fix use of init reboot method
2013-09-03 14:46:26 -07:00
Doug Zongker
3b5a987cd7 recovery: fix use of init reboot method
We need to set the system property to "reboot,", not an empty string.

Bug: 10605007
Change-Id: I776e0d273764cf254651ab2b25c2743395b990e0
2013-09-03 14:29:54 -07:00
Doug Zongker
366f78a9df am 77ea71d6: recovery: fix rebooting
* commit '77ea71d6a85a93c9bf423466e87661b1bf67c512':
  recovery: fix rebooting
2013-08-30 14:05:20 -07:00
Doug Zongker
77ea71d6a8 recovery: fix rebooting
Change I84c0513acb549720cb0e8c9fcbda0050f5c396f5 moved reboot
functionality into init but did not update the recovery partition; so
"adb reboot" and /system/bin/reboot in recovery are both broken.

Change-Id: Ie2d14627a686ffb5064256b6c399723636dff116
2013-08-30 12:20:16 -07:00
John Reck
19877de513 am 5c4e1dac: Merge "Update libpng API usage"
* commit '5c4e1dac0bd8f31559bd50eec4343b7a17b7a976':
  Update libpng API usage
2013-08-27 09:54:05 -07:00
John Reck
5c4e1dac0b Merge "Update libpng API usage" 2013-08-27 16:49:39 +00:00
John Reck
94fd07ba6d Update libpng API usage
Remove usage of deprecated methods

Change-Id: I747568a2c8c0c65ecbc9a3da4bac7b9cac7708ab
2013-08-26 16:45:33 -07:00
Doug Zongker
239ac6abac recovery: install packages in a known mount environment
When installing a package, we should have /tmp and /cache mounted and
nothing else.  Ensure this is true by explicitly mounting them and
unmounting everything else as the first step of every install.

Also fix an error in the progress bar that crops up when you do
multiple package installs in one instance of recovery.

Change-Id: I4837ed707cb419ddd3d9f6188b6355ba1bcfe2b2
2013-08-21 13:44:35 -07:00
Doug Zongker
c0441d1719 notify about pending long press
Recovery changes:

- add a method to the UI class that is called when a key is held down
  long enough to be a "long press" (but before it is released).
  Device-specific subclasses can override this to indicate a long
  press.

- do color selection for ScreenRecoveryUI's menu-and-log drawing
  function.  Subclasses can override this to customize the colors they
  use for various elements.

- Include the value of ro.build.display.id in the menu headers, so you
  can see on the screen what version of recovery you are running.

Change-Id: I426a6daf892b9011638e2035aebfa2831d4f596d
2013-07-31 11:35:12 -07:00
Todd Poynor
3c3ee3bc33 Merge "start healthd in recovery" 2013-07-26 23:57:41 +00:00
Nick Kralevich
627eb30f73 Update OTA installer to understand SELinux filesystem labels
Modify the OTA installer to understand SELinux filesystem labels.

We do this by introducing new set_perm2 / set_perm2_recursive
calls, which understand SELinux filesystem labels. These filesystem
labels are applied at the same time that we apply the
UID / GID / permission changes.

For compatibility, we preserve the behavior of the existing
set_perm / set_perm_recursive calls.

If the destination kernel doesn't support security labels, don't
fail. SELinux isn't enabled on all kernels.

Bug: 8985290
Change-Id: I99800499f01784199e4918a82e3e2db1089cf25b
2013-07-18 15:21:12 -07:00
Doug Zongker
51c84694b0 am a69b50c5: am 901b898d: recovery: remove O_DIRECT, use O_SYNC only
* commit 'a69b50c567d46afad73c4d6ab9e57f078ee73327':
  recovery: remove O_DIRECT, use O_SYNC only
2013-07-11 14:23:44 -07:00
Doug Zongker
bce44d8b55 am 660637f3: am e8d953aa: recovery: more cargo-cult programming
* commit '660637f3fc6fe20e8b7f47b98152138c2c92b7ec':
  recovery: more cargo-cult programming
2013-07-11 14:23:36 -07:00
Doug Zongker
a69b50c567 am 901b898d: recovery: remove O_DIRECT, use O_SYNC only
* commit '901b898d5e4d7cc555974b8132f83f948f8fbaee':
  recovery: remove O_DIRECT, use O_SYNC only
2013-07-11 12:42:54 -07:00
Doug Zongker
901b898d5e recovery: remove O_DIRECT, use O_SYNC only
O_DIRECT writes fail with EINVAL due to alignment issues.

Change-Id: If8cf38a636313e4f4b4e61e66287dc903c473e5b
2013-07-11 12:31:25 -07:00
Doug Zongker
660637f3fc am e8d953aa: recovery: more cargo-cult programming
* commit 'e8d953aa7ed0c16beb1b03a05d16cb23dd85e198':
  recovery: more cargo-cult programming
2013-07-11 12:22:22 -07:00
Doug Zongker
e8d953aa7e recovery: more cargo-cult programming
Add O_DIRECT|O_SYNC when opening partitions for write.

Change-Id: I9825ad8e60fba87e482f8abc5593d6f54a1e3a1c
2013-07-11 12:11:11 -07:00
The Android Open Source Project
1bdd5b7e74 am 51ffaf54: (-s ours) Reconcile with jb-mr2-release - do not merge
* commit '51ffaf54a56441bba053d37a00122761c3a18f16':
  recovery: sleep after writing partition and closing it
2013-07-11 11:49:43 -07:00
Doug Zongker
65c37aa0d3 am fbcfad33: am bf4a69ac: recovery: sleep after writing partition and closing it
* commit 'fbcfad33face5d3b9e6b8cb04379168bceb517df':
  recovery: sleep after writing partition and closing it
2013-07-11 10:17:48 -07:00
The Android Open Source Project
f5edbd107a am e352c88f: (-s ours) Reconcile with jb-mr2-release - do not merge
* commit 'e352c88fbcfd917f6614597364d2e550aa691e79':
  recovery: write partitions more conservatively
  recovery: try to write EMMC partitions more reliably
2013-07-11 10:17:05 -07:00
Doug Zongker
5d0da12878 am 2148133d: am c870a99c: recovery: write partitions more conservatively
* commit '2148133d46cb875316b01947dd5719ed995f7d67':
  recovery: write partitions more conservatively
2013-07-11 10:08:23 -07:00
The Android Open Source Project
51ffaf54a5 Reconcile with jb-mr2-release - do not merge
Change-Id: Id35004f465f5152c1de0796eb66989f234185208
2013-07-11 08:22:20 -07:00
Doug Zongker
166565f9fb recovery: sleep after writing partition and closing it
Another speculative attempt to get everything we write actually stored
to the device.

Change-Id: Icf40b0741b4c535e55ea34848073a97d90dc0e70
2013-07-10 18:25:21 -07:00
Doug Zongker
fbcfad33fa am bf4a69ac: recovery: sleep after writing partition and closing it
* commit 'bf4a69ac41696fe78f6cc67b10cf1816186f1c5d':
  recovery: sleep after writing partition and closing it
2013-07-10 13:53:15 -07:00
Doug Zongker
bf4a69ac41 recovery: sleep after writing partition and closing it
Another speculative attempt to get everything we write actually stored
to the device.

Change-Id: Icf40b0741b4c535e55ea34848073a97d90dc0e70
2013-07-10 13:46:46 -07:00
The Android Open Source Project
e352c88fbc Reconcile with jb-mr2-release - do not merge
Change-Id: Ib99b7cd6aede63006c91be2635112e16dd0f2b24
2013-07-09 17:12:56 -07:00
Doug Zongker
c6ab95e9d1 recovery: write partitions more conservatively
Write and verify partitions using write(2) and read(2) rather than the
stdio functions.  Read and write in 4kb blocks.  When writing, fsync()
every 1MB.

Bug: 9602014
Change-Id: Ie98ce38e857786fc0f4ebf36bb5ffc93b41bc96f
2013-07-09 16:31:07 -07:00
Doug Zongker
35c474e8c0 recovery: try to write EMMC partitions more reliably
Nexus 4 has flash errors that manifest during large writes (eg, of the
radio partition).  Writes of some blocks seem to be dropped silently,
without any errors being returned to the user level.

Make two changes to the partition-writing code:

- break it up into 1MB writes instead of writing partitions with a
  single fwrite() call.  Pause for 50ms in between every chunk.

- read the partition back after writing and verify that we read what
  we wrote.  Drop caches before reading so we (hopefully) are reading
  off the actual flash and not some cache.

Neither of these should be necessary.

Bug: 9602014

Change-Id: Ice2e24dd4c11f1a57968277b5eb1468c772f6f63
2013-07-09 16:30:22 -07:00
Doug Zongker
a4ee1f8b76 Merge "recovery: preserve recovery logs across cache wipes" 2013-07-09 21:16:53 +00:00
Doug Zongker
6d0d7ac051 recovery: preserve recovery logs across cache wipes
When doing a cache wipe or a factory reset (which includes a cache
wipe), save any last* log files in the /cache/recovery directory and
write them back after reformatting the partition, so that wiping data
doesn't lose useful log information.

Change-Id: I1f52ae9131760b5e752e136645c19f71b7b166ee
2013-07-09 13:34:55 -07:00
Doug Zongker
fafc85b4ad recovery: move log output to stdout
Recovery currently has a random mix of messages printed to stdout and
messages printed to stderr, which can make logs hard to read.  Move
everything to stdout.

Change-Id: Ie33bd4a9e1272e731302569cdec918e0534c48a6
2013-07-09 12:50:24 -07:00
Doug Zongker
2148133d46 am c870a99c: recovery: write partitions more conservatively
* commit 'c870a99c4aeb9e232ee68951e666b5fa670d1680':
  recovery: write partitions more conservatively
2013-07-09 11:02:07 -07:00
Doug Zongker
c870a99c4a recovery: write partitions more conservatively
Write and verify partitions using write(2) and read(2) rather than the
stdio functions.  Read and write in 4kb blocks.  When writing, fsync()
every 1MB.

Bug: 9602014
Change-Id: Ie98ce38e857786fc0f4ebf36bb5ffc93b41bc96f
2013-07-09 10:42:15 -07:00
Doug Zongker
602c4ebd39 am 0ccaccf7: am 044a0b4d: recovery: try to write EMMC partitions more reliably
* commit '0ccaccf7d0f50bb9555ee13a841c246a1fea80f2':
  recovery: try to write EMMC partitions more reliably
2013-07-08 14:14:24 -07:00