From 25e9d846735a78c4a2e492526ba93e9808969a4d Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Wed, 25 Jun 2008 19:10:36 -0300 Subject: [PATCH] Add experimental mountdev option If "mountdev" is specified in /etc/finit.conf, finit-alt will try to mount tmpfs on /dev prior to creating device nodes. Signed-off-by: Claudio Matsuoka --- finit-alt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/finit-alt.c b/finit-alt.c index 4181a030..95eb089b 100644 --- a/finit-alt.c +++ b/finit-alt.c @@ -189,6 +189,7 @@ int main() char username[USERNAME_SIZE] = DEFUSER; char hostname[HOSTNAME_SIZE] = "eviltwin"; char cmd[CMD_SIZE]; + int mountdev = 0; #ifdef USE_ETC_RESOLVCONF_RUN DIR *dir; struct dirent *d; @@ -283,6 +284,10 @@ int main() system(cmd); continue; } + if (MATCH_CMD(line, "mountdev", x)) { + mountdev = 1; + continue; + } } fclose(f); } @@ -311,12 +316,14 @@ int main() mount("none", "/proc/bus/usb", "usbfs", 0, NULL); mount(SYSROOT, "/", NULL, MS_MOVE, NULL); + if (mountdev) + mount("none", "/dev", "tmpfs", 0, "mode=0755"); + #ifdef MAKE_DEVICES mkdir("/dev/input", 0755); chardev("/dev/urandom", 0666, 1, 9); chardev("/dev/ptmx", 0666, 5, 2); chardev("/dev/null", 0666, 1, 3); - //chmod("/dev/null", 0666); /* blino's sanity check */ chardev("/dev/mem", 0640, 1, 1); chardev("/dev/tty0", 0660, 4, 0); chardev("/dev/input/mice", 0660, 13, 63);