Loading init/Android.mk +0 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,6 @@ LOCAL_REQUIRED_MODULES := \ # Set up the directories that first stage init mounts on. LOCAL_POST_INSTALL_CMD := mkdir -p \ $(TARGET_RAMDISK_OUT)/apex \ $(TARGET_RAMDISK_OUT)/debug_ramdisk \ $(TARGET_RAMDISK_OUT)/dev \ $(TARGET_RAMDISK_OUT)/mnt \ Loading init/first_stage_init.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -204,10 +204,6 @@ int FirstStageMain(int argc, char** argv) { // part of the product partition, e.g. because they are mounted read-write. CHECKCALL(mkdir("/mnt/product", 0755)); // /apex is used to mount APEXes CHECKCALL(mount("tmpfs", "/apex", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, "mode=0755,uid=0,gid=0")); // /debug_ramdisk is used to preserve additional files from the debug ramdisk CHECKCALL(mount("tmpfs", "/debug_ramdisk", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, "mode=0755,uid=0,gid=0")); Loading init/init.cpp +18 −1 Original line number Diff line number Diff line Loading @@ -512,10 +512,24 @@ void HandleKeychord(const std::vector<int>& keycodes) { static void UmountDebugRamdisk() { if (umount("/debug_ramdisk") != 0) { LOG(ERROR) << "Failed to umount /debug_ramdisk"; PLOG(ERROR) << "Failed to umount /debug_ramdisk"; } } static void MountExtraFilesystems() { #define CHECKCALL(x) \ if ((x) != 0) PLOG(FATAL) << #x " failed."; // /apex is used to mount APEXes CHECKCALL(mount("tmpfs", "/apex", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, "mode=0755,uid=0,gid=0")); // /linkerconfig is used to keep generated linker configuration CHECKCALL(mount("tmpfs", "/linkerconfig", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, "mode=0755,uid=0,gid=0")); #undef CHECKCALL } static void RecordStageBoottimes(const boot_clock::time_point& second_stage_start_time) { int64_t first_stage_start_time_ns = -1; if (auto first_stage_start_time_str = getenv(kEnvFirstStageStartedAt); Loading Loading @@ -656,6 +670,9 @@ int SecondStageMain(int argc, char** argv) { UmountDebugRamdisk(); } // Mount extra filesystems required during second stage init MountExtraFilesystems(); // Now set up SELinux for second stage. SelinuxSetupKernelLogging(); SelabelInitialize(); Loading init/mount_namespace.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,11 @@ bool SetupMountNamespaces() { // the bootstrap namespace get APEXes from the read-only partition. if (!(MakePrivate("/apex"))) return false; // /linkerconfig is a private mountpoint to give a different linker configuration // based on the mount namespace. Subdirectory will be bind-mounted based on current mount // namespace if (!(MakePrivate("/linkerconfig"))) return false; bootstrap_ns_fd.reset(OpenMountNamespace()); bootstrap_ns_id = GetMountNamespaceId(); Loading init/selinux.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -531,6 +531,8 @@ void SelinuxRestoreContext() { selinux_android_restorecon("/dev/device-mapper", 0); selinux_android_restorecon("/apex", 0); selinux_android_restorecon("/linkerconfig", 0); } int SelinuxKlogCallback(int type, const char* fmt, ...) { Loading Loading
init/Android.mk +0 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,6 @@ LOCAL_REQUIRED_MODULES := \ # Set up the directories that first stage init mounts on. LOCAL_POST_INSTALL_CMD := mkdir -p \ $(TARGET_RAMDISK_OUT)/apex \ $(TARGET_RAMDISK_OUT)/debug_ramdisk \ $(TARGET_RAMDISK_OUT)/dev \ $(TARGET_RAMDISK_OUT)/mnt \ Loading
init/first_stage_init.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -204,10 +204,6 @@ int FirstStageMain(int argc, char** argv) { // part of the product partition, e.g. because they are mounted read-write. CHECKCALL(mkdir("/mnt/product", 0755)); // /apex is used to mount APEXes CHECKCALL(mount("tmpfs", "/apex", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, "mode=0755,uid=0,gid=0")); // /debug_ramdisk is used to preserve additional files from the debug ramdisk CHECKCALL(mount("tmpfs", "/debug_ramdisk", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, "mode=0755,uid=0,gid=0")); Loading
init/init.cpp +18 −1 Original line number Diff line number Diff line Loading @@ -512,10 +512,24 @@ void HandleKeychord(const std::vector<int>& keycodes) { static void UmountDebugRamdisk() { if (umount("/debug_ramdisk") != 0) { LOG(ERROR) << "Failed to umount /debug_ramdisk"; PLOG(ERROR) << "Failed to umount /debug_ramdisk"; } } static void MountExtraFilesystems() { #define CHECKCALL(x) \ if ((x) != 0) PLOG(FATAL) << #x " failed."; // /apex is used to mount APEXes CHECKCALL(mount("tmpfs", "/apex", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, "mode=0755,uid=0,gid=0")); // /linkerconfig is used to keep generated linker configuration CHECKCALL(mount("tmpfs", "/linkerconfig", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, "mode=0755,uid=0,gid=0")); #undef CHECKCALL } static void RecordStageBoottimes(const boot_clock::time_point& second_stage_start_time) { int64_t first_stage_start_time_ns = -1; if (auto first_stage_start_time_str = getenv(kEnvFirstStageStartedAt); Loading Loading @@ -656,6 +670,9 @@ int SecondStageMain(int argc, char** argv) { UmountDebugRamdisk(); } // Mount extra filesystems required during second stage init MountExtraFilesystems(); // Now set up SELinux for second stage. SelinuxSetupKernelLogging(); SelabelInitialize(); Loading
init/mount_namespace.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,11 @@ bool SetupMountNamespaces() { // the bootstrap namespace get APEXes from the read-only partition. if (!(MakePrivate("/apex"))) return false; // /linkerconfig is a private mountpoint to give a different linker configuration // based on the mount namespace. Subdirectory will be bind-mounted based on current mount // namespace if (!(MakePrivate("/linkerconfig"))) return false; bootstrap_ns_fd.reset(OpenMountNamespace()); bootstrap_ns_id = GetMountNamespaceId(); Loading
init/selinux.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -531,6 +531,8 @@ void SelinuxRestoreContext() { selinux_android_restorecon("/dev/device-mapper", 0); selinux_android_restorecon("/apex", 0); selinux_android_restorecon("/linkerconfig", 0); } int SelinuxKlogCallback(int type, const char* fmt, ...) { Loading