This patch introduces a new "groups" table in the super partition
metadata. Each entry denotes a named partition group with a maximum
size. All partitions now belong to a group, and the total size of
partitions in a group must not exceed its maximum size. This is enforced
by MetadataBuilder.
There is also a "default" group with no size restriction. This is used
for one-off partitions that aren't restricted by updates, for example,
the scratch partition for overlayfs, or partitions created through
fastbootd.
Bug: 116817738
Test: liblp gtest
Change-Id: I7049ffd35d326e41e25d01b1748cb53a584783a7
* Need a body and return value for this function
so the constexpr check can inline it.
* C mode can just use an extern function declaration, but not constexpr.
Bug: 116854606
Bug: 111614304
Test: build with WITH_TIDY=1 and enable static analyzer checks
Change-Id: Ie3f4efbcabed99416d196b6c361a772b8c6a4035
By adding the root context, we cause an issue with kernel security
profile, the kernel can kick back overlay mounts because the sepolicy
is not initialized.
observable error when we have root context setup:
SELinux: Unable to set superblock options before the security\
server is initialized
init: [libfs_mgr]__mount(source=overlay,target=/system,\
type=overlay,upperdir=/cache/overlay/system/upper)=-1:\
Invalid argument
root context was added initially due to paranoia, so the side effects
are non existent unless upperdir sepolicy is adjusted.
Test: manual
Bug: 109821005
Change-Id: Id218add0a32df3b2a4626d8cb8aa783760c78cc4
fs_mgr_overlayfs_mount_all() should pick up /system even if device tree
does not specify / or /system.
Because of change where we pass fstab to fs_mgr_overlayfs_mount_all(),
/ (or rather /system) overlayfs mount got shifted to early init and
did not occur in first stage init. We need the assumption that /
mount is implied when not specified in the dt fstab to be considered
by overlayfs logic.
Test: manual
Bug: 109821005
Bug: 115751838
Change-Id: Ia8fc5d8e8cc50c66197a91efa80e46d66c2d108d
Sparse images with CRC are currently not supported by the
Android build system.
Test: ./fuzzy_fastboot --gtest_filter=Conformance.*
Change-Id: I6a73fb0dc5d4c77a3d1a0384c137789eb06fa956
This reverts commit 17a65497bb.
Reason for revert: Dependencies which broke tests due to exclusion from LOCAL_JNI_SHARED_LIBS have been added.
Change-Id: I51e8ea7072026f233cd4a6c7e2142d92603af1f9
This reverts commit f23fa3b12f.
Reason for revert: This breaks framework tests and blocks presubmit
Change-Id: Iccf29d7499c378c611ea5a783074865febf8514e
Currently `adb remount` won't remount symlink mount points.
In Android Generic System Image, there is a symlink
/product -> /system/product for devices with and without a physical
/product partition to work, respectively:
- Mount product partition under /system/product via
'mount /product' OR
- Keep using /product -> /system/product symlink,
when no product partition
Currently find_proc_mount() is seeking "/product" under /proc/mounts.
But the actual mount path is "/system/product" when GSI is used
on a device with product partition.
Bug: 111539442
Test: adb remount && touch /product/abc on both GSI and non-GSI
Change-Id: I8f15a67109d0a3f4ee18596ef7eb4280c5631b11
Remove unnecessary content from logging. PERROR implies failure,
and logging reports source, so no need to fortify.
Test: compile
Bug: 109821005
Change-Id: Ie25de6ec35dd1890e9a14ecee96956e743a2a91c
By telling us that the target or source is missing for ENOENT, we
can triage whether it is a build/configuration problem or a driver
problem. Two engineers spend more than a few hours investigating
a build problem rationalizing adding this instrumentation.
Test: compile
Bug: 109821005
Change-Id: I1ecc6230ebee128c0963d6020787230c1e2fb8c1
Also stop using size_t (which will be 32-bit on Win32) for offsets in
adb_sideload_host, and stop truncating large file sizes in our
"sideload-host" messages.
Bug: http://b/112003354
Test: builds
Change-Id: If5b7cc9d1fc7ff7ca6eaebd20418f7b061846203