Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 297aa41403bfdec67c5cbf60de95bfa4 > files > 1

finit-0.6-4mdv2009.0.src.rpm

commit 29ab953a874a441b3823eb58a2b6f5aaed7b7eba
Author: Claudio Matsuoka <cmatsuoka@gmail.com>
Date:   Wed Oct 1 16:50:38 2008 -0300

    Make startx command configurable from finit.conf
    
    Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>

diff --git a/contrib/services.sh-miura b/contrib/services.sh-miura
new file mode 100755
index 0000000..6fbf25e
--- /dev/null
+++ b/contrib/services.sh-miura
@@ -0,0 +1,44 @@
+#!/bin/sh
+# precaution, if the hotplug tag exists in mkinitrd
+killall nash-hotplug &
+
+#give some priority to the user processes
+renice -5 -u gdium
+
+# Else oocalc will crash
+mknod /dev/random c 1 8 &
+mkdir /var/lock/subsys &
+chmod 1777  /var/lock/subsys
+mkdir /var/run/dbus &
+mkdir /var/run/netreport &
+mkdir /var/run/ConsoleKit &
+mkdir /var/log &
+/etc/init.d/haldaemon start &
+
+sleep 25
+# postpone udev and others startup, they are too slow
+# limit the amount of udev childs, should speed up a little
+export UDEV_MAX_CHILDS=2
+export UDEV_MAX_CHILDS_RUNNING=2
+/sbin/start_udev
+/sbin/swapon -a &
+
+chmod 0666 /dev/null
+chmod 0666 /dev/ptmx
+/etc/init.d/alsa start
+/etc/init.d/network start
+for module in `/bin/grep -hv '#' /etc/modprobe.preload /etc/modprobe.preload.d/*`; do
+	  /sbin/modprobe $module
+done
+
+# restore (hopefully) the priority to the user processes
+renice 0 -u gdium
+
+# fuse status always say 0
+/sbin/service fuse start
+for i in /etc/rc5.d/S*; do
+	$i status > /dev/null 2>&1 || $i start
+done
+
+# enable this to stop bootchart when testing
+(sleep 30; /sbin/bootchartd stop)&
diff --git a/finit-alt.c b/finit-alt.c
index e8d6018..0561e54 100644
--- a/finit-alt.c
+++ b/finit-alt.c
@@ -200,6 +200,7 @@ int main()
 	char username[USERNAME_SIZE] = DEFUSER;
 	char hostname[HOSTNAME_SIZE] = "eviltwin";
 	char cmd[CMD_SIZE];
+	char startx[CMD_SIZE] = "xinit";
 #ifdef USE_ETC_RESOLVCONF_RUN
 	DIR *dir;
 	struct dirent *d;
@@ -279,6 +280,11 @@ int main()
 				build_cmd(username, x, USERNAME_SIZE);
 				continue;
 			}
+			if (MATCH_CMD(line, "startx ", x)) {
+				*startx = 0;
+				build_cmd(startx, x, CMD_SIZE);
+				continue;
+			}
 			if (MATCH_CMD(line, "host ", x)) {
 				*hostname = 0;
 				build_cmd(hostname, x, HOSTNAME_SIZE);
@@ -298,7 +304,6 @@ int main()
 			 */
 			if (MATCH_CMD(line, "mountdev", x)) {
 				mount("none", "/dev", "tmpfs", 0, "mode=0755");
-				blkdev("/dev/sda", 0660, 8, 0);
 				blkdev("/dev/sda1", 0660, 8, 1);
 				blkdev("/dev/sda2", 0660, 8, 2);
 				blkdev("/dev/sda3", 0660, 8, 3);
@@ -529,13 +534,13 @@ int main()
 			_d("start X as %s\n", username);
 			if (debug) {
 				snprintf(line, LINE_SIZE,
-					"su -c xinit -l %s\n", username);
+					"su -l %s -c \"%s\"", username, startx);
 				system(line);
 				system("/bin/sh");
 			} else {
 				snprintf(line, LINE_SIZE,
-					"su -c xinit -l %s\n &> /dev/null",
-					username);
+					"su -l %s -c \"%s\" &> /dev/null",
+					username, startx);
 				system(line);
 			}
 		}
diff --git a/finit.conf b/finit.conf
index 44c94b2..3bdca45 100644
--- a/finit.conf
+++ b/finit.conf
@@ -3,3 +3,4 @@ module intel-agp
 module p4-clockmod
 check /dev/sda3
 host eviltwin
+startx /usr/bin/startx