summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Cherry2018-07-30 18:23:49 -0500
committerTom Cherry2018-07-31 15:58:17 -0500
commit81ae07509d3b911915a63dddcd83ac2398dd9583 (patch)
tree2f6343505902173156cffa142eff9f0c279ab4bc
parent28fb130cbbd7c01ef706d5b6a5a9877b290f275c (diff)
downloadplatform-system-core-81ae07509d3b911915a63dddcd83ac2398dd9583.tar.gz
platform-system-core-81ae07509d3b911915a63dddcd83ac2398dd9583.tar.xz
platform-system-core-81ae07509d3b911915a63dddcd83ac2398dd9583.zip
init: run fsck for early mount partitions
Bug: 111883560 Test: fsck runs successfully during early mount Change-Id: I19bcd2610f87f5331f94c228fcbec8f9379fc5e8
-rw-r--r--fs_mgr/fs_mgr.cpp3
-rw-r--r--init/init.cpp4
-rw-r--r--init/selinux.cpp2
3 files changed, 9 insertions, 0 deletions
diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp
index b3df811e4..f9cebeb4d 100644
--- a/fs_mgr/fs_mgr.cpp
+++ b/fs_mgr/fs_mgr.cpp
@@ -1052,6 +1052,9 @@ int fs_mgr_do_mount_one(struct fstab_rec *rec)
1052 return FS_MGR_DOMNT_FAILED; 1052 return FS_MGR_DOMNT_FAILED;
1053 } 1053 }
1054 1054
1055 // Run fsck if needed
1056 prepare_fs_for_mount(rec->blk_device, rec);
1057
1055 int ret = __mount(rec->blk_device, rec->mount_point, rec); 1058 int ret = __mount(rec->blk_device, rec->mount_point, rec);
1056 if (ret) { 1059 if (ret) {
1057 ret = (errno == EBUSY) ? FS_MGR_DOMNT_BUSY : FS_MGR_DOMNT_FAILED; 1060 ret = (errno == EBUSY) ? FS_MGR_DOMNT_BUSY : FS_MGR_DOMNT_FAILED;
diff --git a/init/init.cpp b/init/init.cpp
index 6569871b8..57309651c 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -667,6 +667,10 @@ int main(int argc, char** argv) {
667 CHECKCALL(mknod("/dev/random", S_IFCHR | 0666, makedev(1, 8))); 667 CHECKCALL(mknod("/dev/random", S_IFCHR | 0666, makedev(1, 8)));
668 CHECKCALL(mknod("/dev/urandom", S_IFCHR | 0666, makedev(1, 9))); 668 CHECKCALL(mknod("/dev/urandom", S_IFCHR | 0666, makedev(1, 9)));
669 669
670 // This is needed for log wrapper, which gets called before ueventd runs.
671 CHECKCALL(mknod("/dev/ptmx", S_IFCHR | 0666, makedev(5, 2)));
672 CHECKCALL(mknod("/dev/null", S_IFCHR | 0666, makedev(1, 3)));
673
670 // Mount staging areas for devices managed by vold 674 // Mount staging areas for devices managed by vold
671 // See storage config details at http://source.android.com/devices/storage/ 675 // See storage config details at http://source.android.com/devices/storage/
672 CHECKCALL(mount("tmpfs", "/mnt", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, 676 CHECKCALL(mount("tmpfs", "/mnt", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV,
diff --git a/init/selinux.cpp b/init/selinux.cpp
index 94f206ede..b788be9d6 100644
--- a/init/selinux.cpp
+++ b/init/selinux.cpp
@@ -414,6 +414,8 @@ void SelinuxRestoreContext() {
414 if constexpr (WORLD_WRITABLE_KMSG) { 414 if constexpr (WORLD_WRITABLE_KMSG) {
415 selinux_android_restorecon("/dev/kmsg_debug", 0); 415 selinux_android_restorecon("/dev/kmsg_debug", 0);
416 } 416 }
417 selinux_android_restorecon("/dev/null", 0);
418 selinux_android_restorecon("/dev/ptmx", 0);
417 selinux_android_restorecon("/dev/socket", 0); 419 selinux_android_restorecon("/dev/socket", 0);
418 selinux_android_restorecon("/dev/random", 0); 420 selinux_android_restorecon("/dev/random", 0);
419 selinux_android_restorecon("/dev/urandom", 0); 421 selinux_android_restorecon("/dev/urandom", 0);