system/core
修訂 | b18aba0a9ffae61e5bc697f3a532eaab0d6a4161 (tree) |
---|---|
時間 | 2019-04-03 06:22:27 |
作者 | Mark Salyzyn <salyzyn@goog...> |
Commiter | Mark Salyzyn |
fs_mgr: remount: system is root
For devices without overlayfs and system is root (Hikey, Hikey960)
correct "/system" to "/" if that is the mount point.
Test: adb-remount-test.sh
Bug: 129720614
Change-Id: I3bdbd5ea7b70d03477055e60521d8132b486c904
@@ -340,6 +340,7 @@ int main(int argc, char* argv[]) { | ||
340 | 340 | blk_device = rentry.blk_device; |
341 | 341 | break; |
342 | 342 | } |
343 | + // Find overlayfs mount point? | |
343 | 344 | if ((mount_point == "/") && (rentry.mount_point == "/system")) { |
344 | 345 | blk_device = rentry.blk_device; |
345 | 346 | mount_point = "/system"; |
@@ -352,6 +353,12 @@ int main(int argc, char* argv[]) { | ||
352 | 353 | } |
353 | 354 | fs_mgr_set_blk_ro(blk_device, false); |
354 | 355 | |
356 | + // Find system-as-root mount point? | |
357 | + if ((mount_point == "/system") && !GetEntryForMountPoint(&mounts, mount_point) && | |
358 | + GetEntryForMountPoint(&mounts, "/")) { | |
359 | + mount_point = "/"; | |
360 | + } | |
361 | + | |
355 | 362 | // Now remount! |
356 | 363 | if (::mount(blk_device.c_str(), mount_point.c_str(), entry.fs_type.c_str(), MS_REMOUNT, |
357 | 364 | nullptr) == 0) { |