Commit graph

43199 commits

Author SHA1 Message Date
Elliott Hughes
b70d19e75e libziparchive: use lseek directly.
The Mac doesn't have lseek64, and this code is built with
_FILE_OFFSET_BITS=64 anyway.

Bug: N/A
Test: ran tests
Change-Id: Ibda49c44ecfbe21b304e163e48f7ea42d97e38a7
2018-10-26 21:27:38 -07:00
Treehugger Robot
787de64fad Merge "fastboot: wipe overlayfs for partition" 2018-10-27 00:18:24 +00:00
David Anderson
43cb5db90a Merge "fastbootd: Remove metadata merging code." 2018-10-26 23:23:34 +00:00
Yuchao Zhou
1e6f4d8dab Merge "Yet another Mac fix." 2018-10-26 23:20:24 +00:00
Elliott Hughes
9c8bd669e8 Yet another Mac fix.
system/core/libziparchive/zip_archive.cc:847:36: error: use of undeclared identifier 'lseek64'; did you mean 'lseek'?
  const off64_t current_offset = lseek64(fd, 0, SEEK_CUR);

Bug: N/A
Test: builds
Change-Id: If762011722d53376bb6dab35c6ee8031762e5a95
2018-10-26 16:14:21 -07:00
Yuchao Zhou
55d31ecd86 Merge "More Mac build fixes." 2018-10-26 22:47:40 +00:00
Tom Cherry
668f70f6ef Merge "init: fix error messages when an invalid section header is found" 2018-10-26 22:31:52 +00:00
Mark Salyzyn
044f04baed fastboot: wipe overlayfs for partition
Arrange to delete the overlayfs backing when a specified partition
has been flashed.

Test: manual
Bug: 109821005
Bug: 117605276
Change-Id: I1c6a0341c6cd2ecfbb7c71bec5679a74d579aadd
2018-10-26 20:57:14 +00:00
David Anderson
b6134a6d4e fastbootd: Remove metadata merging code.
The purpose of this code was to support preserving partitions across a
flashall operation. Since we are not supporting persistent read-write
partitions, this merging code is effectively useless - it is preserving
only partitions that will be deleted.

Additionally, this code does not merge partition group changes, since
doing so accurately is difficult. Partition size changes aren't sent
until after update-super resolves, so a valid re-grouping could be
rejected during update-super if the existing partitions are too big.

This patch removes the update-super merging code until a use case comes
along and we can properly evaluate how it should work.

Bug: N/A
Test: fastboot flashall
Change-Id: I1d622b23dabdf031897be9de49f59fc8cf3caf3b
2018-10-26 13:34:40 -07:00
Tom Cherry
0166fd606d init: fix error messages when an invalid section header is found
If a section header such as 'on' or 'service' has an error with it,
the rest of the commands / options are currently reported as errors
since there is no valid parser object to parse them.  For example,

service !@#$%%^&*() /system/bin/false
    user root
    group blah
    blah blah

Generates:

init: /system/etc/init/bad.rc: 2: invalid service name '!@#$%%^&*()'
init: /system/etc/init/bad.rc: 3: Invalid section keyword found
init: /system/etc/init/bad.rc: 4: Invalid section keyword found
init: /system/etc/init/bad.rc: 5: Invalid section keyword found

This change suppresses the extraneous 'Invalid section keyword found'
messages.

Test: faulty error messages are suppressed.
Change-Id: Ieeb2d5b8b7eea33e191a88ce5a0d41701686943f
2018-10-26 12:33:52 -07:00
Tom Cherry
c7452ea8c4 Merge "init: allow vendor init to action on any vendor or odm property" 2018-10-26 19:15:58 +00:00
David Anderson
3eb5ba753c Merge "fastboot: Resize logical partitions when using the flash command." 2018-10-26 18:26:42 +00:00
Elliott Hughes
a56a729c14 More Mac build fixes.
The libziparchive public headers that refer to `off64_t` also need the
Mac workaround.

In fastboot, there's a stray `lseek64` but since it's only for offset 0,
any kind of seek is fine.

Bug: N/A
Test: builds
Change-Id: I68b4f95202623ebf07ffe6c3e0e21437e7922c5b
2018-10-26 10:53:24 -07:00
Tom Cherry
fa79ae87f1 init: allow vendor init to action on any vendor or odm property
Partial revert of "init: if vendor_init can read a property, let it be
a trigger too" (b35f827c97).

We made a mistake when we allowed vendor init to action on any vendor
or odm property, since when a new SELinux label is created for a
vendor property, vendor_init does not automatically get read
permissions for it.

Recently, we tried to use read permissions instead of the built-in
list in init, but that broke due to the above mistaken.  Since we have
already launched with these permissions as is, we must restore them.

Bug: 118457755
Test: no denials for vendor init actionable properties on crosshatch
Change-Id: I7a9a560c9a54a177c6b83d28309e2f288f05d400
2018-10-26 08:50:45 -07:00
Treehugger Robot
52db49b68f Merge "libbase: a slightly cleaner solution to libbase's off64_t problem." 2018-10-26 15:38:14 +00:00
Treehugger Robot
a0dcfc2a0f Merge "libcutils: lose socket_peer_is_trusted to ART, the only user." 2018-10-26 15:37:55 +00:00
Elliott Hughes
46e0cc27ca libbase: a slightly cleaner solution to libbase's off64_t problem.
Given that I can't actually go back in time and just make bionic's
`off_t` be 64-bit.

Bug: N/A
Test: builds
Change-Id: Ic93336b07bffc0977bd0e9caad6a22ce29ca06ed
2018-10-25 16:29:02 -07:00
Treehugger Robot
dd85c74655 Merge "fastboot: Check that reboot to userspace succeeded." 2018-10-25 23:06:51 +00:00
Treehugger Robot
602f9a29b0 Merge "libbase: quick fix for Mac build." 2018-10-25 22:37:30 +00:00
Howard Ro
91061cc823 Merge "Make native metrics logger write to statsd socket" 2018-10-25 20:31:22 +00:00
Elliott Hughes
396bf2109a libcutils: lose socket_peer_is_trusted to ART, the only user.
Bug: N/A
Test: builds
Change-Id: I599270729c2037b2c06d7906a5e5f7362fbbaf08
2018-10-25 13:24:08 -07:00
David Anderson
629e51c109 fastboot: Resize logical partitions when using the flash command.
If an image size changes slightly in between "flashall" and some change
in the build, it's inconvenient to have to reflash the whole device again.
This patch resizes partitions when using a normal flash command, to
improve the developer workflow.

Bug: N/A
Test: fastboot flash system
Change-Id: I349364a4742a0c15748f545fcfda946107720d45
2018-10-25 20:10:20 +00:00
David Anderson
0444a8cbd9 fastboot: Check that reboot to userspace succeeded.
After rebooting to userspace fastboot, the first command issued is
"update-super". If we wound up in the bootloader by accident (as
happened to a few users with a busted vbmeta_system), the resulting
error message will be very misleading ("update-super" will be an
unrecognized command).

Instead, this patch explicitly errors if we did not successfully boot
into fastbootd.

Bug: N/A
Test: fastboot flashall
Change-Id: I7d5bd64db540978bd0bae884f40ce8c3df48f856
2018-10-25 12:31:49 -07:00
Treehugger Robot
89eb017780 Merge "liblp: Add an abstraction layer for opening partitions." 2018-10-25 18:55:47 +00:00
David Anderson
13e160e09f Merge "liblp: Store device information in a new block device table." 2018-10-25 18:54:55 +00:00
Elliott Hughes
985438653d libbase: quick fix for Mac build.
I'll come back for the better fix later...

Bug: N/A
Test: builds
Change-Id: I967c2436cf5816cf9a0edcd3f04f307969e48bcb
2018-10-25 10:23:55 -07:00
Elliott Hughes
2a8460721c Merge "libbase: add O_CLOEXEC to <android-base/file.h>." 2018-10-25 15:21:06 +00:00
Mark Salyzyn
cf81db320e Merge "fs_mgr: fs_mgr_overlayfs_teardown access to dynamic partition data" 2018-10-25 15:08:28 +00:00
Treehugger Robot
120383140e Merge "libbase: remove ARRAYSIZE_UNSAFE." 2018-10-25 03:13:30 +00:00
Treehugger Robot
9b6da16849 Merge "adb: Use a default _SC_GETPW_R_SIZE_MAX size" 2018-10-25 00:24:56 +00:00
Howard Ro
d173009c74 Make native metrics logger write to statsd socket
Previous submission of this change, aosp/790068, caused a failure in
sdk_mac for CLOCK_REALTIME and <endian.h> not being available.

Bug: 110537511
Test: compiles without failures and verified the correct metric
Change-Id: Iba1dc920ad82e88a4bcdd2feaee9a06202a440c2
2018-10-24 15:19:14 -07:00
Bill Yi
d4e20cd0f9 Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: I413bb086f5ff064430c061bdd5d0fe3d02925304
2018-10-24 14:48:45 -07:00
Elliott Hughes
514edae27c libbase: remove ARRAYSIZE_UNSAFE.
Also fix the indentation of a neighboring comment.

Bug: N/A
Test: builds
Change-Id: Iebe5f518b2ac14718f3cae91007e62b61bed9dc0
2018-10-24 14:34:52 -07:00
David Anderson
7a6c511a6d liblp: Add an abstraction layer for opening partitions.
This change introduces an IPartitionOpener abstraction. Methods that
interact with live metadata, such as ReadMetadata, UpdatePartitionTable,
and FlashPartitionTable, now require an IPartitionOpener object. Its
purpose is dependency injection: it will make these methods much easier
to test when the super partition spans multiple block devices.

All non-test consumers should be using PartitionOpener, and as such,
some helper methods have been added that automatically create one.

Bug: 116802789
Test: liblp_test gtest
      device with super partition boots
Change-Id: I76725a5830ef643c5007c152c00ccaad8085151f
2018-10-24 14:18:38 -07:00
David Anderson
9a5324178e liblp: Store device information in a new block device table.
This patch removes the alignment, block device size, and starting sector
fields from LpGeometry into a new LpMetadataBlockDevice struct. The
metadata now contains a table of these structs, and the table will have
exactly one entry representing the super partition.

This refactoring will make it easier to have logical partitions span
multiple physical partitions. When that happens, the table will be
allowed to have more than one entry, and the first entry of the table
will be considered the "root" of the super partition.

Bug: 116802789
Test: liblp_test gtest
      device with logical partitions flashes and boots
Change-Id: I97f23beac0363182cb6ae78ba2595860950afcf0
2018-10-24 14:18:35 -07:00
Elliott Hughes
32df7ee5c8 libbase: add O_CLOEXEC to <android-base/file.h>.
We already expose O_BINARY, and O_CLOEXEC seems equally legitimate.

Bug: N/A
Test: builds
Change-Id: I7f07e1bb2a5d6b5c5f293783c39ceab148fabefb
2018-10-24 14:06:45 -07:00
Suren Baghdasaryan
a1c684be4f Merge "lmkd: Add command to get number of kills" 2018-10-24 20:58:28 +00:00
Treehugger Robot
19fb58ce57 Merge "adb: correct tcpip help message" 2018-10-24 20:19:09 +00:00
Elliott Hughes
48a0e186a7 Merge "Add a simple MappedFile to libbase and switch fastboot and libziparchive over." 2018-10-24 20:16:59 +00:00
Robert Yang
88c997d4eb adb: Use a default _SC_GETPW_R_SIZE_MAX size
sysconf(_SC_GETPW_R_SIZE_MAX) may return −1 if there is no hard limit
on the the buffer size. Some libc implementations such as musl don't
define this limit and will return -1.

Use a default buffer size to handle this case.

Change-Id: I997b13a2c2dca00574e049a259135e61c8ed8e03
Signed-off-by: Robert Yang <decatf@gmail.com>
2018-10-24 15:23:55 -04:00
Treehugger Robot
0064e9ca1a Merge "Add adbd_test to presubmit test mapping" 2018-10-24 18:33:16 +00:00
bohu
ea0c3cbc18 adb: correct tcpip help message
'adb tcpip <mode>' is meant to affect adbd, not
the host adb server.

BUG: 111434128
Change-Id: I78c958bfbede60b20fb7e0f2444e5b21ecb90f7a
2018-10-24 10:38:33 -07:00
Suren Baghdasaryan
d4a29903c0 lmkd: Add command to get number of kills
Intrduce LMK_GETKILLCNT command for ActivityManager to get the number of
kills from lmkd.

Bug: 117126077
Test: used lmkd_unit_test to verify correct reporting
Change-Id: I09c720a7176b4df95efc544177cd2694f8d791be
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-24 17:18:32 +00:00
Anton Hansson
ac305c82d6 Merge "Create /data/preloads on post-fs-data" 2018-10-24 17:09:11 +00:00
Martin Stjernholm
0b4d4826a6 Merge "Remove unnecessary dynamic dependency on libbase." 2018-10-24 16:49:13 +00:00
Tom Cherry
76b4299943 Merge "init: if vendor_init can read a property, let it be a trigger too" 2018-10-24 15:52:06 +00:00
Martin Stjernholm
53aec482aa Remove unnecessary dynamic dependency on libbase.
This code only uses android-base/macros.h.

Bug: 118374951
Test: mmma system/core/libnativebridge && for f in out/host/linux-x86/nativetest{,64}/*/*; do $f; done
Change-Id: Ifa5a5a3c9370bd128ddd301ea352746699715929
2018-10-24 16:11:45 +01:00
Anton Hansson
c38a63646b Create /data/preloads on post-fs-data
This directory is used for preloads that are typically placed in
the system_other image and copied to /data on first boot if the
cppreopts script is installed.

Bug: 80508492
Test: make
Change-Id: I4121b07ee2fc96d533075d1907557de7e4be4ee0
2018-10-24 15:29:16 +01:00
Treehugger Robot
551efd11f7 Merge "Fix off by one error." 2018-10-24 00:52:15 +00:00
Christopher Ferris
afd6e7712f Merge "Always init gnu_debugdata interface if it exists." 2018-10-24 00:38:51 +00:00