Commit Graph

714 Commits

Author SHA1 Message Date
Doug Zongker
c9d6e4ff51 support don't-care maps when writing the system image
Make package_extract_file() take an optional third argument which is
the pathname (in the package zip) of a map of don't-care regions to
skip over when writing the file.

Modify syspatch() to take source and target don't-care maps and use
them when patching the system partition.

Add the wipe_block_device() function to do a discard of all data on
the partition.

Change-Id: I8c856054edfb6aab2f3e5177f16d9d78add20be4
2014-02-24 16:02:50 -08:00
Doug Zongker
0ac1cbaa76 add flag for GPL license
updater now depends on the GPL'd libraries libsyspatch and libxdelta3,
so be careful when taking code from this directory.

Change-Id: Ib6f8c50ce7052912b9d81ff96d095f778bf9a3d0
2014-02-20 10:15:44 -08:00
Doug Zongker
f2ff0a2097 Merge "clean up some warnings when building recovery" 2014-02-18 17:48:19 +00:00
Maxim Siniavine
48f4c3d60c Merge "Fix a crash when going into recovery mode." 2014-02-14 00:03:28 +00:00
Maxim Siniavine
e7b2888245 Fix a crash when going into recovery mode.
When going into recovery mode withoug recovery command file present, uncrypt crashes
and the device gets stuck and eventually shuts down.

Check that the command file is present before trying to read from it.

Change-Id: If0192d597032be0067738e437188d92993ce56f7
2014-02-13 15:53:38 -08:00
Doug Zongker
3eb681d1de remove remaining libminelf references
Change-Id: Id38b08607829bccc031693cc03e60e849903b6f8
2014-02-13 15:49:35 -08:00
Doug Zongker
0d32f259cd clean up some warnings when building recovery
Change-Id: I1541534ee6978ddf8d548433986679ce9507d508
2014-02-13 15:34:18 -08:00
Doug Zongker
a1bc148c7c remove 'retouch' ASLR support
Older versions of android supported an ASLR system where binaries were
randomly twiddled at OTA install time.  Remove support for this; we
now use the ASLR support in the linux kernel.

Change-Id: I8348eb0d6424692668dc1a00e2416fbef6c158a2
2014-02-13 15:18:19 -08:00
Doug Zongker
52b4036eb8 add syspatch support to updater
Add the syspatch() function, which can apply xdelta3+xz patches using
the libsyspatch library.

Change-Id: Idc1921e449020923bcaf425a1983bec0833e47ed
2014-02-13 14:15:26 -08:00
Doug Zongker
a9300301ce add mzGetStoredEntry function
mzGetStoredEntry gives you a pointer and address to the data of a zip
entry, assuming that entry is stored rather than deflated.

Change-Id: Ifb39777c98d1d50475ef7de419cf28935f5f9965
2014-02-13 08:30:41 -08:00
Colin Cross
707d321a87 am 2739ed96: am a5d105e2: Merge "recovery: fix building with pointer-to-int errors turned on"
* commit '2739ed9628f72813d213b7a429c4c1b8dcebe5fc':
  recovery: fix building with pointer-to-int errors turned on
2014-02-06 03:07:48 +00:00
Colin Cross
2739ed9628 am a5d105e2: Merge "recovery: fix building with pointer-to-int errors turned on"
* commit 'a5d105e2397d81537facd93fd8a9d3e263d57dc9':
  recovery: fix building with pointer-to-int errors turned on
2014-02-06 02:59:38 +00:00
Colin Cross
a5d105e239 Merge "recovery: fix building with pointer-to-int errors turned on" 2014-02-06 02:14:22 +00:00
Colin Cross
92cdf9c372 recovery: fix building with pointer-to-int errors turned on
Use intptr_t/uintptr_t to cast between pointer and int to allow
building with -Werror=pointer-to-int-cast and
Werror=int-to-pointer-cast turned on.

Cast to char* instead of unsigned int for pointer arithmetic.

Change-Id: Ia862306fdcca53866b330e8cf726f3d62f2248a0
2014-02-05 17:34:45 -08:00
Colin Cross
4068f6aff2 am fd84f65d: am f3532072: Merge "minadbd: remove dead code"
* commit 'fd84f65dcda3c7e4b42c71a7df85efebdbf7ea7a':
  minadbd: remove dead code
2014-01-27 20:46:36 +00:00
Colin Cross
fd84f65dcd am f3532072: Merge "minadbd: remove dead code"
* commit 'f353207298ed14d0e6943353dd9788421a7537b8':
  minadbd: remove dead code
2014-01-27 12:40:26 -08:00
Colin Cross
f353207298 Merge "minadbd: remove dead code" 2014-01-27 20:35:19 +00:00
Colin Cross
e787fee8f2 minadbd: remove dead code
Change-Id: Ia1f34a17ae582575f8cd3514ed7bc015b0a5006e
2014-01-24 14:51:54 -08:00
Nick Kralevich
4d1b0903ff am f4641299: am 295e74aa: Merge "adbd: switch to su domain when running as root"
* commit 'f464129950eaea49b1234fdcfd04ec8723e3c672':
  adbd: switch to su domain when running as root
2014-01-24 18:14:50 +00:00
Nick Kralevich
f464129950 am 295e74aa: Merge "adbd: switch to su domain when running as root"
* commit '295e74aa20c9f32e1e46fc1b0bf0975642a8c95b':
  adbd: switch to su domain when running as root
2014-01-24 10:06:45 -08:00
Nick Kralevich
295e74aa20 Merge "adbd: switch to su domain when running as root" 2014-01-24 17:59:52 +00:00
Doug Zongker
19a8e2463c log extra info for debugging
Make recovery log its PID, and when we use a block map file, log how
many ranges it contains.

Change-Id: I1b4299f8163af68a770b48c029ae25e6cb45d26b
2014-01-21 09:25:41 -08:00
Nick Kralevich
c52c5b8e3d adbd: switch to su domain when running as root
When adbd runs as root, it should transition into the
su domain. This is needed to run the adbd and shell
domains in enforcing on userdebug / eng devices without
breaking developer workflows.

Use the new device_banner command line option.

Change-Id: Ib33c0dd2dd6172035230514ac84fcaed2ecf44d6
2014-01-18 09:22:50 -08:00
Doug Zongker
76adfc5309 program to store unencrypted files in an encrypted filesystem
uncrypt can read a file on an encrypted filesystem and rewrite it to
the same blocks on the underlying (unencrypted) block device.  This
destroys the contents of the file as far as the encrypted filesystem
is concerned, but allows the data to be read without the encryption
key if you know which blocks of the raw device to access.  uncrypt
produces a "block map" file which lists the blocks that contain the file.

For unencrypted filesystem, uncrypt will produce the block map without
touching the data.

Bug: 12188746
Change-Id: Ib7259b9e14dac8af406796b429d58378a00c7c63
2014-01-16 13:37:55 -08:00
Doug Zongker
99916f0496 do verification and extraction on memory, not files
Changes minzip and recovery's file signature verification to work on
memory regions, rather than files.

For packages which are regular files, install.cpp now mmap()s them
into memory and then passes the mapped memory to the verifier and to
the minzip library.

Support for files which are raw block maps (which will be used when we
have packages written to encrypted data partitions) is present but
largely untested so far.

Bug: 12188746
Change-Id: I12cc3e809834745a489dd9d4ceb558cbccdc3f71
2014-01-16 13:29:28 -08:00
Doug Zongker
0708239c00 am a01b6467: am 772f6e2a: Merge "correctly mount tmpfs as /tmp in recovery"
* commit 'a01b646794fc207da657d7b8ef779c9d842acfde':
  correctly mount tmpfs as /tmp in recovery
2014-01-14 18:28:35 +00:00
Doug Zongker
a01b646794 am 772f6e2a: Merge "correctly mount tmpfs as /tmp in recovery"
* commit '772f6e2a8865934bb57aaeea8354a75a47ee753f':
  correctly mount tmpfs as /tmp in recovery
2014-01-14 10:20:41 -08:00
Doug Zongker
772f6e2a88 Merge "correctly mount tmpfs as /tmp in recovery" 2014-01-14 18:14:12 +00:00
Doug Zongker
075ef327d4 correctly mount tmpfs as /tmp in recovery
The syntax of init's mount command changed in April 2008 but
recovery's init.rc was never updated, so recovery's /tmp has been on
the root fs all this time.  Fix.

Also add /system/bin to the PATH in recovery, which is handy for
debugging.

Change-Id: I39f7ae435a8ce3bad691e4b7c307db0bd8de1302
2014-01-14 09:50:35 -08:00
Nick Kralevich
c22a444cdd am 7e0d3066: am fc729512: Merge "Set SELinux security contexts correctly for init and services."
* commit '7e0d30667cf53a182525f87dd0c8cb0e2628a1ed':
  Set SELinux security contexts correctly for init and services.
2014-01-13 19:59:15 +00:00
Nick Kralevich
7e0d30667c am fc729512: Merge "Set SELinux security contexts correctly for init and services."
* commit 'fc729512375c4f0d351f6f67f0d7f500ea1b9233':
  Set SELinux security contexts correctly for init and services.
2014-01-13 11:52:17 -08:00
Nick Kralevich
fc72951237 Merge "Set SELinux security contexts correctly for init and services." 2014-01-13 19:47:21 +00:00
Stephen Smalley
2c9d5b2839 Set SELinux security contexts correctly for init and services.
Otherwise everything is left running in the kernel domain when
booting recovery.

Change-Id: Ie3d86547d5be0b68dd1875a97afe1e00fc3e4da1
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-01-13 14:00:36 -05:00
Doug Zongker
2768efdf9f remove dead code from minzip
minzip had some features that were used when reading APKs, but APK
handling now uses libziparchive instead of minzip.  Remove these
unused functions.

Change-Id: Iead89209a716bfe9e3d339bf85b3e97e33a41f35
2014-01-13 10:51:13 -08:00
Nick Kralevich
f3819c271e am 27efc8f9: am 617d1cad: Merge "minui: do not use flexible array initialization"
* commit '27efc8f9d1711134051b45d28b2fc38bfb4c7dc6':
  minui: do not use flexible array initialization
2014-01-04 02:02:17 +00:00
Nick Kralevich
27efc8f9d1 am 617d1cad: Merge "minui: do not use flexible array initialization"
* commit '617d1cadc6e0e1e9fd46e0e6a8505f6f7f56a5f7':
  minui: do not use flexible array initialization
2014-01-03 17:52:46 -08:00
Nick Kralevich
617d1cadc6 Merge "minui: do not use flexible array initialization" 2014-01-04 01:47:56 +00:00
Michael Runge
7af6b7f2cc am 15f5fe1b: am f9dd42de: Merge "Don\'t abort on read_file if the file is missing." into klp-dev
* commit '15f5fe1bcd2bf18b07f89d0cc58dcffb5bc1f932':
  Don't abort on read_file if the file is missing.
2013-12-26 23:58:57 +00:00
Michael Runge
15f5fe1bcd am f9dd42de: Merge "Don\'t abort on read_file if the file is missing." into klp-dev
* commit 'f9dd42de6034ab09f9fa649ed1fbea25bc05e598':
  Don't abort on read_file if the file is missing.
2013-12-26 15:33:28 -08:00
Michael Runge
f9dd42de60 Merge "Don't abort on read_file if the file is missing." into klp-dev 2013-12-20 19:33:05 +00:00
Doug Zongker
289ab02599 am e1bb2733: am 168724c3: fix unnecessarily slow writing of EMMC partitions
* commit 'e1bb2733f9261336f38a94dc9d93ed010a7cbc57':
  fix unnecessarily slow writing of EMMC partitions
2013-12-20 00:10:49 +00:00
Doug Zongker
e1bb2733f9 am 168724c3: fix unnecessarily slow writing of EMMC partitions
* commit '168724c31ad5241e157ebb35135a734fa075d53b':
  fix unnecessarily slow writing of EMMC partitions
2013-12-19 16:03:12 -08:00
Doug Zongker
168724c31a fix unnecessarily slow writing of EMMC partitions
These were attempts to write partitions "conservatively" in hopes of
fixing the problems with writing the radio partition on Nexus 4.  They
didn't work (a kernel patch was needed), but got left in.  They make
writing of partitions unnecessarily slow (ie, we really shouldn't need
to sync() after every 4kb).  Roll back most of them, but leave the
verification read-back in.

Change-Id: I94badc0979e88816c5aa0485f6316c02be69173c
2013-12-19 15:16:57 -08:00
Michael Runge
6eed224771 Don't abort on read_file if the file is missing.
Change-Id: I85726bf736203d602428114145c3b98692580656
2013-12-13 17:13:11 -08:00
Doug Zongker
f39989a36d recovery: wipe encryption metadata along with data partition
This assumes that the metadata is correctly defined in fstab.
Which apparently some devices don't do.


Bug: 8766487
Bug: 12112624
Change-Id: I1b14b9d4c888e9348527984be3dce04bdd9f4de0
2013-12-12 23:27:42 +00:00
Doug Zongker
a766c34f86 am d327c63a: am c87bab10: add the functions for multi-stage packages to updater
* commit 'd327c63af691a36fbf53866a3ae7ad27a43ebe3b':
  add the functions for multi-stage packages to updater
2013-12-02 23:30:51 +00:00
Doug Zongker
d327c63af6 am c87bab10: add the functions for multi-stage packages to updater
* commit 'c87bab101893e8322b49d7c8600e3367b20ab50a':
  add the functions for multi-stage packages to updater
2013-11-27 10:57:44 -08:00
Doug Zongker
c87bab1018 add the functions for multi-stage packages to updater
In order to support multi-stage recovery packages, we add the
set_stage() and get_stage() functions, which store a short string
somewhere it can be accessed across invocations of recovery.  We also
add reboot_now() which updater can invoke to immediately reboot the
device, without doing normal recovery cleanup.  (It can also choose
whether to boot off the boot or recovery partition.)

If the stage string is of the form "#/#", recovery's UI will be
augmented with a simple indicator of what stage you're in, so it
doesn't look like a reboot loop.

Change-Id: I62f7ff0bc802b549c9bcf3cc154a6bad99f94603
2013-11-26 15:46:57 -08:00
synergy dev
a0ecc8c427 minui: do not use flexible array initialization
Avoiding the use of gnu extensions improves code portability

Change-Id: I441a49ce08b6ecb1d735ca453552fa92026c5016
2013-11-26 03:21:13 +00:00
Doug Zongker
9fb676aa92 Merge "Fix rare crash seen when dereferencing backgroundIcon[NONE]." 2013-11-18 17:58:12 +00:00