mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08d0dc6ee9 | ||
|
|
6e2ea43e97 | ||
|
|
2679c1b1c5 | ||
|
|
d05900368f | ||
|
|
a1de36c163 | ||
|
|
8206803762 | ||
|
|
fb8c341168 | ||
|
|
7137573534 |
@@ -1,5 +1,10 @@
|
||||
0.3 ()
|
||||
- Change poweroff method to reboot(RB_POWER_OFF) (Metalshark)
|
||||
- Remove duplicate unionctl() reimplementation error
|
||||
- Fix string termination in path creation
|
||||
- Mount /var/lock and /var/run as tmpfs
|
||||
|
||||
0.2 ()
|
||||
0.2 (20080219)
|
||||
- replace system("touch") with touch() in finit-mod (Metalshark)
|
||||
- disable NO_HCTOSYS by default to match stock Eeepc kernel
|
||||
- drop system("rm -f") to clean /tmp, its a fresh mounted tmpfs
|
||||
|
||||
@@ -3,9 +3,10 @@ CFLAGS = -Os -Wall -DVERSION=\"$(VERSION)\" -DWHOAMI=\"`whoami`@`hostname`\"
|
||||
LD = gcc
|
||||
LDFLAGS =
|
||||
LIBS =
|
||||
VERSION = 0.2
|
||||
VERSION = 0.3
|
||||
PKG = finit-$(VERSION)
|
||||
DFILES = Makefile README finit.c finit-mod.c finit-alt.c helpers.c helpers.h
|
||||
BINS = finit finit-mod finit-mdv
|
||||
|
||||
|
||||
#### Configurable parameters
|
||||
@@ -31,7 +32,7 @@ CFLAGS += -march=pentium-m
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) -o $*.o $<
|
||||
|
||||
all: finit finit-mod finit-mdv
|
||||
all: $(BINS)
|
||||
|
||||
finit: finit.o
|
||||
$(LD) $(LDFLAGS) -o $@ $+ $(LIBS)
|
||||
@@ -49,7 +50,7 @@ finit-mdv.o: finit-alt.c Makefile
|
||||
$(CC) -c $(CFLAGS) -DDIST_MDV -o $@ finit-alt.c
|
||||
|
||||
clean:
|
||||
rm -f *.o core *~
|
||||
rm -f *.o core *~ $(BINS)
|
||||
|
||||
finit.o: finit.c Makefile
|
||||
|
||||
|
||||
@@ -73,3 +73,5 @@ problems related to udev and pam.
|
||||
|
||||
4 - Set the pointer device in the X server configuration to /dev/input/mice
|
||||
|
||||
5 - Have a user named "user", or change DEFUSER in the source file
|
||||
|
||||
|
||||
+10
-11
@@ -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);
|
||||
@@ -328,8 +334,6 @@ int main()
|
||||
*/
|
||||
void shutdown(int sig)
|
||||
{
|
||||
int fd;
|
||||
|
||||
debug("shutdown");
|
||||
touch("/tmp/shutdown");
|
||||
|
||||
@@ -341,23 +345,18 @@ void shutdown(int sig)
|
||||
|
||||
system("/usr/sbin/alsactl store > /dev/null 2>&1");
|
||||
system("/sbin/hwclock --systohc --localtime" HWCLOCK_DIRECTISA);
|
||||
system("/sbin/unionctl.static / --remove / > /dev/null 2>&1");
|
||||
|
||||
kill(-1, SIGKILL);
|
||||
|
||||
sync();
|
||||
sync();
|
||||
system("/bin/mount -n -o remount,ro /");
|
||||
|
||||
system("/sbin/unionctl.static / --remove / > /dev/null 2>&1");
|
||||
|
||||
if (sig == SIGINT || sig == SIGUSR1)
|
||||
reboot(RB_AUTOBOOT);
|
||||
|
||||
if ((fd = open("/sys/power/state", O_WRONLY)) >= 0) {
|
||||
write(fd, "5", 1);
|
||||
close(fd);
|
||||
}
|
||||
reboot(RB_POWER_OFF);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+6
-8
@@ -38,6 +38,9 @@ Changelog from the original Eeepc fastinit:
|
||||
- Set loopback interface using direct calls instead of system("ifconfig")
|
||||
- Copy 4096 data block in C instead of system("cat") or system("dd")
|
||||
- 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
|
||||
|
||||
*/
|
||||
|
||||
@@ -149,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);
|
||||
|
||||
/*
|
||||
@@ -271,8 +276,6 @@ int main()
|
||||
*/
|
||||
void shutdown(int sig)
|
||||
{
|
||||
int fd;
|
||||
|
||||
touch("/tmp/shutdown");
|
||||
|
||||
kill(-1, SIGTERM);
|
||||
@@ -283,23 +286,18 @@ void shutdown(int sig)
|
||||
|
||||
system("/usr/sbin/alsactl store > /dev/null 2>&1");
|
||||
system("/sbin/hwclock --systohc --localtime" HWCLOCK_DIRECTISA);
|
||||
system("/sbin/unionctl.static / --remove / > /dev/null 2>&1");
|
||||
|
||||
kill(-1, SIGKILL);
|
||||
|
||||
sync();
|
||||
sync();
|
||||
system("/bin/mount -n -o remount,ro /");
|
||||
|
||||
system("/sbin/unionctl.static / --remove / > /dev/null 2>&1");
|
||||
|
||||
if (sig == SIGINT || sig == SIGUSR1)
|
||||
reboot(RB_AUTOBOOT);
|
||||
|
||||
if ((fd = open("/sys/power/state", O_WRONLY)) >= 0) {
|
||||
write(fd, "5", 1);
|
||||
close(fd);
|
||||
}
|
||||
reboot(RB_POWER_OFF);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -240,14 +240,12 @@ void shutdown(int sig)
|
||||
|
||||
system("/usr/sbin/alsactl store > /dev/null 2>&1");
|
||||
system("/sbin/hwclock --systohc --localtime");
|
||||
system("/sbin/unionctl.static / --remove / > /dev/null 2>&1");
|
||||
|
||||
kill(-1, SIGKILL);
|
||||
|
||||
sync();
|
||||
sync();
|
||||
system("/bin/mount -n -o remount,ro /");
|
||||
|
||||
system("/sbin/unionctl.static / --remove / > /dev/null 2>&1");
|
||||
|
||||
if (sig == SIGINT || sig == SIGUSR1)
|
||||
|
||||
Reference in New Issue
Block a user