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>
This change adds a DmTargetVerity class and replaces the existing verity
table builder in fs_mgr_avb.cpp. DmTargetVerity must be constructed with
all the required parameters for dm-verity. Additional arguments can be
appended via helper methods.
Bug: 110035986
Test: libdm_test gtest; boots with verity on AVB devices
Change-Id: I4fc2f7ef122c841e8b4ec4156177a6224ffbac30
This removes the custom ioctl code in fs_mgr_dm_linear.cpp in favor of
using libdm.
Bug: 110035986
Test: logical partitions are still created in first-stage init
Change-Id: I941a27ce865aa1bc712b91d8d4c874462e0d11df
Bug: http://b/69933090
Bug: http://b/69933068
MinGW uses gnu_printf to force C99 printf analysis with GCC, but clang
does not support gnu_printf. So just use the default that's used for
other platforms. This also mirrors upstream commit
015e637b4b/.
Test: m native-host-cross with Clang.
Change-Id: I3deb266d70e25296c4ae1d58637afbabc3d949c1
Bug: http://b/69933068
Bug: http://b/91353691: std::chrono_utils is not available in the
libstdc++ in the mingw/gcc prebuilts. They can be used once we switch
to using libc++ for Windows host.
Test: m native-host-cross with Clang
Change-Id: If9f0f1f201d5e4e445890075ad64c2d6086b0491
This change adds a LoopControl class for interacting with the loop
control device. In addition it provides a LoopDevice class for creating
temporary loop devices. This is aimed at being a building block for libdm
tests, so the current functionality is limited to attaching and
detaching file descriptors and finding free loop devices.
Bug: 110035986
Test: libdm_test gtest
Change-Id: Ice2891e3a44a037aff7b81c63ac793815640d582
Before, I was using p_vaddr to get the offset into the elf file where
the exidx frame starts. I changed that to use p_offset since this already
has the load bias offset in it and some elf files do not set p_vaddr
properly.
Also, use p_filesz instead of p_memsz, since again, some elf files do
not set p_memsz to the same as p_filesz.
Bug: 110704153
Test: All libbacktrace/libunwindstack unit tests pass.
Test: Randomly unwind process on a walleye.
Test: Verified that this properly dumps and unwinds the shared
Test: library that sets p_vaddr and p_memsz differently.
Change-Id: Ic7b1e5d07439f4636fa02cd884a8727a5737372b
This change implements the ability to get the path of a block device
given a device-mapper device name. In addition, dmctl now has a
"getpath" command to perform this query, as a shortcut for searching
through /sys/block/*/dm/name.
Bug: 110035986
Test: N/A
Change-Id: I9ebd824fa800004f591fc02fc1b1950e0c7fba65
This functionality is useful for improving boottimes on the ARC++
project. Without this change, ro.serialno would be set to the empty
string when androidboot.serialno was unset in the kernel commandline.
Bug: 62039211
Test: boot with androidboot.serialno unset and ensure ro.serialno is
unset
Change-Id: Iaee339dfa3f0c871e5e9c1fc0534347f2b3e8a07
These tests check that various aspects of liblp's on-disk management
are functioning as intended. This checks redundancy, metadata slot
management, and metadata update and readback.
Bug: 79173901
Test: liblp_test gtest
Change-Id: Ib780676e0f34f44aa255e8fcfded2ceb71fe3dce
This change implements DmTargetZero and DmTargetLinear, and integrates
them into dmctl. It also implements DmTarget and DmTable serialization.
Example dmctl invocation:
dmctl create my-device -ro \
linear 0 800 /dev/block/by-name/system 0 \
zero 800 1200 \
linear 1200 1500 /dev/block/by-name/system 1200
Bug: 110035986
Test: libdm_test gtest
Change-Id: I7f945c1d9e23cfb78239c23a1aad88e8aef4972b
This change refactors DmTarget. It was satisfying two separate use cases
that have no overlap: (1) as a container for informational queries, and
(2) for specifying table targets.
The kernel's nomenclature for the former is a "target type," so the new
class is named DmTargetTypeInfo.
In addition, this change adds a unit test for
DeviceMapper::GetAvailableTargets that ensures the device has at least a
linear target type (with more TBD).
Bug: 110035986
Test: libdm_test gtest
Change-Id: Icb87976801e8a1e6ec79e48b1d58c308d36279e5
This change implements DeviceMapper::LoadTableAndActivate by serializing
the given DmTable and issuing DM_TABLE_LOAD and DM_DEV_SUSPEND ioctls.
In addition, this makes the CreateDevice() method private, and
introduces a separate method for creating a device and loading a table
as a single operation. This will obviate the need for separate inactive
device cleanup logic later.
Note that this change does not yet implement DmTable::Serialize().
Bug: 110035986
Test: N/A
Change-Id: Ic8affe591db4930ce672b00db989978b57ca8cbf
This places libdm includes into a libdm folder, to match how many other
library includes are organized.
Bug: 110035986
Test: N/A
Change-Id: I430b0cf749c8d16265481864f1f33927fd740a53
This allows a product to selectively include binaries for the
partitions relevant to it. For example, mainline will only include
the system copies.
Bug: 80410283
Test: make
Change-Id: I1d1d62a3c8afff19cd45388adc323587f5043243
Let's start by fixing the build, then see how possible this will be to do fully.
Bug: 110477913
Test: n/a
Change-Id: If52e15bd070781a405c5494631ede033c1067903