simple-init

A set of init binaries for linux
git clone git://depsterr.com/git/simple-init
Log | Files | Refs | README | LICENSE

commit 4cca13cd8fc3e69ba96fc9bd82aa9e4a920b2550
parent 721228ee36b20c292d98c518ac66de5b4322348b
Author: depsterr <depsterr@protonmail.com>
Date:   Sun, 31 May 2020 15:53:01 +0200

optimized init script

Diffstat:
Minitscripts/init.c | 9++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/initscripts/init.c b/initscripts/init.c @@ -11,13 +11,10 @@ int main() { log_message("Mounting pseudo filesystems"); mount("nosuid,noexec,nodev", "proc", "proc", "/proc" ); - WAIT_FOR_CHILDREN; mount("nosuid,noexec,nodev", "sysfs", "sys", "/sys" ); - WAIT_FOR_CHILDREN; mount("mode=0755,nosuid,nodev", "tmpfs", "run", "/run" ); WAIT_FOR_CHILDREN; mount("mode=0755,nosuid", "devtmpfs", "dev", "/dev" ); - WAIT_FOR_CHILDREN; mkdir("/dev/runit", 0755); mkdir("/run/user" , 0755); @@ -26,9 +23,9 @@ int main() { mkdir("/dev/pts" , 0755); mkdir("/dev/shm" , 0755); + WAIT_FOR_CHILDREN; mount("mode=0620,gid=5,nosuid,noexec", "devpts", "devpts", "/dev/pts" ); mount("mode=1777,nosuid,nodev", "tmpfs", "shm", "/dev/shm" ); - WAIT_FOR_CHILDREN; /* dest, link */ @@ -47,16 +44,14 @@ int main() { spawn_process(udevcmd1); WAIT_FOR_CHILDREN; spawn_process(udevcmd2); - WAIT_FOR_CHILDREN; spawn_process(udevcmd3); WAIT_FOR_CHILDREN; spawn_process(udevcmd4); log_message("Mounting filesystems"); - char* mountcmd1[] = { "mount", "-o", "remount,ro", "/", 0}; + char* mountcmd1[] = { "mount", "-o", "remount,rw", "/", 0}; char* mountcmd2[] = { mountcmd1[0], "-a", 0}; spawn_process(mountcmd1); - WAIT_FOR_CHILDREN; spawn_process(mountcmd2); log_message("Enabling swap");