Commit Graph

1970 Commits

Author SHA1 Message Date
Treehugger Robot 37450d7f42 Merge "Remove an abused global so we can actually see logging." 2016-06-15 23:10:32 +00:00
Elliott Hughes 279876c932 Merge "init now uses libprocessgroup, so set up /acct." 2016-06-15 23:09:19 +00:00
Elliott Hughes 48ebb07211 init now uses libprocessgroup, so set up /acct.
Change-Id: Iec1492dfaf2ceae6f4d8618dd725d07316ee960b
2016-06-15 15:15:15 -07:00
Elliott Hughes 59bf0da22f Remove an abused global so we can actually see logging.
Change-Id: Ib97440bc0542003b84c45cb05f194ba20104dad6
2016-06-15 15:14:04 -07:00
Elliott Hughes 179c0d80bc Merge "Remove obsolete MTD support." 2016-06-15 21:55:15 +00:00
Tao Bao 59f04b9982 Merge "Add bootloader_message_ab struct." 2016-06-14 16:09:16 +00:00
Tao Bao 4ddd5edf31 Merge "updater: Fix the broken ReadFileFn." 2016-06-11 18:42:53 +00:00
Tao Bao efacd80364 updater: Fix the broken ReadFileFn.
Was accidentally broken by the CL in [1].

[1]: commit d6c93afcc2

Change-Id: I851e13ccea6f5be6fcd47f712cc95867245f9934
2016-06-11 03:59:56 -07:00
Elliott Hughes 63a319201f Remove obsolete MTD support.
Bug: http://b/29250988
Change-Id: Ia97ba9082a165c37f74d6e1c3f71a367adc59945
2016-06-10 13:45:35 -07:00
Elliott Hughes 5b2191a9d6 Merge "Remove etc/META-INF/com/google/android/update-script." 2016-06-10 16:20:42 +00:00
Tao Bao 9fb2b592e2 Add bootloader_message_ab struct.
Move A/B-specific fields, effectively slot_suffix as in this CL, out of
bootloader_message struct. Those A/B-specific fields are expected to be
managed by the A/B-bootloader or boot control HAL, which shouldn't be
cleared by recovery or uncrypt.

Round up the bootloader_message struct to 2-KiB. Round up the
bootloader_message_ab struct to 4-KiB.

Bug: 29193360
Change-Id: I5740a612456da6d4d3b00e49a202d8f689d32690
2016-06-09 21:46:13 -07:00
Elliott Hughes ad29b10c00 Remove etc/META-INF/com/google/android/update-script.
Bug: http://b/29250988
Change-Id: I61f8c6717b38de2242e4ea8e0913237c1ce5bfea
2016-06-09 18:03:05 -07:00
Tao Bao 0ab866b354 Merge "recovery: Add support to brick a device." 2016-06-03 21:35:06 +00:00
Tao Bao 862a4c1119 recovery: Add support to brick a device.
When recovery starts with --brick, it tries to brick the device by
securely wiping all the partitions as listed in /etc/recovery.brick.

This is designed to support bricking lost devices.

Bug: 27253717
Change-Id: Ib0bd4f0a3bdaca4febc91fce6b682e3ec74354e2
2016-06-03 11:01:41 -07:00
Tao Bao c96c9881a6 Merge "Revert "Fix memory/resource handling in imgdiff.cpp, using unique_ptr and vector."" 2016-06-01 21:32:15 +00:00
Tao Bao a0c4011028 Revert "Fix memory/resource handling in imgdiff.cpp, using unique_ptr and vector."
This reverts commit 50a6f8c833.

A mix of new and free leads to memory corruptions.
2016-06-01 13:15:44 -07:00
Treehugger Robot a8850710e5 Merge "Fix memory/resource handling in imgdiff.cpp, using unique_ptr and vector." 2016-06-01 18:24:15 +00:00
Adam Buchbinder 50a6f8c833 Fix memory/resource handling in imgdiff.cpp, using unique_ptr and vector.
This fixes the following cppcheck reports:
[imgdiff.cpp:197]: (error) Memory leak: img
[imgdiff.cpp:386]: (error) Memory leak: img
[imgdiff.cpp:656]: (error) Memory leak: data
[imgdiff.cpp:664]: (error) Memory leak: data
[imgdiff.cpp:668]: (error) Memory leak: data
[imgdiff.cpp:668]: (error) Resource leak: f
[imgdiff.cpp:820]: (error) Memory leak: bonus_data
[imgdiff.cpp:824]: (error) Memory leak: bonus_data
[imgdiff.cpp:824]: (error) Resource leak: f
[imgdiff.cpp:847]: (error) Memory leak: bonus_data
[imgdiff.cpp:851]: (error) Memory leak: bonus_data
[imgdiff.cpp:856]: (error) Memory leak: bonus_data
[imgdiff.cpp:860]: (error) Memory leak: bonus_data
[imgdiff.cpp:227]: (error) Memory leak: temp_entries

Change-Id: I06f878d0b677a25328e0deb84f65f3b7212e24b1
(cherry picked from commit 51dc9444bc)
2016-06-01 10:28:45 -07:00
Tao Bao 59203510eb Merge "Revert "imgdiff: Generate statically linked imgdiff."" 2016-06-01 00:09:19 +00:00
Tao Bao 16e3861c84 Revert "imgdiff: Generate statically linked imgdiff."
This reverts commit b4422bd769.

Bug: 28941046
Change-Id: Ic3c7439c64b8e55832252850514f721a944993d6
2016-06-01 00:08:40 +00:00
Tao Bao 680d783ecc Merge "imgdiff: Generate statically linked imgdiff." 2016-05-31 22:42:13 +00:00
Tao Bao b4422bd769 imgdiff: Generate statically linked imgdiff.
Bug: 28941046
Change-Id: If3019d8cff91fd4f6fa4516bef5a0f51c2ddebc7
2016-05-30 21:53:11 -07:00
Treehugger Robot 3788001b2c Merge "slot_metadata: add verity_corrupted field" 2016-05-23 21:10:16 +00:00
Jeremy Compostella e77a68f67f slot_metadata: add verity_corrupted field
In rootfs context, the verity mode must be supplied by the bootloader
to the kernel.  This patch creates a new verity_corrupted field in the
slot metadata structure to remind that this slot is corrupted from a
dm-verity point of view.

If the bootloader receives the "dm-verity device corrupted" reboot
target, it should set this bit to 1.  If this bit value is 1, the
bootloader should set the veritymode to "eio".

Change-Id: I9335a39d7d009200318c58c53a3139d542788a9b
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
2016-05-23 13:10:23 +02:00
Treehugger Robot 14352497f0 Merge "Keep ADF device alive for the lifetime of the minui backend" 2016-05-12 17:24:24 +00:00
Tao Bao c7d7eb2225 Merge "updater, minzip: Remove unnecessary O_SYNC flags." 2016-05-08 17:58:19 +00:00
Alistair Strachan 733285fea2 updater, minzip: Remove unnecessary O_SYNC flags.
Remove O_SYNC from mzExtractRecursive() and PackageExtractFileFn().
These functions deal with extracting whole files from the update
package onto a filesystem. If run on ext4 on a rotating disk, for
example, the O_SYNC flag will cause serious performance problems
and the extraction proecss can take over 30 minutes, with no
obvious benefits.

This API function already calls fsync(fd) after each file is
extracted to ensure data and metadata is written to the underlying
block device, so the O_SYNC calls should be superfluous and safely
removable.

This change does not affect the OTA patch paths or any modification
of the bootloader partition or writes to other 'emmc' partitions.

Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
Change-Id: I9cbb98a98e6278bf5c0d7efaae340773d1fbfcd2
2016-05-05 16:04:58 -07:00
Treehugger Robot 704cac2f99 Merge "applypatch: Use bsdiff from external/bsdiff." 2016-05-05 22:35:43 +00:00
Jonathan Hamilton bab6e492ef Keep ADF device alive for the lifetime of the minui backend
Some ADF drivers do some amount of state cleanup when the ADF device
node is closed, making and attempts to draw using it fail.

This changes the minui ADF backend to keep the adf_device open until it
is exited, fixing issues on such devices.
2016-05-05 15:30:57 -07:00
Sen Jiang 2fffcb174b applypatch: Use bsdiff from external/bsdiff.
external/bsdiff uses divsufsort which is much faster, and also include
some bug fixes.

Bug: 26982501
Test: ./imgdiff_test.sh

Change-Id: I089a301c291ee55d79938c7a3ca6d509895440d1
2016-05-03 16:39:51 -07:00
Treehugger Robot ecd6e2af50 Merge "recovery: Always log the update attempt." 2016-05-03 05:40:23 +00:00
Tao Bao 37c45027bb recovery: Always log the update attempt.
An OTA may be skipped due to low battery. But we should always log it to
understand why an update _fails_ to apply.

Bug: 27893175
Change-Id: I50a3fbbb3e51035e0ac5f1cca150e283852825c3
(cherry picked from commit 5687001895)
2016-05-02 21:27:43 -07:00
Chih-hung Hsieh fafa6a6531 Merge "Fix google-explicit-constructor warnings." 2016-04-29 22:26:41 +00:00
Chih-Hung Hsieh 49c5c79df1 Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I5b35ae16c069e7e9229e66963386f322bd808af1
2016-04-29 14:16:35 -07:00
Tao Bao df59ceecfb Merge "updater: Don't zero out CommandParameters with memset(3)." 2016-04-28 04:28:19 +00:00
Tao Bao 730646199b updater: Don't zero out CommandParameters with memset(3).
[1] switched a few things to android::base::unique_fd including
CommandParameters.fd. However, we were using memset(3) to zero out the
struct, which effectively assigned unique_fd(0) to fd. When it called
fd.reset(), file descriptor 0 was unintentionally closed. When FD 0 was
later reassigned via open(2), it led to lseek(2) errors: "Bad file
descriptor".

This CL switches to using braced-init (i.e. '= {}') instead, so that the
default constructor unique_fd(-1) would be called.

[1]: commit bcabd09293

Bug: 28391985
Change-Id: If1f99932b15552714c399e65c8b80550344b758a
2016-04-26 17:36:13 -07:00
Chih-hung Hsieh a1f4a1ec33 Merge "Fix google-runtime-int warnings." 2016-04-18 22:19:06 +00:00
Chih-Hung Hsieh 54a2747ef3 Fix google-runtime-int warnings.
Bug: 28220065
Change-Id: Ida199c66692a1638be6990d583d2ed42583fb592
2016-04-18 12:29:30 -07:00
Treehugger Robot 51dcd0da37 Merge "Fix IWYU errors." 2016-04-16 01:46:25 +00:00
David Benjamin a86392ea92 Fix IWYU errors.
This fixes build errors with BoringSSL master. (The cpp file uses functions
from bn.h and neither it nor the header includes it.)

Change-Id: If7f38aa0b931aa7940079bc006c7283b31f3b774
2016-04-15 20:27:44 -04:00
Tao Bao e6af5228aa Merge "Define the Bootloader Control A/B structure" 2016-04-15 16:51:14 +00:00
Elliott Hughes 62e6637f8b Merge "Convert recovery to use BoringSSL instead of mincrypt." 2016-04-12 23:12:35 +00:00
Mattias Nissler 452df6d99c Convert recovery to use BoringSSL instead of mincrypt.
This changes the verification code in bootable/recovery to use
BoringSSL instead of mincrypt.

Change-Id: I37b37d84b22e81c32ac180cd1240c02150ddf3a7
2016-04-06 15:54:17 +02:00
Jeremy Compostella b3bf958d4f Define the Bootloader Control A/B structure
Define the A/B structure for implementation using the misc partition
as storage.  The bootloader_control structure is designed to be put in
the bootloader_message slot_suffix field.

Change-Id: I158bdf3e69b3f327a1dde4c6eb1f907dbaf8939c
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
2016-04-06 09:56:10 +02:00
Mark Salyzyn 901f31531b Merge "recovery-persist: pick up both pstore console files" 2016-04-05 14:29:05 +00:00
Mark Salyzyn 5f7111ff4d recovery-persist: pick up both pstore console files
- Volantis console-ramoops-0 (upstream correct)
- Angler console-ramoops
- Bullhead console-ramoops
- Shamu console-ramoops

NB: Shamu also has kernel crashes in other pstore files,
    not merging them in.

Bug: 27176738
Change-Id: Ib6eef3e25475935b89252f51c960719c7860511a
2016-04-04 16:24:48 -07:00
Elliott Hughes 81247500d5 Merge "Move selinux dependencies out of header files." 2016-04-02 15:53:11 +00:00
Elliott Hughes 4bbd5bf8a6 Move selinux dependencies out of header files.
Bug: http://b/27764900
Change-Id: Ib62a59edcb13054f40f514c404d32b87b14ed5f1
2016-04-01 18:24:39 -07:00
Mark Salyzyn 75da77105f Merge "recovery: use __android_log_pmsg_file_write for log files" 2016-03-31 20:49:56 +00:00
Yabin Cui ebd22be4f7 Merge "uncrypt: remove --read-bcb option." 2016-03-30 01:19:25 +00:00