Bug#589579: debian-installer: i386 kernel flavour selection is poor

2010-09-03 Thread Ben Hutchings
Please apply this patch.

I've just raised the severity to 'important'; I think problem 1 is
serious enough to justify that.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.


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


Bug#589579: debian-installer: i386 kernel flavour selection is poor

2010-09-03 Thread Christian PERRIER
reassign 589579 base-installer
tags 589579 pending
thanks

Quoting Ben Hutchings (b...@decadent.org.uk):
 Please apply this patch.
 
 I've just raised the severity to 'important'; I think problem 1 is
 serious enough to justify that.
 
 Ben.


Applied



signature.asc
Description: Digital signature


Bug#589579: debian-installer: i386 kernel flavour selection is poor

2010-07-18 Thread Ben Hutchings
Package: debian-installer
Tags: squeeze patch

There are several problems with the current selection:
1. 686-bigmem is not preferred when there is RAM above 4GB
2. 686-bigmem is not always offered where it is usable, and amd64 is
never offered
3. The 686 flavour is considered unsuitable for some AMD K7 processors

Problem 3 appears to be due to a workaround for an incorrect kernel
configuration.  The comment on this exclusion is 'May not have SSE
support', but this has never been a requirement for the 686 flavour.
(The Pentium Pro and Pentium II don't have SSE either.)

This patch rewrites the flavour selection so that:
1. 686-bigmem is preferred when there is RAM above 4GB, otherwise 686 is
preferred
2. All usable flavours are offered
3. The 686 flavour is considered suitable for all K7 processors

It updates the tests accordingly, adding amd64 to the usable/unusable
flavours lists and adding a test case for RAM above 4GB.

Ben.

Index: packages/base-installer/kernel/i386.sh
===
--- packages/base-installer/kernel/i386.sh  (revision 63990)
+++ packages/base-installer/kernel/i386.sh  (working copy)
@@ -1,45 +1,94 @@
 arch_get_kernel_flavour () {
-   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`
+   # Should we offer an amd64 kernel?
+   local HAVE_LM
+   if grep -q '^flags.*\blm\b' $CPUINFO; then
+   HAVE_LM=y
+   else
+   HAVE_LM=n
+   fi
 
-   # Only offer bigmem if the system supports PAE and the
-   # installer itself is already using a bigmem kernel.
-   if grep '^flags' $CPUINFO | grep -q pae ; then
-   case $KERNEL_FLAVOUR in
-   686-bigmem*) BIGMEM=-bigmem ;;
-   *) ;;
-   esac
+   # Should we offer a bigmem kernel?
+   local HAVE_PAE
+   if grep -q '^flags.*\bpae\b' $CPUINFO; then
+   HAVE_PAE=y
+   else
+   HAVE_PAE=n
fi
 
+   # Should we prefer a bigmem/amd64 kernel - is there RAM above 4GB?
+   local WANT_PAE
+   if [ -z $RAM_END ]; then
+   local MAP MAP_END
+   RAM_END=0
+   for MAP in /sys/firmware/memmap/* ; do
+   if [ $(cat $MAP/type) = System RAM ]; then
+   MAP_END=$(cat $MAP/end)
+   if [ $(($MAP_END  $RAM_END)) = 1 ]; then
+   RAM_END=$MAP_END
+   fi
+   fi
+   done
+   fi
+   if [ $(($RAM_END  0x1)) = 1 ]; then
+   WANT_PAE=y
+   else
+   WANT_PAE=n
+   fi
+   # or is the installer running a 686-bigmem kernel?
+   case $KERNEL_FLAVOUR in
+   686-bigmem*)
+   WANT_PAE=y
+   ;;
+   esac
+
+   case $HAVE_LM$HAVE_PAE$WANT_PAE in
+   yyy)
+   echo 686-bigmem amd64 686 486
+   return 0
+   ;;
+   yyn)
+   echo 686 686-bigmem amd64 486
+   return 0
+   ;;
+   yn?)
+   warning Processor with LM but no PAE???
+   ;;
+   nyy)
+   echo 686-bigmem 686 486
+   return 0
+   ;;
+   nyn)
+   echo 686 686-bigmem 486
+   return 0
+   ;;
+   nn?)
+   # Need to check whether 686 is suitable
+   ;;
+   esac
+
+   local VENDOR FAMILY MODEL
+   VENDOR=$(sed -n 's/^vendor_id\s*: //; T; p; q' $CPUINFO)
+   FAMILY=$(sed -n 's/^cpu family\s*: //; T; p; q' $CPUINFO)
+   MODEL=$(sed -n 's/^model\s*: //; T; p; q' $CPUINFO)
+
case $VENDOR in
-AuthenticAMD*)
+   AuthenticAMD*)
case $FAMILY in
-15| 16| 17)  # k8
-   echo 686$BIGMEM
-   ;;
-6)   # k7
-   case $MODEL in
-0| 1| 2| 3| 4| 5)
-   # May not have SSE support
-   echo 486 ;;
-   *)  echo 686$BIGMEM ;;
-   esac
-   ;;
+   6|15|16|17) echo 686 486 ;;
*)  echo 486 ;;
esac
;;
-GenuineIntel)
+   GenuineIntel)
case $FAMILY in
-6| 15) echo 686$BIGMEM ;;
+   6|15)   echo 686 486 ;;
*)  echo 486 ;;
esac
;;
-CentaurHauls)
+   CentaurHauls)
case $FAMILY in

Bug#589579: debian-installer: i386 kernel flavour selection is poor

2010-07-18 Thread Frans Pop
On Sunday 18 July 2010, Ben Hutchings wrote:
 3. The 686 flavour is considered unsuitable for some AMD K7 processors

 Problem 3 appears to be due to a workaround for an incorrect kernel
 configuration.  The comment on this exclusion is 'May not have SSE
 support', but this has never been a requirement for the 686 flavour.
 (The Pentium Pro and Pentium II don't have SSE either.)

This has been discussed, changed, and revisited several times. There have 
been long threads about it and IIRC also various bug reports from users.

Can you really *guarantee* that 686 will work with *all* K7 processors?
I've not checked the archives, but I'm not sure whether SSE support really 
was the reason for the current code, or whether there were also other 
factors.



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#589579: debian-installer: i386 kernel flavour selection is poor

2010-07-18 Thread Frans Pop
On Sunday 18 July 2010, Ben Hutchings wrote:
 +   if grep -q '^flags.*\blm\b' $CPUINFO; then

Has this been tested with busybox shell?
Does busybox' grep understand '\b'? I don't recall us using it anywhere 
else in D-I.



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#589579: debian-installer: i386 kernel flavour selection is poor

2010-07-18 Thread Ben Hutchings
On Sun, 2010-07-18 at 23:08 +0200, Frans Pop wrote:
 On Sunday 18 July 2010, Ben Hutchings wrote:
  3. The 686 flavour is considered unsuitable for some AMD K7 processors
 
  Problem 3 appears to be due to a workaround for an incorrect kernel
  configuration.  The comment on this exclusion is 'May not have SSE
  support', but this has never been a requirement for the 686 flavour.
  (The Pentium Pro and Pentium II don't have SSE either.)
 
 This has been discussed, changed, and revisited several times. There have 
 been long threads about it and IIRC also various bug reports from users.

 Can you really *guarantee* that 686 will work with *all* K7 processors?
 I've not checked the archives, but I'm not sure whether SSE support really 
 was the reason for the current code, or whether there were also other 
 factors.

You introduced this behaviour shortly after the k7 flavour was removed
and there has been no change to it since.

The previous discussion appears to be in
http://bugs.debian.org/490542.  Dann disagreed with this exclusion and
you said it was based on information from Max and Colin.  So I'll cc all
parties in the hope of clearing this up.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.


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


Bug#589579: debian-installer: i386 kernel flavour selection is poor

2010-07-18 Thread Ben Hutchings
On Sun, 2010-07-18 at 23:11 +0200, Frans Pop wrote:
 On Sunday 18 July 2010, Ben Hutchings wrote:
  +   if grep -q '^flags.*\blm\b' $CPUINFO; then
 
 Has this been tested with busybox shell?
 Does busybox' grep understand '\b'? I don't recall us using it anywhere 
 else in D-I.

This works with 'busybox grep' from the busybox package, so unless it is
an optional feature it should work in d-i.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.


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


Bug#589579: debian-installer: i386 kernel flavour selection is poor

2010-07-18 Thread Frans Pop
On Sunday 18 July 2010, Ben Hutchings wrote:
 On Sun, 2010-07-18 at 23:11 +0200, Frans Pop wrote:
  On Sunday 18 July 2010, Ben Hutchings wrote:
   +   if grep -q '^flags.*\blm\b' $CPUINFO; then
 
  Has this been tested with busybox shell?
  Does busybox' grep understand '\b'? I don't recall us using it
  anywhere else in D-I.

 This works with 'busybox grep' from the busybox package, so unless it is
 an optional feature it should work in d-i.

OK. Thanks for verifying.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org