* Put the PCI module probing in an Upstart task. We now have
more-or-less "asynchronous" booting: the login prompt appears almost immediately, before the hardware and the network are started. svn path=/nixu/trunk/; revision=7082
This commit is contained in:
parent
962b1df3aa
commit
7bba427e93
|
@ -87,9 +87,14 @@ rec {
|
||||||
inherit (pkgs) sysklogd;
|
inherit (pkgs) sysklogd;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Hardware scan; loads modules for PCI devices.
|
||||||
|
(import ./upstart-jobs/hardware-scan.nix {
|
||||||
|
inherit (pkgs) kernel module_init_tools;
|
||||||
|
})
|
||||||
|
|
||||||
# Network interfaces.
|
# Network interfaces.
|
||||||
(import ./upstart-jobs/network-interfaces.nix {
|
(import ./upstart-jobs/network-interfaces.nix {
|
||||||
inherit (pkgs) nettools kernel;
|
inherit (pkgs) nettools kernel module_init_tools;
|
||||||
})
|
})
|
||||||
|
|
||||||
# DHCP client.
|
# DHCP client.
|
||||||
|
@ -121,7 +126,7 @@ rec {
|
||||||
# everything else to bring up the system.
|
# everything else to bring up the system.
|
||||||
bootStage2 = import ./boot-stage-2.nix {
|
bootStage2 = import ./boot-stage-2.nix {
|
||||||
inherit (pkgs) genericSubstituter coreutils findutils
|
inherit (pkgs) genericSubstituter coreutils findutils
|
||||||
utillinux kernel udev module_init_tools
|
utillinux kernel udev
|
||||||
upstart;
|
upstart;
|
||||||
inherit upstartJobs;
|
inherit upstartJobs;
|
||||||
shell = pkgs.bash + "/bin/sh";
|
shell = pkgs.bash + "/bin/sh";
|
||||||
|
@ -140,6 +145,7 @@ rec {
|
||||||
pkgs.gzip
|
pkgs.gzip
|
||||||
pkgs.iputils
|
pkgs.iputils
|
||||||
pkgs.less
|
pkgs.less
|
||||||
|
pkgs.module_init_tools
|
||||||
pkgs.nano
|
pkgs.nano
|
||||||
pkgs.netcat
|
pkgs.netcat
|
||||||
pkgs.nettools
|
pkgs.nettools
|
||||||
|
|
|
@ -74,14 +74,6 @@ echo "*.* /dev/tty10" > /etc/syslog.conf
|
||||||
echo "syslog 514/udp" > /etc/services # required, even if we don't use it
|
echo "syslog 514/udp" > /etc/services # required, even if we don't use it
|
||||||
|
|
||||||
|
|
||||||
# Try to load modules for all PCI devices.
|
|
||||||
for i in /sys/bus/pci/devices/*/modalias; do
|
|
||||||
echo "Trying to load a module for $(basename $(dirname $i))..."
|
|
||||||
modprobe $(cat $i)
|
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
# login/su absolutely need this.
|
# login/su absolutely need this.
|
||||||
test -e /etc/login.defs || touch /etc/login.defs
|
test -e /etc/login.defs || touch /etc/login.defs
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{ genericSubstituter, shell, coreutils, findutils
|
{ genericSubstituter, shell, coreutils, findutils
|
||||||
, utillinux, kernel, udev
|
, utillinux, kernel, udev, upstart
|
||||||
, module_init_tools, upstart
|
|
||||||
, path ? []
|
, path ? []
|
||||||
|
|
||||||
, # Whether the root device is root only. If so, we'll mount a
|
, # Whether the root device is root only. If so, we'll mount a
|
||||||
|
@ -20,7 +19,6 @@ genericSubstituter {
|
||||||
findutils
|
findutils
|
||||||
utillinux
|
utillinux
|
||||||
udev
|
udev
|
||||||
module_init_tools
|
|
||||||
upstart
|
upstart
|
||||||
];
|
];
|
||||||
extraPath = path;
|
extraPath = path;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
job = "
|
job = "
|
||||||
description \"DHCP client\"
|
description \"DHCP client\"
|
||||||
|
|
||||||
start on network-interfaces
|
start on network-interfaces/started
|
||||||
stop on network-interfaces/stop
|
stop on network-interfaces/stop
|
||||||
|
|
||||||
script
|
script
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
# !!! Don't like it that I have to pass the kernel here.
|
||||||
|
{kernel, module_init_tools}:
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "hardware-scan";
|
||||||
|
|
||||||
|
job = "
|
||||||
|
start on startup
|
||||||
|
|
||||||
|
script
|
||||||
|
export MODULE_DIR=${kernel}/lib/modules/
|
||||||
|
|
||||||
|
# Try to load modules for all PCI devices.
|
||||||
|
for i in /sys/bus/pci/devices/*/modalias; do
|
||||||
|
echo \"Trying to load a module for $(basename $(dirname $i))...\"
|
||||||
|
${module_init_tools}/sbin/modprobe $(cat $i) || true
|
||||||
|
echo \"\"
|
||||||
|
done
|
||||||
|
end script
|
||||||
|
|
||||||
|
";
|
||||||
|
|
||||||
|
}
|
|
@ -1,17 +1,17 @@
|
||||||
# !!! Don't like it that I have to pass the kernel here.
|
# !!! Don't like it that I have to pass the kernel here.
|
||||||
{nettools, kernel}:
|
{nettools, kernel, module_init_tools}:
|
||||||
|
|
||||||
{
|
{
|
||||||
name = "network-interfaces";
|
name = "network-interfaces";
|
||||||
|
|
||||||
job = "
|
job = "
|
||||||
start on startup
|
start on hardware-scan
|
||||||
stop on shutdown
|
stop on shutdown
|
||||||
|
|
||||||
start script
|
start script
|
||||||
export MODULE_DIR=${kernel}/lib/modules/
|
export MODULE_DIR=${kernel}/lib/modules/
|
||||||
|
|
||||||
modprobe af_packet
|
${module_init_tools}/sbin/modprobe af_packet
|
||||||
|
|
||||||
for i in $(cd /sys/class/net && ls -d *); do
|
for i in $(cd /sys/class/net && ls -d *); do
|
||||||
echo \"Bringing up network device $i...\"
|
echo \"Bringing up network device $i...\"
|
||||||
|
|
Loading…
Reference in New Issue