Because I found numerous pages and list questions about “How to build a non PAE Debian XEN Kernel?“, I will try myself in English to explain my solution to whom it might concern.
It will probably concern other people who do not go along well - like me - with the idea of a DomU with the ability to load and unload the whole kernel tree build as modules.
I stick by the rule for Servers, “Keep the kernel as small as possible.“ and install a second generic kernel to provide an easy way to change the Hardware when needed.
I have a Via Epia mainboard and therefore I can not use a PAE enabled kernel. There are a number of other people having the same problem. Since the newest Debian Etch Kernel Version 2.6.18-4 the developer do not longer provide a non PAE Kernel for XEN.
The problem is that this is mentioned nowhere, neither in the package nor anywhere else. That is why some of us spending a lot of time - for me about 10h - to figure that out and to find a work around. The Debian kernel developer seem to stick by the words, “We can't provide too many Kernel versions.“, or even worse “Who needs a XEN Kernel without PAE anyway“. I am sorry that I can not quote them any more but on my search I didn't know about writing this How-to. So I laughed bitterly and went on.
I tried many things.
The easiest way to solve this problem would be to install the old kernel Version 2.6.18-3. Asking your favourite search engine provided me only hits to site talking about this version but not providing it.
Maybe some of you have more luck but there still is the pain to use an old Version with possible security holes.
The best way to build your own modified version of a program is to get the sources, modify the make rules and hit debian/rules.
Doesn't work this way for this one!
Oho… I tried this for a long time encouraged by finding theses very informative sites
Using these commands mostly inspired by the last URL
apt-get source linux-2.6 apt-get install build-essential apt-get build-dep linux-2.6 cd linux-2.6-* debian/rules debian/build debian/stamps make -f debian/rules.gen setup-i386-xen-686
I did not edit the .config file or any other config* file. He said it wouldn't work. I read the debian/rules.gen file and searched for the keyword binary-arch-i386-xen-686 he used to compile and found his problem.
$(MAKE) -f debian/rules.real binary-arch-flavour MAJOR='2.6' FLAVOUR='686' KCONFIG='config i386/config i386/xen/config _xen/config i386/config.686-bigmem' LOCALVERSION_HEADERS='-xen' SUBARCH='xen' UPSTREAMVERSION='2.6.18' INITRD_CMD='mkinitramfs-kpkg' MODULES='True' XEN_VERSIONS='3.0.3-1-i386-pae' SOURCEVERSION='2.6.18.dfsg.1-12etch2' VERSION='2.6.18' KERNEL_HEADER_DIRS='i386' KERNEL_ARCH='i386' ABINAME='-4' TYPE='plain-xen' LOCALVERSION='-xen-686' ARCH='i386' COMPILER='gcc-4.1'
The system used by the developer is very nice and handy. They are „loading“ numerous configuration files KCONFIG= starting by the most generic common to all Debian kernel versions and ten getting more and more specific.
Now you can see why Phillip did not succeed.
My solution was to edit the i386/config.686-bigmem to i386/config.686 because bigmem was causing the problem. Theses changes did what I wanted but the compilation did not finish.
binary-arch-i386-xen-686-real:
# $(MAKE) -f debian/rules.real binary-arch-flavour MAJOR='2.6' FLAVOUR='686' KCONFIG='config i386/config i386/xen/config _xen/config i386/config.686-bigmem' LOCALVERSION_HEADERS='-xen' SUBARCH='xen' UPSTREAMVERSION='2.6.18' INITRD_CMD='mkinitramfs-kpkg' MODULES='True' XEN_VERSIONS='3.0.3-1-i386-pae' SOURCEVERSION='2.6.18.dfsg.1-12etch2' VERSION='2.6.18' KERNEL_HEADER_DIRS='i386' KERNEL_ARCH='i386' ABINAME='-4' TYPE='plain-xen' LOCALVERSION='-xen-686' ARCH='i386' COMPILER='gcc-4.1'
# $(MAKE) -f debian/rules.real install-dummy DH_OPTIONS='-pxen-linux-system-2.6.18-4-xen-686' MAJOR='2.6' FLAVOUR='686' KCONFIG='config i386/config i386/xen/config _xen/config i386/config.686-bigmem' LOCALVERSION_HEADERS='-xen' SUBARCH='xen' UPSTREAMVERSION='2.6.18' INITRD_CMD='mkinitramfs-kpkg' MODULES='True' XEN_VERSIONS='3.0.3-1-i386-pae' SOURCEVERSION='2.6.18.dfsg.1-12etch2' VERSION='2.6.18' KERNEL_HEADER_DIRS='i386' KERNEL_ARCH='i386' ABINAME='-4' TYPE='plain-xen' LOCALVERSION='-xen-686' ARCH='i386' COMPILER='gcc-4.1'
# $(MAKE) -f debian/rules.real build MAJOR='2.6' FLAVOUR='686' KCONFIG='config i386/config i386/xen/config _xen/config i386/config.686-bigmem' LOCALVERSION_HEADERS='-xen' SUBARCH='xen' UPSTREAMVERSION='2.6.18' INITRD_CMD='mkinitramfs-kpkg' MODULES='True' XEN_VERSIONS='3.0.3-1-i386-pae' SOURCEVERSION='2.6.18.dfsg.1-12etch2' VERSION='2.6.18' KERNEL_HEADER_DIRS='i386' KERNEL_ARCH='i386' ABINAME='-4' TYPE='plain-xen' LOCALVERSION='-xen-686' ARCH='i386' COMPILER='gcc-4.1'
$(MAKE) -f debian/rules.real binary-arch-flavour MAJOR='2.6' FLAVOUR='686' KCONFIG='config i386/config i386/xen/config _xen/config i386/config.686' LOCALVERSION_HEADERS='-xen' SUBARCH='xen' UPSTREAMVERSION='2.6.18' INITRD_CMD='mkinitramfs-kpkg' MODULES='True' XEN_VERSIONS='3.0.3-1-i386' SOURCEVERSION='2.6.18.dfsg.1-12etch2' VERSION='2.6.18' KERNEL_HEADER_DIRS='i386' KERNEL_ARCH='i386' ABINAME='' TYPE='plain-xen' LOCALVERSION='-xen-686' ARCH='i386' COMPILER='gcc-4.1'
$(MAKE) -f debian/rules.real install-dummy DH_OPTIONS='-pxen-linux-system-2.6.18-4-xen-686' MAJOR='2.6' FLAVOUR='686' KCONFIG='config i386/config i386/xen/config _xen/config i386/config.686' LOCALVERSION_HEADERS='-xen' SUBARCH='xen' UPSTREAMVERSION='2.6.18' INITRD_CMD='mkinitramfs-kpkg' MODULES='True' XEN_VERSIONS='3.0.3-1-i386' SOURCEVERSION='2.6.18.dfsg.1-12etch2' VERSION='2.6.18' KERNEL_HEADER_DIRS='i386' KERNEL_ARCH='i386' ABINAME='' TYPE='plain-xen' LOCALVERSION='-xen-686' ARCH='i386' COMPILER='gcc-4.1'
build-i386-xen-686-real:
$(MAKE) -f debian/rules.real build MAJOR='2.6' FLAVOUR='686' KCONFIG='config i386/config i386/xen/config _xen/config i386/config.686' LOCALVERSION_HEADERS='-xen' SUBARCH='xen' UPSTREAMVERSION='2.6.18' INITRD_CMD='mkinitramfs-kpkg' MODULES='True' XEN_VERSIONS='3.0.3-1-i386' SOURCEVERSION='2.6.18.dfsg.1-12etch2' VERSION='2.6.18' KERNEL_HEADER_DIRS='i386' KERNEL_ARCH='i386' ABINAME='' TYPE='plain-xen' LOCALVERSION='-xen-686' ARCH='i386' COMPILER='gcc-4.1'
setup-i386-xen-686-real:
# $(MAKE) -f debian/rules.real setup-flavour MAJOR='2.6' FLAVOUR='686' KCONFIG='config i386/config i386/xen/config _xen/config i386/config.686-bigmem' LOCALVERSION_HEADERS='-xen' SUBARCH='xen' UPSTREAMVERSION='2.6.18' INITRD_CMD='mkinitramfs-kpkg' MODULES='True' XEN_VERSIONS='3.0.3-1-i386-pae' SOURCEVERSION='2.6.18.dfsg.1-12etch2' VERSION='2.6.18' KERNEL_HEADER_DIRS='i386' KERNEL_ARCH='i386' ABINAME='' TYPE='plain-xen' LOCALVERSION='-xen-686' ARCH='i386' COMPILER='gcc-4.1'
$(MAKE) -f debian/rules.real setup-flavour MAJOR='2.6' FLAVOUR='686' KCONFIG='config i386/config i386/xen/config _xen/config i386/config.686' LOCALVERSION_HEADERS='-xen' SUBARCH='xen' UPSTREAMVERSION='2.6.18' INITRD_CMD='mkinitramfs-kpkg' MODULES='True' XEN_VERSIONS='3.0.3-1-i386' SOURCEVERSION='2.6.18.dfsg.1-12etch2' VERSION='2.6.18' KERNEL_HEADER_DIRS='i386' KERNEL_ARCH='i386' ABINAME='-4' TYPE='plain-xen' LOCALVERSION='-xen-686' ARCH='i386' COMPILER='gcc-4.1'I think still think that this would have been the best way but I ran into the ABI problem! Maybe someone has some ideas solving it.
make[2]: Leaving directory `/usr/src/linux-2.6-2.6.18.dfsg.1/debian/build/build-i386-xen-686' python2.4 debian/bin/abicheck.py debian/build/build-i386-xen-686 i386 xen 686 ABI has changed! Refusing to continue. Added symbols: gs_block_til_ready module: drivers/char/generic_serial gs_chars_in_buffer module: drivers/char/generic_serial gs_close module: drivers/char/generic_serial gs_flush_buffer module: drivers/char/generic_serial gs_flush_chars module: drivers/char/generic_serial gs_getserial module: drivers/char/generic_serial gs_got_break module: drivers/char/generic_serial gs_hangup module: drivers/char/generic_serial gs_init_port module: drivers/char/generic_serial gs_put_char module: drivers/char/generic_serial gs_set_termios module: drivers/char/generic_serial gs_setserial module: drivers/char/generic_serial gs_start module: drivers/char/generic_serial gs_stop module: drivers/char/generic_serial gs_write module: drivers/char/generic_serial gs_write_room module: drivers/char/generic_serial Changed symbols: DAC1064_global_init version: 0xdcf9cb8c -> 0x5197d1d6 DAC1064_global_restore version: 0xaf6c7fe5 -> 0x72927ce6 DoC2k_init version: 0x7332e934 -> 0xe3150db5 [... and so on] zl10353_attach version: 0x5703ab73 -> 0xa3246e38 zl10353_write version: 0x1107cef5 -> 0xdd145ee3 zone_table version: 0xdc0fc19b -> 0x4d84bf7a make[1]: *** [debian/stamps/build-i386-xen-686-plain-xen] Fehler 1 make[1]: Leaving directory `/usr/src/linux-2.6-2.6.18.dfsg.1' make: *** [binary-arch-i386-xen-686-real] Fehler 2
I tried to override the ABI check but it did not work.
That was the way I happily build kernels for many years. Since newer times I mostly stick to the huge Debian kernel. Mostly because I got lazy ;)
This package does not seem to provide the real Debian kernel. I never knew that so I never build the right kernels…
Anyway, loading the „here is our patch to the vanilla kernel“ package linux-patch-debian-2.6.18 I tried configure it with XEN. It didn't work either using the standard way.
Nice idea but no way. You can read on other how-to's that I did it many times successfully but since XEN gets provided by Debian and Ubuntu - for both I had my problems1) - I want to use it and more important I want the comfort.
I almost gave up and thought about how to secure my home server system through other mechanisms, I found an older bookmark I had about some XEN problems with Debian. Actually it was / is a bug found times before the final release of Debian Etch concerning the ability to patch the Debian linux-source* package with the Debian linux-patch-debian-2.6.18 package.
Following the work around I finally managed to build a Debian XEN kernel without PAE.
aptitude install linux-patch-debian-2.6.18 linux-source-2.6.18 kernel-package libncurses-dev
Don't forget a compiler.
$ variables get replaced by the shell.
mkdir /usr/src/kernel-patches/all/2.6.18/xen/
#!/bin/sh echo "Applying debian patch with xen parts" if [ -z "$KPKG_ARCH" ]; then KPKG_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH) fi /usr/src/kernel-patches/all/2.6.18/apply/debian --arch $KPKG_ARCH --subarch xen
#!/bin/sh set -e upstream="2.6.18" exec "/usr/src/kernel-patches/all/$upstream/apply/debian" "$upstream-4"
chmod a+x /usr/src/kernel-patches/all/2.6.18/apply/xen /usr/src/kernel-patches/all/2.6.18/unpatch/xen
cd /usr/src tar xjf linux-source-2.6.18.tar.bz cd linux-source-2.6.18 make-kpkg --added-patches xen --initrd --revision 2.6.18-4 --append-to-version -c-xen-nopae-686 --config menuconfig configure kernel_image
Now remove the Highmem set to 64 GB changing it to off. Than hit exit and save your changes. After a very long time the package is ready to install.
Maybe someone can explain how to build a package like linux-modules-2.6.18-4-xen-686.
It is somehow understandable that the Debian developers are not able to provide too many kernels. But they need to keep the package information up to date and need to mention that their XEN does only run with PAE capable CPUs.
It would be nice of them to provide a mall quick-and-dirty how-to about this, what I did here, since they decided no to deliver non-PAE XEN kernel any more.
I is a shame and I myself struggle a bit about my loved Debian that such a bug dose not get fixed.
I hope I could help some people out there and would appreciate some help about the two open questions.
Diskussion
you made my day and prevent me for wasting a day of research on this problem.
thanks dude.
you made my day and prevent me for wasting a day of research on this problem.
thanks dude.
If you get the next error
black:/usr/src/linux-source-2.6.18# make-kpkg –added-patches xen –initrd –revision 2.6.18-4 –append-to-version -c-xen-nopae-686 –config menuconfig configure kernel_image I note you are using a hyphen in the revision number. Please ensure that the upstream and debian revision numbers are policy compliant enough that dpkg and shall not choke on them at the end of the compile exec make -f /usr/share/kernel-package/ruleset/minimal.mk debian DEBIAN_REVISION=2.6.18-4 APPEND_TO_VERSION=-c-xen-nopae-686 KPKG_SELECTED_PATCHES=”xen” INITRD=YES /usr/share/kernel-package/ruleset/minimal.mk:53: No .config file found /usr/share/kernel-package/ruleset/minimal.mk:98: *** Please create a .config file. Alto. Failed to create a ./debian directory: No existe el fichero o el directorio at /usr/bin/make-kpkg line 1096.
You can try black:/usr/src/linux-source-2.6.18#make menuconfig
and then black:/usr/src/linux-source-2.6.18# make-kpkg –added-patches xen –initrd –revision 2.6.18-4 –append-to-version -c-xen-nopae-686 –config menuconfig configure kernel_image
Hi,
on this Site: http://debiananwenderhandbuch.de/kernelbauen.html I found the target “modules”. This should build the modules Package. Just append modules to your make-kpkg line. (It is still building the packages...)
Thanks for the research and help!
Greetings Jens
Danke sehr! This was an excruciatingly annoying problem that you thankfully found a solution to. I wasted a lot of time trying to figure this out, mostly due to the 1001 ways of building a kernel from Debian sources.
Hi!
Ich kämpfe immer noch mit dem Erzeugen des Kernels auf meinem Epia EK8000. Ich habe mir die config* aus dem /boot-verzeichnis der Standardinstallation ins /usr/src/linux-source-2.6.18-Verzeichnis als .config kopiert. Dann das Kompilieren gestartet (zuerst noch ein .debian-Verzeichnis erstellt).
Läuft alles durch. Aber nach dem dpkg -i linux-image…..deb fehlt der Eintrag in Grub.
Also per Hand nachgetragen. Kernel bootet, hat aber keine XEN-eigenschaften. Hätte ich mit menuconfig einen XEN-Prozessor eintragen müssen? Dann wird nämlich der Unerpunkt XEN zugänglich. Wie muss die .config-Datei aussehen?
Danke für die Hilfe
Gruß Uli.