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

Re: [PATCHES] 686-bigmem/Xen enabled netboot images



On Thu, 2008-07-10 at 13:35 -0300, Otavio Salvador wrote:
> Ian Campbell <ijc@hellion.org.uk> writes:
> 
> > Is there anything more I can do to make these patches acceptable?
> >
> > I'm sorry I was travelling for the switch over to 2.6.25 -- it looks
> > like that is now resolved?
> 
> Yes. Please refresh your patches and use the lastest kernel-wedge (I
> hope Jeremy is able to commit virtio changes soon) so we can review
> it.

Sure patches are attached. No significant change apart from the
changelogs (some of the entries make it look like I'm the maintainer
since they are brand new and I didn't have anything else to put after
the --). I've cut-n-pasted my description of each patch from last time
after this mail, I've added finish-install.patch too.

> I belive we should use a xen image flavor for it (as suggested
> previously by Frans IIRC). If you could do that it would be nice.

One of the principles of the paravirt_ops kernel stuff is that there
should be no need for a distro to special case a particular
virtualisation solution in kernel builds or elsewhere. Any image built
with these patches will also work fine on native and could be made to
work on kvm/virtio etc assuming an interested party was available.
That's why I'm keen to have a non-Xen specific image. If consensus is
against me then I'll change my mind, clearly ;-)

Ian.

First patch is to kernel wedge and adds the Xen block and net devices
(optional since they won't appear in the 486 images) as well as making
generic_serial optional in order to allow 686-bigmem kernel udebs to be
built. [kernel-wedge.patch]

Second patch is to linux-kernel-di-i386-2.6 and simply adds the
686-bigmem flavour kernels. [linux-kernel-di-i386-2.6.patch]

Third patch is to base-installer and causes the 686-bigmem kernel to be
installed into the new system iff the installer is also running a bigmem
kernel. This has been filed as #480054 and I'll send an update there
too. [base-installer.patch]

Final patch is the the installer itself to cause a 686-bigmem netboot
image to be built. [installer.patch]

New from last time is a patch to finish-install to add a getty on hvc0
if Xen is detected. It's unfortunate that the test for Xen has to be
present but this is the only way which I could find that work reliably.
[finish-install.patch]

-- 
Ian Campbell

No matter how old a mother is, she watches her middle-aged children for
signs of improvement.
		-- Florida Scott-Maxwell
Index: packages/kernel/kernel-wedge/debian/changelog
===================================================================
--- packages/kernel/kernel-wedge/debian/changelog	(revision 54198)
+++ packages/kernel/kernel-wedge/debian/changelog	(working copy)
@@ -1,3 +1,11 @@
+kernel-wedge (2.46) UNRELEASED; urgency=low
+
+  [ Ian Campbell ]
+  * Include Xen net and block drivers.
+  * generic_serial is optional (for 686-bigmem support).
+
+ -- Ian Campbell <ijc@hellion.org.uk>  Thu, 10 Jul 2008 18:30:21 +0100
+
 kernel-wedge (2.45) unstable; urgency=low
 
   [ Frans Pop ]
Index: packages/kernel/kernel-wedge/modules/nic-modules
===================================================================
--- packages/kernel/kernel-wedge/modules/nic-modules	(revision 54198)
+++ packages/kernel/kernel-wedge/modules/nic-modules	(working copy)
@@ -8,3 +8,4 @@
 tulip
 winbond-840
 eth1394 ?
+xen-netfront ?
Index: packages/kernel/kernel-wedge/modules/scsi-modules
===================================================================
--- packages/kernel/kernel-wedge/modules/scsi-modules	(revision 54198)
+++ packages/kernel/kernel-wedge/modules/scsi-modules	(working copy)
@@ -36,3 +36,4 @@
 dc395x ?
 aic94xx ?
 stex ?
+xen-blkfront ?
Index: packages/kernel/kernel-wedge/modules/serial-modules
===================================================================
--- packages/kernel/kernel-wedge/modules/serial-modules	(revision 54198)
+++ packages/kernel/kernel-wedge/modules/serial-modules	(working copy)
@@ -1,2 +1,2 @@
-generic_serial
+generic_serial ?
 serial_cs ?
Index: packages/kernel/linux-kernel-di-i386-2.6/debian/changelog
===================================================================
--- packages/kernel/linux-kernel-di-i386-2.6/debian/changelog	(revision 54198)
+++ packages/kernel/linux-kernel-di-i386-2.6/debian/changelog	(working copy)
@@ -1,7 +1,11 @@
 linux-kernel-di-i386-2.6 (1.63) unstable; urgency=low
 
+  [ Frans Pop ]
   * Add ext2-modules udeb now that we no longer have ext2 compiled in.
 
+  [ Ian Campbell ]
+  * Build -686-bigmem udebs.
+
  -- Frans Pop <fjp@debian.org>  Thu, 10 Jul 2008 09:28:13 +0200
 
 linux-kernel-di-i386-2.6 (1.62) unstable; urgency=low
Index: packages/kernel/linux-kernel-di-i386-2.6/kernel-versions
===================================================================
--- packages/kernel/linux-kernel-di-i386-2.6/kernel-versions	(revision 54198)
+++ packages/kernel/linux-kernel-di-i386-2.6/kernel-versions	(working copy)
@@ -1,2 +1,3 @@
 # arch   version  flavour       installedname        suffix build-depends
 i386     2.6.25-2 486           2.6.25-2-486         -      linux-image-2.6.25-2-486
+i386     2.6.25-2 686-bigmem    2.6.25-2-686-bigmem  -      linux-image-2.6.25-2-686-bigmem
Index: packages/base-installer/kernel/README
===================================================================
--- packages/base-installer/kernel/README	(revision 54198)
+++ packages/base-installer/kernel/README	(working copy)
@@ -61,6 +61,8 @@
     The major version of the running kernel, e.g. 2.6.
   KERNEL_VERSION
     The full version of the running kernel, e.g. 2.6.8.
+  KERNEL_FLAVOUR
+    The flavour of the running kernel, e.g. 486, 686-bigmem or ixp4xx.
   MACHINE
     The machine hardware name (as returned by uname -m).
   NUMCPUS
Index: packages/base-installer/kernel/i386.sh
===================================================================
--- packages/base-installer/kernel/i386.sh	(revision 54198)
+++ packages/base-installer/kernel/i386.sh	(working copy)
@@ -2,16 +2,26 @@
 	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`
+
+	# Only offer bigmem is 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
+        fi
+
 	case "$VENDOR" in
 	    " AuthenticAMD"*)
 		case "$FAMILY" in
-		    " 6"|" 15")	echo k7 ;;
+		    " 6"|" 15") echo k7$BIGMEM ;;
 		    *)		echo 486 ;;
 		esac
 		;;
 	    " GenuineIntel")
 		case "$FAMILY" in
-		    " 6"|" 15")	echo 686 ;;
+		    " 6"|" 15")	echo 686$BIGMEM ;;
 		    *)		echo 486 ;;
 		esac
 		;;
@@ -19,7 +29,7 @@
 		case "$FAMILY" in
 		    " 6")
 			case "$MODEL" in
-			    " 9"|" 10")	echo 686 ;;
+			    " 9"|" 10")	echo 686$BIGMEM ;;
 			    *)		echo 486 ;;
 			esac
 			;;
@@ -39,8 +49,8 @@
 	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" = k7 ]; then
+	if [ "$2" = 686 ] || [ "$2" = 686-bigmem ]; then return 1; fi
+	if [ "$2" = k7 ] || [ "$2" = k7-bigmem ] ; then
 		if echo "$1" | grep -Eq -- "-k7(-.*)?$"; then return 0; fi
 		return 1
 	fi
@@ -53,11 +63,21 @@
 arch_get_kernel () {
 	imgbase=linux-image
 
+	if [ "$1" = k7-bigmem ]; then
+		echo "$imgbase-$KERNEL_MAJOR-686-bigmem"
+		set k7
+	fi
+
 	if [ "$1" = k7 ]; then
 		echo "$imgbase-$KERNEL_MAJOR-k7"
 		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: packages/base-installer/kernel/tests/i386/cittagazze-bigmem.test
===================================================================
--- packages/base-installer/kernel/tests/i386/cittagazze-bigmem.test	(revision 0)
+++ packages/base-installer/kernel/tests/i386/cittagazze-bigmem.test	(revision 0)
@@ -0,0 +1,17 @@
+cpuinfo cittagazze.cpuinfo
+majors 2.6
+flavour k7-bigmem
+kernel-2.6 \
+  linux-image-2.6-686-bigmem \
+  linux-image-2.6-k7 \
+  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-k7 \
+  linux-image-2.6.18-1-486 \
+  linux-image-2.6.18-1-686 \
+  linux-image-2.6.18-1-686-bigmem \
+  linux-image-2.6.18-1-k7
+env KERNEL_FLAVOUR 686-bigmem
Index: packages/base-installer/kernel/tests/i386/cittagazze.test
===================================================================
--- packages/base-installer/kernel/tests/i386/cittagazze.test	(revision 54198)
+++ packages/base-installer/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 KERNEL_FLAVOUR 486
Index: packages/base-installer/kernel/tests/i386/via-c7-Samuel.test
===================================================================
--- packages/base-installer/kernel/tests/i386/via-c7-Samuel.test	(revision 54198)
+++ packages/base-installer/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 KERNEL_FLAVOUR 486
Index: packages/base-installer/kernel/tests/i386/via-c7-Esther.test
===================================================================
--- packages/base-installer/kernel/tests/i386/via-c7-Esther.test	(revision 54198)
+++ packages/base-installer/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 KERNEL_FLAVOUR 486
Index: packages/base-installer/kernel/tests/i386/oqo1.test
===================================================================
--- packages/base-installer/kernel/tests/i386/oqo1.test	(revision 54198)
+++ packages/base-installer/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 KERNEL_FLAVOUR 486
Index: packages/base-installer/kernel/tests/i386/pentium.test
===================================================================
--- packages/base-installer/kernel/tests/i386/pentium.test	(revision 54198)
+++ packages/base-installer/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 KERNEL_FLAVOUR 486
Index: packages/base-installer/kernel/tests/i386/pentium-d-2p.test
===================================================================
--- packages/base-installer/kernel/tests/i386/pentium-d-2p.test	(revision 54198)
+++ packages/base-installer/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 KERNEL_FLAVOUR 486
Index: packages/base-installer/kernel/tests/i386/pentium-3.test
===================================================================
--- packages/base-installer/kernel/tests/i386/pentium-3.test	(revision 54198)
+++ packages/base-installer/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 KERNEL_FLAVOUR 486
Index: packages/base-installer/kernel/tests/i386/pentium-4M-bigmem.test
===================================================================
--- packages/base-installer/kernel/tests/i386/pentium-4M-bigmem.test	(revision 0)
+++ packages/base-installer/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 KERNEL_FLAVOUR 686-bigmem
Index: packages/base-installer/kernel/tests/i386/pentium-4M.test
===================================================================
--- packages/base-installer/kernel/tests/i386/pentium-4M.test	(revision 54198)
+++ packages/base-installer/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 KERNEL_FLAVOUR 486
Index: packages/base-installer/debian/changelog
===================================================================
--- packages/base-installer/debian/changelog	(revision 54198)
+++ packages/base-installer/debian/changelog	(working copy)
@@ -1,3 +1,12 @@
+base-installer (1.93) UNRELEASED; urgency=low
+
+  [ Ian Campbell ]
+  * i386: If the installer is running a -bigmem kernel and the processors
+    support PAE then select a -bigmem kernel for installation. For
+    compatibility with running under Xen.
+
+ -- Ian Campbell <ijc@hellion.org.uk>  Thu, 10 Jul 2008 18:34:25 +0100
+
 base-installer (1.92) unstable; urgency=low
 
   * Call base-installer.d hooks after running debootstrap, for consistency
Index: packages/base-installer/library.sh
===================================================================
--- packages/base-installer/library.sh	(revision 54198)
+++ packages/base-installer/library.sh	(working copy)
@@ -17,6 +17,7 @@
 KERNEL_MAJOR="$(uname -r | cut -d . -f 1,2)"
 KERNEL_VERSION="$(uname -r | cut -d - -f 1)"
 KERNEL_ABI="$(uname -r | cut -d - -f 1,2)"
+KERNEL_FLAVOUR=$(uname -r | cut -d - -f 3-)
 MACHINE="$(uname -m)"
 NUMCPUS=$(cat /var/numcpus 2>/dev/null) || true
 CPUINFO=/proc/cpuinfo
Index: installer/build/config/i386.cfg
===================================================================
--- installer/build/config/i386.cfg	(revision 54198)
+++ installer/build/config/i386.cfg	(working copy)
@@ -1,7 +1,8 @@
-MEDIUM_SUPPORTED = cdrom netboot netboot-gtk hd-media #floppy #monolithic
+MEDIUM_SUPPORTED = cdrom netboot netboot-bigmem netboot-gtk hd-media #floppy #monolithic
 
 # The version of the kernel to use.
-KERNELVERSION = 2.6.25-2-486
+BASEVERSION = 2.6.25-2
+KERNELVERSION = $(BASEVERSION)-486
 KERNELMAJOR = 2.6
 KERNEL_FLAVOUR = di
 KERNELNAME = vmlinuz
Index: installer/build/config/i386/netboot-bigmem.cfg
===================================================================
--- installer/build/config/i386/netboot-bigmem.cfg	(revision 0)
+++ installer/build/config/i386/netboot-bigmem.cfg	(revision 0)
@@ -0,0 +1,6 @@
+KERNELVERSION = $(BASEVERSION)-686-bigmem
+TYPE=netboot
+include config/i386/netboot.cfg
+MANIFEST-NETBOOT_DIR = "PXE boot directory for tftp server (bigmem)"
+MANIFEST-NETBOOT_TAR = "tarball of PXE boot directory (bigmem)"
+MANIFEST-MINIISO = "tiny CD image that boots the netboot installer (bigmem)"
Index: installer/debian/changelog
===================================================================
--- installer/debian/changelog	(revision 54198)
+++ installer/debian/changelog	(working copy)
@@ -41,6 +41,10 @@
   [ Frans Pop ]
   * Add ext2-modules for i386 boot floppy as ext2 is no longer built in.
 
+  [ Ian Campbell ]
+  * Add bigmem netboot variant on i386. For use by Xen and other situations
+    which require PAE.
+
  -- Frans Pop <fjp@debian.org>  Thu, 10 Jul 2008 10:56:27 +0200
 
 debian-installer (20080522) unstable; urgency=low
Index: packages/finish-install/debian/changelog
===================================================================
--- packages/finish-install/debian/changelog	(revision 54198)
+++ packages/finish-install/debian/changelog	(working copy)
@@ -1,3 +1,9 @@
+finish-install (2.19) UNRELEASED; urgency=low
+
+  * Add a getty to hvc0 if Xen is detected.
+
+ -- Ian Campbell <ijc@hellion.org.uk>  Thu, 10 Jul 2008 18:41:24 +0100
+
 finish-install (2.18) unstable; urgency=low
 
   [ Updated translations ]
Index: packages/finish-install/finish-install.d/90console
===================================================================
--- packages/finish-install/finish-install.d/90console	(revision 54198)
+++ packages/finish-install/finish-install.d/90console	(working copy)
@@ -118,3 +118,25 @@
 		    /target/etc/event.d/tty1 > /target/etc/event.d/$console
 	fi
 fi
+
+if [ -e /sys/bus/xen ]; then
+    console=hvc0
+    log "Setting up virtualized serial console on /dev/$console"
+    if [ -f /target/etc/inittab ]; then
+	log "adding console to /etc/inittab"
+	console_line="co:2345:respawn:/sbin/getty $console 9600 linux"
+	if grep -q "^#\?co:" /target/etc/inittab; then
+	    sed -i -e "s|^#\?co:.*$|$console_line|" \
+		/target/etc/inittab
+	else
+	    sedexp="/^1:/i\\$console_line\\"
+	    sed -i -e "$sedexp" /target/etc/inittab
+	fi
+    fi
+    if [ -f /target/etc/event.d/tty1 ]; then
+	log "adding console to /etc/event.d/tty1"
+	sed -e "s/^\(exec.*getty \).*/\1-L $console 9600 linux/" \
+	    -e "s/tty1/$console/g" \
+	    /target/etc/event.d/tty1 > /target/etc/event.d/$console
+    fi
+fi

Reply to: