summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Cherry2018-08-01 16:02:35 -0500
committerGerrit Code Review2018-08-01 16:02:35 -0500
commit6e05552e357b97403ffa73d8feaf6431689d28a1 (patch)
tree42b18b935aa6e546f1dc12f8d02e37c930b9c7dc
parent10601fd5126590a8667a8ac9e98c0f3cbb56c435 (diff)
parent81ae07509d3b911915a63dddcd83ac2398dd9583 (diff)
downloadplatform-system-core-6e05552e357b97403ffa73d8feaf6431689d28a1.tar.gz
platform-system-core-6e05552e357b97403ffa73d8feaf6431689d28a1.tar.xz
platform-system-core-6e05552e357b97403ffa73d8feaf6431689d28a1.zip
Merge "init: run fsck for early mount partitions"
-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 73194bdd9..7ad9ec396 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -670,6 +670,10 @@ int main(int argc, char** argv) {
670 CHECKCALL(mknod("/dev/random", S_IFCHR | 0666, makedev(1, 8))); 670 CHECKCALL(mknod("/dev/random", S_IFCHR | 0666, makedev(1, 8)));
671 CHECKCALL(mknod("/dev/urandom", S_IFCHR | 0666, makedev(1, 9))); 671 CHECKCALL(mknod("/dev/urandom", S_IFCHR | 0666, makedev(1, 9)));
672 672
673 // This is needed for log wrapper, which gets called before ueventd runs.
674 CHECKCALL(mknod("/dev/ptmx", S_IFCHR | 0666, makedev(5, 2)));
675 CHECKCALL(mknod("/dev/null", S_IFCHR | 0666, makedev(1, 3)));
676
673 // Mount staging areas for devices managed by vold 677 // Mount staging areas for devices managed by vold
674 // See storage config details at http://source.android.com/devices/storage/ 678 // See storage config details at http://source.android.com/devices/storage/
675 CHECKCALL(mount("tmpfs", "/mnt", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, 679 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);