From 81ae07509d3b911915a63dddcd83ac2398dd9583 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Mon, 30 Jul 2018 16:23:49 -0700 Subject: init: run fsck for early mount partitions Bug: 111883560 Test: fsck runs successfully during early mount Change-Id: I19bcd2610f87f5331f94c228fcbec8f9379fc5e8 --- init/init.cpp | 4 ++++ init/selinux.cpp | 2 ++ 2 files changed, 6 insertions(+) (limited to 'init') 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) { CHECKCALL(mknod("/dev/random", S_IFCHR | 0666, makedev(1, 8))); CHECKCALL(mknod("/dev/urandom", S_IFCHR | 0666, makedev(1, 9))); + // This is needed for log wrapper, which gets called before ueventd runs. + CHECKCALL(mknod("/dev/ptmx", S_IFCHR | 0666, makedev(5, 2))); + CHECKCALL(mknod("/dev/null", S_IFCHR | 0666, makedev(1, 3))); + // Mount staging areas for devices managed by vold // See storage config details at http://source.android.com/devices/storage/ 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() { if constexpr (WORLD_WRITABLE_KMSG) { selinux_android_restorecon("/dev/kmsg_debug", 0); } + selinux_android_restorecon("/dev/null", 0); + selinux_android_restorecon("/dev/ptmx", 0); selinux_android_restorecon("/dev/socket", 0); selinux_android_restorecon("/dev/random", 0); selinux_android_restorecon("/dev/urandom", 0); -- cgit v1.2.3-54-g00ecf