Commit Graph

907 Commits

Author SHA1 Message Date
Nick Kralevich
944fc5e616 am 915d661c: am 68802416: unconditionally apply SELinux labels to symlinks
* commit '915d661ccc64f25a533919054f487a8e5943574d':
  unconditionally apply SELinux labels to symlinks
2014-10-24 17:52:40 +00:00
Nick Kralevich
915d661ccc am 68802416: unconditionally apply SELinux labels to symlinks
* commit '688024169df70336cc128ea8cc929174c53a501e':
  unconditionally apply SELinux labels to symlinks
2014-10-24 17:43:15 +00:00
Nick Kralevich
688024169d unconditionally apply SELinux labels to symlinks
At the end of the OTA script, we walk through /system, updating
all the permissions on the filesystem, including the UID, GID,
standard UNIX permissions, capabilities, and SELinux labels.

In the case of a symbolic link, however, we want to skip most of
those operations. The UID, GID, UNIX permissions, and capabilities
don't meaningfully apply to symbolic links.

However, that's not true with SELinux labels. The SELinux label on
a symbolic link is important. We need to make sure the label on the
symbolic link is always updated, even if none of the other attributes
are updated.

This change unconditionally updates the SELinux label on the symbolic
link itself. lsetfilecon() is used, so that the link itself is updated,
not what it's pointing to.

In addition, drop the ENOTSUP special case. SELinux has been a
requirement since Android 4.4. Running without filesystem extended
attributes is no longer supported, and we shouldn't even try to handle
non-SELinux updates anymore. (Note: this could be problematic if
these scripts are ever used to produce OTA images for 4.2 devices)

Bug: 18079773
Change-Id: I87f99a1c88fe02bb2914f1884cac23ce1b385f91
2014-10-23 20:46:33 -07:00
Michael Runge
45322f939a am da500cec: am 168f7778: Allow passing of mount args to mountFn
* commit 'da500cecf5b004498c0dd17bc27a30eb4b0b9a2d':
  Allow passing of mount args to mountFn
2014-10-23 22:15:29 +00:00
Brian Carlstrom
d1e909e77d am 4da9cdea: am 473967d8: Merge "Log to UI any metadata setting errors" into lmp-dev
* commit '4da9cdeab97297e69075dd9b6cad9921cfae30b9':
  Log to UI any metadata setting errors
2014-10-23 22:15:28 +00:00
Michael Runge
da500cecf5 am 168f7778: Allow passing of mount args to mountFn
* commit '168f77787700f0e9f66675beef33c593a777e64e':
  Allow passing of mount args to mountFn
2014-10-23 21:56:52 +00:00
Brian Carlstrom
4da9cdeab9 am 473967d8: Merge "Log to UI any metadata setting errors" into lmp-dev
* commit '473967d87ff9fc7a541c16ebdc56364c285d2862':
  Log to UI any metadata setting errors
2014-10-23 21:56:52 +00:00
Nick Kralevich
3e62e9d93e am d0602fbb: am 9b2db80d: Merge "Make /cache/recovery/last_log available in recovery" into lmp-dev
* commit 'd0602fbb88c095520d0fc88e821eb5557298e32b':
  Make /cache/recovery/last_log available in recovery
2014-10-23 20:41:00 +00:00
Michael Runge
c224ac28ad am 3b5c6dca: am 2f0ef730: Treat already-renamed files as having no problems.
* commit '3b5c6dca0a448d1a09bf9adb905bc5a86230c7fc':
  Treat already-renamed files as having no problems.
2014-10-23 20:40:59 +00:00
Michael Runge
168f777877 Allow passing of mount args to mountFn
Bug: 18079773
Bug: 18092222

Change-Id: Ifc3f3e123de729dfbb2f49414b3207afa96268d5
2014-10-23 18:13:26 +00:00
Brian Carlstrom
473967d87f Merge "Log to UI any metadata setting errors" into lmp-dev 2014-10-23 17:18:13 +00:00
Michael Runge
d4a63426ef Log to UI any metadata setting errors
Bug: 18079773
Change-Id: Ic6fddbcbcb6ddb9e1cbd1698df98387c0033ae15
2014-10-23 10:06:33 -07:00
Nick Kralevich
d0602fbb88 am 9b2db80d: Merge "Make /cache/recovery/last_log available in recovery" into lmp-dev
* commit '9b2db80d407752fd524e799e4c7051162e63f91c':
  Make /cache/recovery/last_log available in recovery
2014-10-23 16:34:39 +00:00
Michael Runge
3b5c6dca0a am 2f0ef730: Treat already-renamed files as having no problems.
* commit '2f0ef73029fc51c6404121f338b034c8b516652c':
  Treat already-renamed files as having no problems.
2014-10-23 16:34:38 +00:00
Nick Kralevich
9b2db80d40 Merge "Make /cache/recovery/last_log available in recovery" into lmp-dev 2014-10-23 15:37:10 +00:00
Dan Albert
0745fbfad9 am c7249660: am 4f66469b: Merge "More test makefile cleanup."
* commit 'c7249660f908c74687b5fdadc1296eb9d4903cc7':
2014-10-23 13:04:57 +00:00
Dan Albert
440185cdd3 am ea5828a2: am 28ffde5e: Merge "Revert "Copy epoll(2) changes to minadb.""
* commit 'ea5828a24f3a8f6a44e2f15e76cacdb5bc524db0':
2014-10-23 13:04:57 +00:00
Jeff Sharkey
3970568560 am e95ed95f: am a6e13ae0: Include reason when wiping data.
* commit 'e95ed95f05d22929e0bb8610a83c4e6a01fb3a33':
2014-10-23 13:04:56 +00:00
Elliott Hughes
e5ce559fb6 am 78a30278: am 530b61e0: Merge "Copy epoll(2) changes to minadb."
* commit '78a30278607f0e57ace53eb5df7e5f7f196387a4':
2014-10-23 13:04:56 +00:00
Nick Kralevich
a9ad0324d1 Make /cache/recovery/last_log available in recovery
Create a new recovery UI option to allow the user to view
/cache/recovery/last_log for their device. This gives enhanced
debugging information which may be necessary when a failed
OTA occurs.

Bug: 18094012
Change-Id: Ic3228de96e9bfc2a0141c7aab4ce392a38140cf3
2014-10-22 21:43:08 -07:00
Michael Runge
2f0ef73029 Treat already-renamed files as having no problems.
This should help with reentrant OTAs.

Bug: 18079773

Change-Id: I102fd738e3b450483ecd4471384c12e89fc586e2
2014-10-23 00:04:36 +00:00
JP Abgrall
dd57886ce6 am 9eb8c8bd: init.rc: Inidicate that booting is complete wrt firwmare requests
* commit '9eb8c8bdbe4965e9a92d83882e97cf67aee20821':
  init.rc: Inidicate that booting is complete wrt firwmare requests
2014-10-21 17:42:56 +00:00
JP Abgrall
9eb8c8bdbe init.rc: Inidicate that booting is complete wrt firwmare requests
ueventd will wait for /dev/.booting to go away before giving up
on loading firmware.
The issue was introduced in Ifdd5dd1e95d7e064dde5c80b70198882d949a710
which forgot to update recovery's init.rc

Bug: 17993625
Change-Id: I91205fe6eea50aaef9b401d650ec8d6843a92a57
2014-10-20 20:02:57 -07:00
Dan Albert
5b7f5b15af am 4f66469b: Merge "More test makefile cleanup."
* commit '4f66469b29a34811b69518a266be31fe42cc111b':
  More test makefile cleanup.
2014-10-17 07:48:06 +00:00
Dan Albert
c7249660f9 am 4f66469b: Merge "More test makefile cleanup."
* commit '4f66469b29a34811b69518a266be31fe42cc111b':
  More test makefile cleanup.
2014-10-17 07:47:57 +00:00
Dan Albert
4f66469b29 Merge "More test makefile cleanup." 2014-10-17 01:28:35 +00:00
Dan Albert
13f21c2bc7 More test makefile cleanup.
Global variables kill.
No need to manually link gtest, and that causes problems with
libc++.

Change-Id: If804cdd436cf1addfa9a777708efbc37c27770b6
2014-10-17 01:05:08 +00:00
Dan Albert
93ecb9383a am 28ffde5e: Merge "Revert "Copy epoll(2) changes to minadb.""
* commit '28ffde5ebd33d5b693906a93087e6eea627cd8d0':
  Revert "Copy epoll(2) changes to minadb."
2014-09-26 16:12:34 +00:00
Dan Albert
ea5828a24f am 28ffde5e: Merge "Revert "Copy epoll(2) changes to minadb.""
* commit '28ffde5ebd33d5b693906a93087e6eea627cd8d0':
  Revert "Copy epoll(2) changes to minadb."
2014-09-26 16:12:23 +00:00
Dan Albert
28ffde5ebd Merge "Revert "Copy epoll(2) changes to minadb."" 2014-09-26 16:04:16 +00:00
Doug Zongker
91c2788851 am d83e4f15: support for version 2 of block image diffs
* commit 'd83e4f15890ac6ebe0d61924bd224eb1ae8565ad':
  support for version 2 of block image diffs
2014-09-26 14:54:01 +00:00
Doug Zongker
d83e4f1589 support for version 2 of block image diffs
In version 2 of block image diffs, we support a new command to load
data from the image and store it in the "stash table" and then
subsequently use entries in the stash table to fill in missing bits of
source data we're not allowed to read when doing move/bsdiff/imgdiff
commands.

This leads to smaller update packages because we can break cycles in
the ordering of how pieces are updated by storing data away and using
it later, rather than not using the data as input to the patch system
at all.  This comes at the cost of the RAM or scratch disk needed to
store the data.

The implementation is backwards compatible; it can still handle the
existing version 1 of the transfer file format.

Change-Id: I4559bfd76d5403859637aeac832f3a5e9e13b63a
2014-09-25 16:38:14 -07:00
Dan Albert
f420f8eb63 Revert "Copy epoll(2) changes to minadb."
This reverts commit db8c959049.
2014-09-25 15:12:19 -07:00
Jeff Sharkey
6265665282 am a6e13ae0: Include reason when wiping data.
* commit 'a6e13ae01bff5109361868f565187f16d045c82d':
  Include reason when wiping data.
2014-09-25 17:06:24 +00:00
Jeff Sharkey
e95ed95f05 am a6e13ae0: Include reason when wiping data.
* commit 'a6e13ae01bff5109361868f565187f16d045c82d':
  Include reason when wiping data.
2014-09-24 23:35:38 +00:00
Jeff Sharkey
a6e13ae01b Include reason when wiping data.
This will help us track down who requested a data wipe.

Bug: 17412160
Change-Id: I1c439fbd29f96b9851810baca9101f683a0f18d8
2014-09-24 11:46:17 -07:00
Elliott Hughes
970c3947f3 am 530b61e0: Merge "Copy epoll(2) changes to minadb."
* commit '530b61e0b5f154e5f38853c10a28e0ea6f41c2ca':
  Copy epoll(2) changes to minadb.
2014-09-23 18:57:44 +00:00
Elliott Hughes
78a3027860 am 530b61e0: Merge "Copy epoll(2) changes to minadb."
* commit '530b61e0b5f154e5f38853c10a28e0ea6f41c2ca':
  Copy epoll(2) changes to minadb.
2014-09-23 18:57:39 +00:00
Elliott Hughes
530b61e0b5 Merge "Copy epoll(2) changes to minadb." 2014-09-23 18:36:34 +00:00
Elliott Hughes
db8c959049 Copy epoll(2) changes to minadb.
Bug: 17588403
Change-Id: Ib3525824ff09330bd9d6f9e96d662e5a55a20ec2
2014-09-23 10:50:55 -07:00
Doug Zongker
574443d895 create block map for all update packages on /data
Always create the block map for packages on /data; don't only look at
the encryptable/encrypted flags.

Bug: 17395453
Change-Id: Iaa7643a32898328277841e324305b9419a9e071c
2014-09-05 08:22:12 -07:00
Doug Zongker
40482ea2ae Merge "fix comment in blockimg updater code" into lmp-dev 2014-09-04 15:26:29 +00:00
Doug Zongker
f7bb09dae8 fix comment in blockimg updater code
The comment for the DEBUG_ERASE setting is exactly backwards.

Change-Id: I98ab5828365894217fc78976817a131e7d22d5c1
2014-09-04 08:10:32 -07:00
Andrew Boie
8328922ff0 use lseek64 instead of lseek
Otherwise, overflow problems can occur with images larger than
2G since the offsets will overflow a 32-bit off_t.

Change-Id: I05951a38ebeae83ad2cb938594e8d8adb323e2aa
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2014-09-04 07:54:17 -07:00
Doug Zongker
5f875bf577 remove code for original block OTA mechanism
Superseded by newer code.

Bug: 16984795
Change-Id: I842299f6a02af7ccf51ef2ca174d813ca53deef1
2014-08-26 13:54:24 -07:00
Doug Zongker
f449db2f30 open misc device in write-only mode
Opening the misc block device in read-write mode runs afoul of
SELinux, which keeps the wipe code from working.  Fix.  Also change
various things to log to logcat so we can see them happening, for
future debugging.

Bug: 16715412
Change-Id: Ia14066f0a371cd605fcb544547b58a41acca70b9
2014-08-26 09:22:57 -07:00
Doug Zongker
1d5d6098f4 fix two bugs in block image updater
The computation of file offsets was overflowing for partitions larger
than 2 GB.  The parsing of the transfer file could fail at the end if
the data happened to not be properly null-terminated.

Bug: 16984795
Change-Id: I3ce6eb3e54ab7b55aa9bbed252da5a7eacd3317a
2014-08-21 10:47:24 -07:00
Doug Zongker
bc7ffeda98 installer for new block OTA system
(Cherry-pick back from master.)

Bug: 16984795
Change-Id: Ifa3d8345c5e2a0be86fb28faa080ca82592a96b4
2014-08-19 16:53:39 -07:00
Doug Zongker
2efc9d994c clear BCB in misc partition before rebooting
Something is leaving behind wipe commands in the BCB area of the /misc
partition.  We don't know what is doing that.  It should always be
safe to zero out that area from uncrypt, though (because if uncrypt is
running then it's got the command we want in the recovery command file
rather than the BCB).

Bug: 16715412
Change-Id: Iad01124287f13b80ff71d6371db6371f43c43211
2014-08-18 15:55:28 -07:00
Doug Zongker
1a35a58690 revert uncrypt back to dynamic linking, fix libs
Bug: 17029174, 17015157
Change-Id: I1d24f3402875dfb972daa6daef0f385baeff84e9
2014-08-14 10:32:46 -07:00