Thiemo Seufer wrote:
Harald Dunkel wrote:
[snip]

@@ -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`


This will fail for some architectures:

hattusa:~$ uname -r
2.4.26-sb1-swarm-bn


KERNEL_MICROVERSION=`echo $KERNEL_VERSION | sed 's/^[^.]\+\.[^.]\+\.\([0-9]\+\).*/\1/'

should work most of the time. See the attached new patch.

Would you recommend searching for the module in
/lib/modules/`uname -r` instead? One could say, why
should d-i present some unavailable modules to choose
from?


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 via email to