forked from mirrors/nixpkgs
* Move starting of udevd (and udevtrigger/settle) into an Upstart
job. svn path=/nixos/trunk/; revision=7330
This commit is contained in:
parent
4b5b0d2c66
commit
07627d8cdd
|
@ -88,19 +88,6 @@ mknod -m 0666 /dev/null c 1 3
|
||||||
export MODULE_DIR=@kernel@/lib/modules/
|
export MODULE_DIR=@kernel@/lib/modules/
|
||||||
|
|
||||||
|
|
||||||
# Start udev.
|
|
||||||
udevd --daemon
|
|
||||||
|
|
||||||
|
|
||||||
# Let udev create device nodes for all modules that have already been
|
|
||||||
# loaded into the kernel (or for which support is built into the
|
|
||||||
# kernel).
|
|
||||||
udevtrigger
|
|
||||||
udevsettle # wait for udev to finish
|
|
||||||
|
|
||||||
chmod 666 /dev/null # grmbl
|
|
||||||
|
|
||||||
|
|
||||||
# Start an interactive shell.
|
# Start an interactive shell.
|
||||||
#exec @shell@
|
#exec @shell@
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,12 @@ import ../upstart-jobs/gather.nix {
|
||||||
inherit (pkgs) sysklogd;
|
inherit (pkgs) sysklogd;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# The udev daemon creates devices nodes and runs programs when
|
||||||
|
# hardware events occur.
|
||||||
|
(import ../upstart-jobs/udev.nix {
|
||||||
|
inherit (pkgs) udev procps;
|
||||||
|
})
|
||||||
|
|
||||||
# Hardware scan; loads modules for PCI devices.
|
# Hardware scan; loads modules for PCI devices.
|
||||||
(import ../upstart-jobs/hardware-scan.nix {
|
(import ../upstart-jobs/hardware-scan.nix {
|
||||||
inherit (pkgs) kernel module_init_tools;
|
inherit (pkgs) kernel module_init_tools;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
name = "hardware-scan";
|
name = "hardware-scan";
|
||||||
|
|
||||||
job = "
|
job = "
|
||||||
start on startup
|
start on udev
|
||||||
|
|
||||||
script
|
script
|
||||||
export MODULE_DIR=${kernel}/lib/modules/
|
export MODULE_DIR=${kernel}/lib/modules/
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{
|
{
|
||||||
name = "syslogd";
|
name = "syslogd";
|
||||||
job = "
|
job = "
|
||||||
start on startup
|
start on udev
|
||||||
stop on shutdown
|
stop on shutdown
|
||||||
respawn ${sysklogd}/sbin/syslogd -n
|
respawn ${sysklogd}/sbin/syslogd -n
|
||||||
";
|
";
|
||||||
|
|
31
upstart-jobs/udev.nix
Normal file
31
upstart-jobs/udev.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{udev, procps}:
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "udev";
|
||||||
|
|
||||||
|
job = "
|
||||||
|
start on startup
|
||||||
|
stop on shutdown
|
||||||
|
|
||||||
|
start script
|
||||||
|
echo '' > /proc/sys/kernel/hotplug
|
||||||
|
|
||||||
|
# Start udev.
|
||||||
|
${udev}/sbin/udevd --daemon
|
||||||
|
|
||||||
|
# Let udev create device nodes for all modules that have already
|
||||||
|
# been loaded into the kernel (or for which support is built into
|
||||||
|
# the kernel).
|
||||||
|
${udev}/sbin/udevtrigger
|
||||||
|
${udev}/sbin/udevsettle # wait for udev to finish
|
||||||
|
|
||||||
|
# Kill udev, let Upstart restart and monitor it. (This is nasty,
|
||||||
|
# but we have to run udevtrigger first. Maybe we can use
|
||||||
|
# Upstart's `binary' keyword, but it isn't implemented yet.)
|
||||||
|
${procps}/bin/pkill -u root '^udevd$'
|
||||||
|
end script
|
||||||
|
|
||||||
|
respawn ${udev}/sbin/udevd
|
||||||
|
";
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue