[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#261780: hw-detect.sh lists obsolete kernel modules



Package: ddetect
Version: 1.00

Hi folks,

hw-detect.sh lists some modules for kernel 2.6, that
don't even exist. I know of

	ide-mod
	ide-probe-mod
	ide-detect

but maybe there are others.

At installation time this produces an error message about
some modules that could not be found.

There are at least 2 options to solve this:

- change hw-detect to list only modules that can be
  found in /lib/modules/`uname -r`

- add some 'if kernel = 2.4' statements to hw_detect.sh
  (see the attached patch)


Regards

Harri
--- debian-installer/packages/ddetect/hw-detect.sh	2004-07-26 21:58:18.000000000 +0200
+++ debian-installer.new/packages/ddetect/hw-detect.sh	2004-07-27 08:16:59.291955499 +0200
@@ -26,6 +26,14 @@
 # Which discover version to use.  Updated by discover_version()
 DISCOVER_VERSION=1
 
+KERNEL_VERSION=`uname -r`
+KERNEL_SUBLEVEL=`echo $KERNEL_VERSION | sed 's/^[^.]\+\.[^.]\+\.\([0-9]\+\).*/\1/'`
+case $KERNEL_VERSION in
+	2.4.*)
+		KERNEL_IS_24=yup
+		;;
+esac
+
 log () {
 	logger -t hw-detect "$@"
 }
@@ -252,12 +260,18 @@
 # The order of these modules are important.
 get_manual_hw_info() {
 	get_floppy_info
-	# ide-mod and ide-probe-mod are needed for older (2.4.20) kernels
-	echo "ide-mod:Linux IDE driver"
-	echo "ide-probe-mod:Linux IDE probe driver"
+	if [ "$KERNEL_IS_24" -a $KERNEL_SUBLEVEL -le 20 ]; then
+		# ide-mod and ide-probe-mod are needed for older (2.4.20) kernels
+		echo "ide-mod:Linux IDE driver"
+		echo "ide-probe-mod:Linux IDE probe driver"
+	fi
 	get_ide_chipset_info
-	echo "ide-detect:Linux IDE detection" # 2.4.x > 20
-	echo "ide-generic:Linux IDE support" # 2.6
+	if [ "$KERNEL_IS_24" -a $KERNEL_SUBLEVEL -gt 20 ]; then
+		echo "ide-detect:Linux IDE detection" # 2.4.x > 20
+	fi
+	if [ ! "$KERNEL_IS_24" ]; then
+		echo "ide-generic:Linux IDE support" # 2.6
+	fi
 	get_ide_floppy_info
 	echo "ide-disk:Linux ATA DISK"
 	echo "ide-cd:Linux ATAPI CD-ROM"

Reply to: