From 2679c1b1c53d3c7ff694c61c31db1cca9ea6c163 Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Fri, 22 Feb 2008 18:02:45 -0300 Subject: [PATCH] Mount /var/lock and /var/run as tmpfs Also create /var/run/console/ for X authentication Signed-off-by: Claudio Matsuoka --- Makefile | 2 +- finit-alt.c | 12 +++++++++--- finit-mod.c | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 190d797d..304ad26f 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ BINS = finit finit-mod finit-mdv #### Configurable parameters # Add -DDEBUG to build with debug messages, also drops to terminal after X -#CFLAGS += -DDEBUG +CFLAGS += -DDEBUG # Parameters added by Metalshark diff --git a/finit-alt.c b/finit-alt.c index b65353c3..b2472c75 100644 --- a/finit-alt.c +++ b/finit-alt.c @@ -171,6 +171,8 @@ int main() mount("devpts", "/dev/pts", "devpts", 0, "gid=5,mode=620"); mount("tmpfs", "/dev/shm", "tmpfs", 0, NULL); mount("tmpfs", "/tmp", "tmpfs", 0, "mode=1777,size=128m"); + mount("tmpfs", "/var/run", "tmpfs", 0, "mode=0755"); + mount("tmpfs", "/var/lock", "tmpfs", 0, "mode=1777"); mount(SYSROOT, "/", NULL, MS_MOVE, NULL); unlink("/etc/mtab"); @@ -251,13 +253,17 @@ int main() unlink(RANDOMSEED); umask(077); copyfile("/dev/urandom", RANDOMSEED, 4096); + umask(0); + + /* + * Console setup (for X) + */ + makepath("/var/run/console"); + touch("/var/run/console/" DEFUSER); /* * Misc setup */ - unlink("/var/run/.clean"); - unlink("/var/lock/.clean"); - umask(0); mkdir("/tmp/.X11-unix", 01777); mkdir("/tmp/.ICE-unix", 01777); umask(022); diff --git a/finit-mod.c b/finit-mod.c index 61626167..38f00670 100644 --- a/finit-mod.c +++ b/finit-mod.c @@ -40,6 +40,7 @@ Changelog from the original Eeepc fastinit: - Draw shutdown splash screen using C calls instead of system("echo;cat") - Change poweroff method from writing 5 to /sys/power/state to reboot(RB_POWER_OFF) (by Metalshark) +- Mount /var/run and /var/lock as tmpfs */ @@ -151,6 +152,8 @@ int main() mount("devpts", "/dev/pts", "devpts", 0, "gid=5,mode=620"); mount("tmpfs", "/dev/shm", "tmpfs", 0, NULL); mount("tmpfs", "/tmp", "tmpfs", 0, "mode=1777,size=128m"); + mount("tmpfs", "/var/run", "tmpfs", 0, "mode=0755"); + mount("tmpfs", "/var/lock", "tmpfs", 0, "mode=1777"); mount("/mnt", "/", NULL, MS_MOVE, NULL); /*