Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab4fbe1b authored by Josh Gao's avatar Josh Gao
Browse files

init: create /dev/urandom, /dev/random in first stage.

Create /dev/random and /dev/urandom in the first stage, so that when we
reexec, arc4random is available for libc initialization.

Bug: http://b/29622562
Change-Id: I5b2071539a17eec609faac91dc28b08eba5ff89b
parent 3f3ea508
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -588,6 +588,8 @@ int main(int argc, char** argv) {
        mount("sysfs", "/sys", "sysfs", 0, NULL);
        mount("selinuxfs", "/sys/fs/selinux", "selinuxfs", 0, NULL);
        mknod("/dev/kmsg", S_IFCHR | 0600, makedev(1, 11));
        mknod("/dev/random", S_IFCHR | 0666, makedev(1, 8));
        mknod("/dev/urandom", S_IFCHR | 0666, makedev(1, 9));
        early_mount();
    }

@@ -638,6 +640,8 @@ int main(int argc, char** argv) {
    restorecon("/dev");
    restorecon("/dev/kmsg");
    restorecon("/dev/socket");
    restorecon("/dev/random");
    restorecon("/dev/urandom");
    restorecon("/dev/__properties__");
    restorecon("/property_contexts");
    restorecon_recursive("/sys");