SVN: geninitrd/trunk: geninitrd mod-autodetect.sh

shadzik shadzik at pld-linux.org
Wed Oct 20 16:56:56 CEST 2010


Author: shadzik
Date: Wed Oct 20 16:56:55 2010
New Revision: 11853

Added:
   geninitrd/trunk/mod-autodetect.sh
Modified:
   geninitrd/trunk/geninitrd
Log:
- when PREMODS are not set, try to autodetect xata/scsi modules


Modified: geninitrd/trunk/geninitrd
==============================================================================
--- geninitrd/trunk/geninitrd	(original)
+++ geninitrd/trunk/geninitrd	Wed Oct 20 16:56:55 2010
@@ -1107,6 +1107,10 @@
 
 cache_modprobe_conf
 
+if [ -z "$PREMODS" ]; then
+	autodetect_xata
+fi
+
 for n in $PREMODS; do
 	find_module "$n"
 done

Added: geninitrd/trunk/mod-autodetect.sh
==============================================================================
--- (empty file)
+++ geninitrd/trunk/mod-autodetect.sh	Wed Oct 20 16:56:55 2010
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+autodetect_xata()
+{
+	debug "Detecting modules"
+
+	for class in 0106 0107 0100 0101; do
+		PREMODS="$PREMODS $(lspci -n |grep $class |sed 's/:/ /g' |while read junk junk class vendor device junk; do grep "0x0000$vendor 0x0000$device" /lib/modules/$(uname -r)/modules.pcimap |awk '{print $1}'; done |uniq)"
+	done
+}


More information about the pld-cvs-commit mailing list