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

[PATCH/RFC] Re: Kernel selection on i386 for Xen compatibility



On Sun, 2008-04-27 at 12:30 +0100, Ian Campbell wrote:
> Shall I define a new environment variable ${DI_FLAVOUR} passed to the
> base-installer/kernel scripts containing the kernel suffix (i.e. -486
> vs -686-bigmem) or ...

Something like this? (only tested with the tests in the tree so far not
a proper image)

Ian.

Index: kernel/tests/i386/cittagazze.test
===================================================================
--- kernel/tests/i386/cittagazze.test	(revision 52536)
+++ kernel/tests/i386/cittagazze.test	(working copy)
@@ -13,3 +13,4 @@
   linux-image-2.6.18-1-686 \
   linux-image-2.6.18-1-686-bigmem \
   linux-image-2.6.18-1-k7
+env DI_KERNEL_VERSION 2.6.25-486
Index: kernel/tests/i386/via-c7-Samuel.test
===================================================================
--- kernel/tests/i386/via-c7-Samuel.test	(revision 52536)
+++ kernel/tests/i386/via-c7-Samuel.test	(working copy)
@@ -15,3 +15,4 @@
   linux-image-2.6.18-1-686-bigmem \
   linux-image-2.6.18-1-686 \
   linux-image-2.6.18-1-k7
+env DI_KERNEL_VERSION 2.6.25-486
Index: kernel/tests/i386/via-c7-Esther.test
===================================================================
--- kernel/tests/i386/via-c7-Esther.test	(revision 52536)
+++ kernel/tests/i386/via-c7-Esther.test	(working copy)
@@ -16,3 +16,4 @@
 unusable \
   linux-image-2.6-k7 \
   linux-image-2.6.18-1-k7
+env DI_KERNEL_VERSION 2.6.25-486
Index: kernel/tests/i386/oqo1.test
===================================================================
--- kernel/tests/i386/oqo1.test	(revision 52536)
+++ kernel/tests/i386/oqo1.test	(working copy)
@@ -14,3 +14,4 @@
   linux-image-2.6.18-1-686-bigmem \
   linux-image-2.6.18-1-686 \
   linux-image-2.6.18-1-k7
+env DI_KERNEL_VERSION 2.6.25-486
Index: kernel/tests/i386/pentium-3.test
===================================================================
--- kernel/tests/i386/pentium-3.test	(revision 52536)
+++ kernel/tests/i386/pentium-3.test	(working copy)
@@ -15,3 +15,4 @@
 unusable \
   linux-image-2.6-k7 \
   linux-image-2.6.18-1-k7
+env DI_KERNEL_VERSION 2.6.25-486
Index: kernel/tests/i386/pentium-d-2p.test
===================================================================
--- kernel/tests/i386/pentium-d-2p.test	(revision 52536)
+++ kernel/tests/i386/pentium-d-2p.test	(working copy)
@@ -15,3 +15,4 @@
 unusable \
   linux-image-2.6-k7 \
   linux-image-2.6.18-1-k7
+env DI_KERNEL_VERSION 2.6.25-486
Index: kernel/tests/i386/pentium.test
===================================================================
--- kernel/tests/i386/pentium.test	(revision 52536)
+++ kernel/tests/i386/pentium.test	(working copy)
@@ -15,3 +15,4 @@
   linux-image-2.6.18-1-686-bigmem \
   linux-image-2.6.18-1-686 \
   linux-image-2.6.18-1-k7
+env DI_KERNEL_VERSION 2.6.25-486
Index: kernel/tests/i386/pentium-4M-bigmem.test
===================================================================
--- kernel/tests/i386/pentium-4M-bigmem.test	(revision 0)
+++ kernel/tests/i386/pentium-4M-bigmem.test	(revision 0)
@@ -0,0 +1,20 @@
+cpuinfo pentium-4M.cpuinfo
+machine i686
+majors 2.6
+flavour 686-bigmem
+env SPEAKUP /nonexistent
+kernel-2.6 \
+  linux-image-2.6-686-bigmem \
+  linux-image-2.6-686 \
+  linux-image-2.6-486
+usable \
+  linux-image-2.6-486 \
+  linux-image-2.6-686 \
+  linux-image-2.6-686-bigmem \
+  linux-image-2.6.18-1-486 \
+  linux-image-2.6.18-1-686 \
+  linux-image-2.6.18-1-686-bigmem
+unusable \
+  linux-image-2.6-k7 \
+  linux-image-2.6.18-1-k7
+env DI_KERNEL_VERSION 2.6.25-686-bigmem
Index: kernel/tests/i386/pentium-4M.test
===================================================================
--- kernel/tests/i386/pentium-4M.test	(revision 52536)
+++ kernel/tests/i386/pentium-4M.test	(working copy)
@@ -16,3 +16,4 @@
 unusable \
   linux-image-2.6-k7 \
   linux-image-2.6.18-1-k7
+env DI_KERNEL_VERSION 2.6.25-486
Index: kernel/i386.sh
===================================================================
--- kernel/i386.sh	(revision 52536)
+++ kernel/i386.sh	(working copy)
@@ -2,6 +2,17 @@
 	VENDOR=`grep '^vendor_id' "$CPUINFO" | head -n1 | cut -d: -f2`
 	FAMILY=`grep '^cpu family' "$CPUINFO" | head -n1 | cut -d: -f2`
 	MODEL=`grep '^model[[:space:]]*:' "$CPUINFO" | head -n1 | cut -d: -f2`
+
+	if grep '^flags' "$CPUINFO" | grep -q pae; then
+                PAE=1
+		case "$DI_KERNEL_VERSION" in
+		    *-bigmem) BIGMEM="-bigmem" ;;
+		    *) ;;
+		esac
+        else
+                PAE=0
+        fi
+
 	case "$VENDOR" in
 	    " AuthenticAMD"*)
 		case "$FAMILY" in
@@ -11,7 +22,7 @@
 		;;
 	    " GenuineIntel")
 		case "$FAMILY" in
-		    " 6"|" 15")	echo 686 ;;
+		    " 6"|" 15")	echo 686${BIGMEM} ;;
 		    *)		echo 486 ;;
 		esac
 		;;
@@ -19,7 +30,7 @@
 		case "$FAMILY" in
 		    " 6")
 			case "$MODEL" in
-			    " 9"|" 10")	echo 686 ;;
+			    " 9"|" 10")	echo 686${BIGMEM} ;;
 			    *)		echo 486 ;;
 			esac
 			;;
@@ -39,7 +50,7 @@
 	if echo "$1" | grep -Eq -- "-486(-.*)?$"; then return 0; fi
 	if [ "$2" = 486 ]; then return 1; fi
 	if echo "$1" | grep -Eq -- "-686(-.*)?$"; then return 0; fi
-	if [ "$2" = 686 ]; then return 1; fi
+	if [ "$2" = 686 ] || [ "$2" = 686-bigmem ] ; then return 1; fi
 	if [ "$2" = k7 ]; then
 		if echo "$1" | grep -Eq -- "-k7(-.*)?$"; then return 0; fi
 		return 1
@@ -58,6 +69,11 @@
 		set 486
 	fi
 
+	if [ "$1" = 686-bigmem ]; then
+		echo "$imgbase-$KERNEL_MAJOR-686-bigmem"
+		set 686
+	fi
+
 	if [ "$1" = 686 ]; then
 		echo "$imgbase-$KERNEL_MAJOR-686"
 		set 486
Index: library.sh
===================================================================
--- library.sh	(revision 52536)
+++ library.sh	(working copy)
@@ -328,6 +328,7 @@
 pick_kernel () {
 	kernel_update_list
 
+	DI_KERNEL_VERSION=$(uname -r)
 	# For now, only present kernels we believe to be usable. We may have
 	# to rethink this later, but if there are no usable kernels it
 	# should be accompanied by an error message. The default must still

-- 
Ian Campbell

The universe does not have laws -- it has habits, and habits can be broken.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: