Make startx command configurable from finit.conf

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
Claudio Matsuoka
2008-10-01 16:50:38 -03:00
parent 1843a0e66f
commit 29ab953a87
3 changed files with 54 additions and 4 deletions
+44
View File
@@ -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)&
+9 -4
View File
@@ -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);
}
}
+1
View File
@@ -3,3 +3,4 @@ module intel-agp
module p4-clockmod
check /dev/sda3
host eviltwin
startx /usr/bin/startx