The existing APIs will truncate the byte array in case of '\0' in between.
Test: test_drive with atom 103
Change-Id: I104d35b330c6b52e2fdce1f5d4305dca08228f1b
* changes:
fs_mgr: overlay: use alternate for backing storage
fs_mgr: overlay: split out fs_mgr_overlayfs_create_scratch()
fs_mgr: overlay: split out fs_mgr_overlayfs_make_scratch()
Let libsysutils able to be statically linked by libnetd_resolv to
minimize the dependence on system ABI.
Test: m libsysutils
Change-Id: Ideb322dbc8d594a8a37d64f8140bc37090a4e238
A symlink for TARGET_ROOT_OUT as a post install command of a package
that is also installed to TARGET_ROOT_OUT. We hijack init.rc which
satisfies this requirement for this symlink.
Bug: 120402274
Bug: 120460755
Bug: 120509320
Bug: 120554662
Test: symlink is created
Test: make bootimage && ls -la $OUT/root/init
Change-Id: I6f1ac06ef152c36d7d7db4618d49a008338da39b
When we have multiple physical super partitions, it is prudent to
take the alternate super physical partition in its raw entirety
rather than to construct a logical partition out of the current
super partition's limited remaining space.
SideEffect: alternate boot partitions destroyed for the sake of debug
Test: adb-remount-test.sh (including manually disabled to check
both code paths).
Bug: 119885423
Change-Id: I368d3a5619f69de3b0d1fcad73c4b42d25d0d969
Asan requires /proc to be mounted, which means it fundamentally cannot
be used with first stage init. Given that second stage init now
contains the logic for first stage init, asan must be disabled on all
of init until this can be resolved.
Bug: 120424438
Bug: 120561310
Test: Asan builds boot
Change-Id: I24d1a0c8ecb5eb3f77435e6e36432c7b4cb97c6a
Currently bionic only stores the first invocation of
android_set_abort_message, libbase splits the logging invocations
into discrete lines, and liblog automatically calls bionic when
fatal severity is used. This leads to only the first line of
LOG(FATAL) being stored for tombstoned.
Eagerly set the abort message directly before logging when the
severity is FATAL. This ensures the complete message will be
available.
Bug: 120506942
Test: m
Test: manual
Change-Id: I104d6960a2b1f66f21f5ada383fb4ab0f35e96a9
This will be used by heapprofd to allow us to correlate build ids with
memory leaks in libraries and binaries.
Test: m
Test: host libunwindstack_test
Test: run unwind_info against my phone's libc.so (32/64) and compare
to readelf Build ID output.
Bug: 120186412
Change-Id: I3cefd6cce9a8733509bf35b7175eb0f967783477
On non-DAP devices, fastboot flash <partition> will spam error messages
about not being able to read super_empty.img. We should check that
super_empty.img exists before trying to read it.
Bug: 120429424
Test: fastboot flash system on non-DAP device
Change-Id: I6c4eec19cb3ef8d24595a75e072e1d75baaa8cdd
Modernize a bit of code in preparation for the rest of the
modernization. Use more unique_fd and fix a few fd leaks in the
process.
Bug: 62292478
Test: boot
Change-Id: I2a6f1abaa1b9a4e979baea36764b91157c2ed218
In the non-retrofit case, the metadata source partition will be
hardcoded as "super", but such a partition may not exist or may have
been overridden by super_partition=<something>. Make this work reliably
by plumbing the resolved metadata block device through, and using it any
time a partition called "super" is requested.
This also fixes a case in the first_stage_mount code that assumed that
detected a non-A/B, non-retrofit case by assuming the metadata source
partition would be called "super".
Bug: 113175337
Test: boot test on cuttlefish
Change-Id: I8ce1defb902e257eeb7170d697b378eba31faee3
Provide a means to determine if overlayfs is currently active with
fs_mgr_overlayfs_is_setup(). Search for current clues in the system
that the overrides are in play. If /mnt/scratch/ is mounted, that
may be enough of a smoking gun because the resource itself may
interfere with operations.
Related to update_engine calling this function to reject performing
an OTA as its operations are incompatible with the overrides.
Test: adb-remount-test.sh
Bug: 120034852
Change-Id: I641163b1559c1a83fe7d0c336d04c10e9956ad3a
Now that we have a first stage ramdisk (or use recovery in its place),
it's possible to place a vendor specific fstab along with first stage
init, removing the need for device tree modifications to have an
fstab.
Bug: 117933812
Test: hikey boots with only an fstab in first stage ramdisk
Test: blueline mainline boots with a disabled DT fstab and an fstab in recovery
Change-Id: I4460b88851557a75ba06ff795cd842e7dfb6da46
If we have multiple keys available for authentication (ADB_VENDOR_KEYS
+ the one in ~/.android), we will still have keys in our list of
avilable keys after we've successfully connected. A subsequent
reconnection will start authorizing using the list of keys after the
key that actually worked, resulting in that session being unauthorized
until another reconnection happens. Clear the key list before
reconnecting to fix this. (We could do this after successfully
connecting, but we need to do this before reconnecting anyway, because
our connection could have died during authorization.)
Bug: http://b/117267347
Test: `adb connect foo; adb -s foo reconnect device` with ADB_VENDOR_KEYS
Change-Id: Ieb7dcc28e333c89ae0d75f97e89bcd1b571cb299
When allocating "b" partitions on a non-retrofit A/B device, prioritize
regions occuring in the second half of the super partition. To make this
effective, the region covering the midpoint sector is split into two
additional regions.
This will allow OTAs to avoid unecessary fragmentation, since each
slot's partitions will be grouped together, leaving a large chunk of
contiguous space available when the OTA deletes the target slot. Since
updates are not allowed to consume more than half of the super
partition, this should guarantee one extent per partition. Note that, if
this restriction is not in place (for example, a developer flashes a
massive "system_b"), then an additional extent will be allocated due to
the region that was split.
Bug: 120433288
Test: liblp_test gtest
Change-Id: I1797e59e14c8b0d4d0e6855a1d984e8159b21df2
It was discovered that we were building some objects inconsistently due
to an optimization in cc_library to only build objects once and use them
for both the static and shared libraries. But static libraries didn't
get system_shared_libs set automatically, and we didn't notice that we
would have built the objects differently.
So static libraries now get the default system_shared_libs, we allow
adjusting that for static vs shared in a cc_library, and we disable the
optimization if the linked libraries are configured differently between
static and shared in a single cc_library.
This triggers dependency cycles for static libraries that libc/libdl
use, so fix those cycles here.
Test: treehugger
Change-Id: I6ec2ea45292b602d5c506560de8b8d6ae725be6f
Found a device with a 3/4MB erase block, give a wider margin so that
flashing a single partition is unlikely to be blocked by scratch.
Add documentation to tell developers to flashall to clear scratch.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: Ic219283f4c42e457b98991bcd1752253e182eff3
Increase size of the NETLINK_KOBJECT_UEVENT socket receive buffer to
16M. Also, use SO_RCVBUFFORCE to override any limits set by
/proc/sys/net/core/rmem_max.
We had a couple of instances, where we lost critical uevent messages due
to receive buffer overflows.
Bug: 119933843
Change-Id: I6aab183aa0194e173f9175b47c6beb0835cf6675