Hi folks,

Attached you can find a small patch for hw-detect.sh
to avoid some error messages about kernel modules
that are not available for newer kernels.


Regards

Harri
--- debian-installer/packages/ddetect/hw-detect.sh	2004-07-26 21:58:18.272069317 +0200
+++ debian-installer.new/packages/ddetect/hw-detect.sh	2004-07-26 20:40:53.000000000 +0200
@@ -26,6 +26,8 @@
 # Which discover version to use.  Updated by discover_version()
 DISCOVER_VERSION=1
 
+KERNEL_VERSION=`uname -r`
+
 log () {
 	logger -t hw-detect "$@"
 }
@@ -251,13 +253,27 @@
 # XXX: This isn't the best way to do this; we should autodetect.
 # The order of these modules are important.
 get_manual_hw_info() {
+	case $KERNEL_VERSION in
+		2.4.*)
+			KERNEL_IS_24=yup
+			KERNEL_MICROVERSION=`echo $KERNEL_VERSION | cut -d. -f3`
+			;;
+		*)
+			;;
+	esac
 	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_MICROVERSION -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_MICROVERSION -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 via email to