From 8ebde1ea8a59cabe61bcde80aea4738669420406 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 6 Jan 2010 20:09:53 +0000 Subject: [PATCH] * Add the modules for all block devices. svn path=/nixos/trunk/; revision=19271 --- modules/installer/tools/nixos-hardware-scan.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/installer/tools/nixos-hardware-scan.pl b/modules/installer/tools/nixos-hardware-scan.pl index 50ce8a043f6..dd522f543bd 100644 --- a/modules/installer/tools/nixos-hardware-scan.pl +++ b/modules/installer/tools/nixos-hardware-scan.pl @@ -176,6 +176,19 @@ foreach my $path (glob "/sys/bus/usb/devices/*") { } +# Add the modules for all block devices. + +foreach my $path (glob "/sys/class/block/*") { + my $module; + print STDERR "$path\n"; + if (-e "$path/device/driver/module") { + $module = basename `readlink -f $path/device/driver/module`; + chomp $module; + push @initrdKernelModules, $module; + } +} + + # Generate the configuration file. sub removeDups {