This way native bridge namespace could be acquired in advance and when
library must be loaded JNIEnv is not needed.
Bug: http://b/79940628
Test: cts-tradefed run commandAndExit cts -m CtsGpuToolsHostTestCases
Change-Id: If8bff272fc5245eb4e418807c3bdd29e82833ab8
There's still <cutils/atomic.h> in a test, but I don't understand why
that isn't just std::atomic.
Also add a shared tgkill wrapper to libbase.
Bug: N/A
Test: ran tests
Change-Id: Idd4baa1e1670a84b3a8f35803cc5ffe5aae008a6
This change makes the internal UpdatePartitionTable function more
testable by parameterizing its write functions. It also adds two tests,
one of which exposes a flaw in the current implementation.
Bug: 79173901
Test: liblp_test gtest
Change-Id: I3c4112794b97d577a27f035baeac2d42ac75f552
This change separates the WritePartitionTable function into two separate
functions: FlashPartitionTable and UpdatePartitionTable. This will be
cleaner than having extra unnecessary parameters and makes it clearer
when to call each one.
The motivation for this change is to improve the reliability of
UpdatePartitionTable() and to be able to simulate I/O failures for
testing.
Bug: 79173901
Test: liblp_test gtest
Change-Id: Iee5eb2e99fb76aef0b93a65bf85a89907e7cd9bf
/ should not have any character/block devices, so might as well pass in
the nodev flag.
Bug: 73255020
Test: aosp_sailfish still boots
Test: sailfish:/ # find / -xdev -a \( -type b -o -type c -o -type p -o -type s \)
sailfish:/ #
Test: rootfs on / type rootfs (rw,seclabel)
/dev/root on / type ext4 (ro,seclabel,nodevrelatime)
Change-Id: Ia73e04b53a47506892d9d3cb61b471b81bb72dc3
escape_arg reuses the same index for the source (s) and the destination
(result), so it breaks on strings containing more than one quote, e.g:
* a'b'c ==> 'a'\''b'c'
* a'bcde'f ==> 'a'\''b'\'cde'f'
Also make the function more efficient by doing fewer string copies. This
code is based on the android::base::Split code.
Use EXPECT_EQ because the tests can keep going if one fails.
Bug: none
Test: adb_test --gtest_filter=adb_utils.escape_arg
Change-Id: I6ca6e905fa53cc61b9a87276cb7116a5df7e8017
We shipped (well, are about to ship) an adbd that spuriously fails to
create directories upon push. Work around this in the adb client by
running a mkdir on all of the directories we would have otherwise
created.
On devices where we perform the workaround, this coincidentally fixes
a historic bug where we failed to push empty directories.
Bug: http://b/25566053
Bug: http://b/110953234
Test: python test_device.py
Change-Id: I690ec356c206fed4e5ab2c681c5570c8b231e26b
Block devices in the Linux kernel have a "minimum I/O request" size. The
minimum size is usually acquired by the block driver and can change
from device to device. When stacking devices (such as with
device-mapper), the kernel goes through great lengths to make sure this
alignment is respected for optimal I/O. In device-mapper's case,
misalignment can lead to kernel warnings and performance issues.
While this is unlikely to matter with a few targets, it could become
problematic on a large number of targets, and so we would prefer to
align all partition extents to the minimum I/O size.
We now support two new properties in the partition table geometry: an
"alignment", which is the minimum I/O size, and an "alignment offset",
which is an offset that when applied to sector 0, causes the sector to
be properly aligned within its parent device (for example, if a
physical partition is misaligned). All partition extents now begin on a
sector that respects this alignment.
One major caveat is that it is difficult for the initial partition table
to have the correct alignment without build system and/or flash tool
support. To accomodate this, all alignment is optional, and the lpmake
tool will support a default alignment of 1MiB as a failsafe.
Bug: 79173901
Test: liblp_test gtest
Change-Id: I5bc41b90aa085f4f30393951af0d2b37c4ac2a72
When security.perf_harden is disabled through adb, use some debug
system properties to set profiling limits in the kernel, including
cpu percentage, memory, and max sample rate.
Bug: 110706031
Test: boot hikey960 and manually set system properties to make
Test: sure it works.
Change-Id: I44c0adf3a000bb393905233f2a097c97b5fe91ec
When pushing to a path, we first try to ensure the directory path
exists and has the permissions expected by fs_config. Due to a change
that changed the fs_config check from a blacklist to a whitelist, we
started doing this for /data (which doesn't begin with /data/), and the
UID/GID for that path was accidentally being reused for following path
segments that didn't exist, leading to a failed attempt to chown
/data/local/tmp/foo to be owned by system.
Bug: http://b/110953234
Test: python test_device.py
Change-Id: Ie798eec48bcf54aea40f6d90cc03bb2170280ee8
Retain the last four reboot reasons from latest to oldest, adding a
detail of UTC epoch time for each. Beef up boot_reason_test.sh to
deal with multi-line content.
Test: boot_reason_test.sh
Bug: 110925971
Change-Id: Ie2600434b95a885693f005a363ee38d9eba18ee7
1. init creates /mnt/product used to mount product-specific rw partitions.
2. If a device tree fstab entry for early mount specifies a mount point
under /mnt/product e.g. /mnt/product/foo, init will create
/mnt/product/foo mount point.
Bug: 110808288
Test: change dt fstab entry to mount /mnt/product/foo; mount point is
created correctly, and partition is mounted in early mount.
Change-Id: I321e314992abe1084fd67a382c205f5c0c92bf3d