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
By changing to a std:function from a plain function pointer as an
argument to fs_mgr_update_verity_state(), a lambda with captured
objects can be executed providing thread safety.
Test: compile and boot
Bug: 109821005
Change-Id: I2699a08cc2c5216625dcbf84eeac0c460f4ae36a
Modify the code for the no header sections because it turns out that
it is not okay to assume that the fdes are non-overlapping. It's necessary
to read the fdes in order and match as you go.
Modify the code so that it only reads until it finds the given pc rather than
reading all of the cie/fde entries at once.
Rewrote the tests to verify the new behavior.
Bug: 68998033
Bug: 110235461
Test: Ran libbacktrace/libunwindstack unit tests.
Test: Unwind the mediaserver process on a walleye and verify it
Test: unwinds properly.
Change-Id: I7bb59d1db72c13fa34caa9735ec34c1a60e20ed2
Generate fstab from /proc/mounts. Basically like any regular fstab
minus the requirement for the Android fs_mgr_flags. Added a unit
test to confirm that fs_mgr_read_fstab("/proc/mounts") matches the
setmntent("/proc/mounts")+getmntent() content.
As a result, discovered a bug in parse_flags that would report "ro"
if the "rootcontext=..." flag was referenced.
Test: fs_mgr_unit_test
Bug: 109821005
Change-Id: I635ee979e11ee089b09adbedb5f42b6ba78026de
This change introduces a new GetTableStatus method on DeviceMapper,
which returns a vector of information about each target in a device's
table. Some target types (such as verity) can also return additional
information as a string.
Support for this call has also been added to the "dmctl" tool via a
"table" command. Examples:
$ dmctl create blah zero 0 8000 linear 8000 1000 /dev/block/sdd1 0
$ dmctl table blah
Targets in the device-mapper table for blah:
0-8000: zero
8000-9000: linear
For verity:
sailfish:/ # dmctl table system
Targets in the device-mapper table for system:
0-4128792: android-verity, V
Bug: 110035986
Test: libdm_test gtest; AVB1 device still boots
Change-Id: Iaf13450d3b32e2264c7c399a8af8d6bade260592
This change adds the ro.boot.disable_runas system property, that when
set, disables the run-as command. This is done to reduce the surface
area of programs that have file based capabilities in Chrome OS, and
what they can do when running in non-developer mode.
Bug: 31630024
Test: run-as still works in aosp_sailfish
Test: run-as still works in Android in Chrome OS (in developer mode)
Change-Id: Iaf1d6f9ceb65081b7a9e17b9b91d8855e4080133
* changes:
Do not customize __format__ for Windows/MinGW to gnu_printf
Adapt to switch to Clang for Windows host builds
Update cflags for building Windows modules with Clang
This change uses libdm to replace the hand-coded ioctl code in fs_mgr_verity.
Since AVB2 is now preferred to AVB1, this is a surgical change to allow
us to remove fs_mgr_dm_ioctl. Rather than refactor the target string
construction code, we instead provide a DmTargetVerityString class which
passes a raw parameter string directly to DmTable.
Bug: 110035986
Test: AVB1 device still boots
Change-Id: Iad88993a98abb388a12cec9e6d4543dfb4157414
After dealing with some specical escape characters('\n','\r','\t','\\',"\r\n")
it doesn't goto the next position in the next loop, so it process the current
character twice.
For example, when parsing the string "test\ntoken" we expect the
"test'\n'token" but actually we got the "test'\n'ntoken"
Test: have espace characters in init .rc files
Change-Id: I015c087a5c6e5ee9c490f29a83b15b89443f7f81
Signed-off-by: liwugang <liwugang@xiaomi.com>