Unable to build xen enabled linux kernel from mercurial repository. Xenolinux kernel version : 2.6.15 Posible reason : There is no xen arch. Now xen is subarch of x86 arch uname -a Linux xeon 2.6.15-gentoo-r1 #1 SMP PREEMPT Tue Jan 24 03:24:48 MSK 2006 i686 Pentium III (Katmai) GenuineIntel GNU/Linux emerge info Portage 2.0.54 (default-linux/x86/2006.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.15-gentoo-r1 i686) ================================================================= System uname: 2.6.15-gentoo-r1 i686 Pentium III (Katmai) Gentoo Base System version 1.6.14 ccache version 2.4 [enabled] dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=pentium3 -mtune=pentium3 -pipe -mno-tls-direct-seg-refs -fomit-frame-pointer -mfpmath=sse -msse -mmmx" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -march=pentium3 -mtune=pentium3 -pipe -mno-tls-direct-seg-refs -fomit-frame-pointer -mfpmath=sse -msse -mmmx" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig candy ccache distlocks prelink sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo http://gentoo.osuosl.org" LANG="ru_RU.UTF-8" LC_ALL="" LINGUAS="en ru" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/rover" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 16bit 3ds 7zip X Xaw3d a52 aac aalib accessibility acl acpi ada aim aimextras aio alsa amarok amd amr ansi ao apache2 apm arts asf asterisk async athena atk atlas atm auctex audiofile avalon avi bash-completion bdf berkdb bidi big-tables bigpatch bind-mysql birdstep bitmap-fonts bl blas blender-game bmp bonobo browserplugin buttons bzip2 c++ c3p0 cacheemu cairo calendar caps ccache cdda cddb cdf cdio cdparanoia cdr cdrom cegui cflags cgi clamav clamd cle266 clearcase clisp cluster cp1251 cpdflib cracklib crypt css ctype cups curl curlwrappers cvsgraph db2 dba dbase dbus dbx dedicated dga dhcp dict dio directfb divx4linux djbfft djvu dlloader dnd doc dri dts dv dvb dvd dvdr dvdread dvi dxr3 dynagraph ecc editor edl eds emacs emacs-w3 emboss encode epiphany erandom esd evo examples exif expat extraengine fam fame fbcon fbdev ffmpeg fftw firebird flac flash fltk font-server fontconfig foomaticdb fortran fpx freetds freetype freewnn ftp fuse gb gcj gd gdbm geometry ggi gif gimp gimpprint ginac gkrellm glitz glut gmail gmailtimestamps gml gmp gnokii gnome gnuplot gnustep gnutls gphoto2 gpm graphviz gs gsl gsm gstreamer gtk gtk2 guile gzip hal haskell howl html http httpd icon iconv icu id3 idea idn ieee1394 imagemagick imap imlib ipv6 irda ithreads jack jack-tmpfs java jbig jikes jmx jpeg jpeg2k justify kde kdepim lcd lcms ldap leim lesstif libcaca libclamav libg++ libvisual libwww live lzo mad mailwrapper math mbox md5sum mhash mikmod milter mime ming mixer mjpeg mmx mmxext mng mono mopac7 motif mozcalendar mozdevelop mozilla mp3 mp4live mpeg mpeg2 mpeg4 mpi mplayer mppe-mppc mpqc msession msql mudflap mule musepack music mysql mysqli mythtv nas ncurses neXt netboot nextaw nls no-suexec nptl nptlonly nsplugin numeric oav objc odbc offensive ogg oggvorbis openal openbabel openexr opengl osc oss pam pascal pccts pcre pda pdf pdfkit pdflib perforce perl php physfs pic plotutils png posix povray ppds prelude profile pwdb python qt quicktime rar readline real recode reiserfs rss rtc ruby samba sasl scanner screen sdk sdl sendfile sendmail sensord server sharedmem slang slp smp sms sndfile sockets softmmu sounds sox speedo speex spell sql sqlite sse sse-filters ssl subversion svg svga sysfs szip tcltk tcpd tetex tga theora threads tidy tiff timidity transcode truetype truetype-fonts type1-fonts ucs2 udev uim uml unicode usb userlocales utf8 v4l v4l2 vcd vcdimager videos vidix visualization voice vorbis win32codecs wma123 wmf wxgtk1 xanim xchatdccserver xchattext xemacs xface xine xinerama xml xml2 xmlrpc xmms xosd xpm xprint xscreensaver xv xvid yv12 zeroconf zlib video_cards_radeon linguas_en linguas_ru userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LDFLAGS
There are actually *two* xen arches, xen0 and xenU. You simply use --arch-override on the command line.
There is no arch Xen in xen kernels 2.6.15 series. Now xen is subarch of x86 arch! You can see it here http://xenbits.xensource.com/linux-2.6-xen.hg?cmd=manifest;manifest=24ac70d848b3c3326fd40e1a9afd774b470aaeae;path=/
I get it now. Sorry, your original explanation didn't make much sense as it made it sound like there was no Xen support in genkernel, which wasn't true.
If xen is part of the x86 subarch you could build a normal x86 kernel compile and then just specify a new config or make a new one based on menuconfig. I havent tested this yet but if its a subarch of x86 thats how it probably would work now. No other arch override or anything should be needed. Just your xen0 or xenU configs need to used/made. If you could test that this works that would be great. Thanks.
Created attachment 78351 [details] Genkernel log
Kernel from mercurial repository has no bzImage target in makefile because of it genkernel stops this error Logfile atached.
Want to try editing /usr/share/genkernel/x86/config.sh and setting KERNEL_MAKE_DIRECTIVE to blank or whatever the target xen now uses is called?
Created attachment 84722 [details] x86-xen0 arch for kernels >=2.6.16 This is x86-xen0 arch configuration files for genkernel for use with >=2.6.16 xen enabled kernels
*** Bug 130141 has been marked as a duplicate of this bug. ***
Initramfs image must be uncompressed to use it with xen 3.0.2
(In reply to comment #10) > Initramfs image must be uncompressed to use it with xen 3.0.2 Thanks for the patch. Does gunzipping the initramfs afterwards work correctly or does it have to be assembled in a non-compressed manner?
(In reply to comment #11) > Thanks for the patch. Does gunzipping the initramfs afterwards work correctly > or does it have to be assembled in a non-compressed manner? > Yes gunzipping the initramfs work correctly. dom0 and domU kernels boots fine For dumU make similar changes
*** Bug 139944 has been marked as a duplicate of this bug. ***
(In reply to comment #12) > (In reply to comment #11) > > Thanks for the patch. Does gunzipping the initramfs afterwards work correctly > > or does it have to be assembled in a non-compressed manner? > > > Yes gunzipping the initramfs work correctly. dom0 and domU kernels boots fine > For dumU make similar changes > Also gzipping again works, even 'gzip -9' maybe only the filename extension is imortant, I will check this.
renaming initramfs-genkernel-x86-2.6.16-xen0 to something like initrd.gz doesn't help, but: # gunzip < initramfs-genkernel-x86-2.6.16-xen0 | gzip -9 > initrd.gz now the initrd works! # file initramfs-genkernel-x86-2.6.16-xen0 initramfs-genkernel-x86-2.6.16-xen0: gzip compressed data, from Unix, last modified: Tue Jul 11 02:18:45 2006, max compression # file initrd.gz initrd.gz: gzip compressed data, from Unix, last modified: Tue Jul 11 22:39:53 2006, max compression # diff initramfs-genkernel-x86-2.6.16-xen0 initrd.gz Files initramfs-genkernel-x86-2.6.16-xen0 and initrd.gz differ Can anyone explain this? Is there anything special when genkernel gzips the initramfs? It's only happening when I'm using Xen, Xen requires itself as the kernel in grub and takes as first module-line the xen-patched kernel and then as secound module-line the initrd
We don't compress the initr{amfs,d} at all. Instead, we simply concatenate the various sections together. It should be simple enough to just gzip the entire thing, as you've done.
Hello, I tried to get a working Xen System with root on lvm2. Thats why I used genkernel to get a initrd with lvm2 Support. But the System will not boot becaus of no valid RAMDISK. But now I tried the unpack and pack again like describe in Comment #15 And now it works fine.. I would say the xen Kernel can not boot with the initrd packed from genkernel R. R.
> I would say the xen Kernel can not boot with the initrd packed from genkernel This comment is very true with xen-sources-2.6.16.26 and genkernel-3.4.0-r1. There was an error during boot about "mdev not found." Mdev is a part of busybox(busybox -s mdev), but the version included in genkernel doesn't have mdev support, so...I created my own busybox bz2 USE="static" emerge busybox cd /usr/share/genkernel/pkg/x86-xen0 cp /bin/busybox . mv busybox-1.1.3+gentoo-x86-xen0.bz2 busybox-1.1.3+gentoo-x86-xen0-bak.bz2 bzip busybox mv busybox.bz2 busybox-1.1.3+gentoo-x86-xen0.bz2 re-run genkernel now it works.
Created attachment 94540 [details] xen0-x86 arch update Update for xen0-x86 arch Now busybox can use mdev
What exactly changed in that tarball?
(In reply to comment #20) > What exactly changed in that tarball? In old tarbol busybox config was outdated... I update it and now initramfs can use mdev
(In reply to comment #21) > (In reply to comment #20) > > What exactly changed in that tarball? > In old tarbol busybox config was outdated... > I update it and now initramfs can use mdev > I forgot to mention that i changed the busybox config first without success. I was guessing that the busybox binary was generated at buildtime, but this isn't the case. A static copy needs to be compiled with mdev support.
> I forgot to mention that i changed the busybox config first without success. I > was guessing that the busybox binary was generated at buildtime, but this isn't > the case. A static copy needs to be compiled with mdev support. > Once you have changed the default config of busybox you need to run genkernel with this options set in your /etc/genkernel.conf # Clear initramfs cpio cache dir CLEAR_CPIO_CACHE="yes" # Clear build cache dir CLEAR_CACHE_DIR="yes"
Shvetsov: so all I need from that tarball is the busybox config and nothing else?
(In reply to comment #24) > Shvetsov: so all I need from that tarball is the busybox config and nothing > else? If you use old tarboll then formaly yes. If not you need to use whole this tarboll
I've diffed the tarball against x86 and xen0, there's no change in the busy-config at all. Every busy-config has CONFIG_MDEV=y (genkernel-3.4.0-r1) He has changed the config.sh, as needed for newer Xen. Xen-3.0.3 is going to be released soon, there will be only a single profile 'xen', which obsoletes xenU and xen0. Also the ARCH=xen thing is no more needed. But the kernelbinary continues to be 'vmlinuz' and he has changed COMPRESS_INITRD to no (I haven't checked if this brings a working initr{d,amfs}!). A default kernelconfig is released with Xen, I think this is the one which genkernel should use as default(don't know how genkernel kernelconfigs are chosen). Here's a short diff against x86, the kernel-config-2.6 not included: diff -ru -U 4 $(pwd)/{x86,x86-xen0} --- /usr/share/genkernel/x86/config.sh 2006-08-27 21:17:35.000000000 +0200 +++ /usr/share/genkernel/x86-xen0/config.sh 2006-08-27 21:52:05.000000000 +0200 @@ -1,10 +1,10 @@ #!/bin/bash # x86/config.sh -KERNEL_MAKE_DIRECTIVE="bzImage" +KERNEL_MAKE_DIRECTIVE="" KERNEL_MAKE_DIRECTIVE_2="" -KERNEL_BINARY="arch/i386/boot/bzImage" +KERNEL_BINARY="vmlinuz" # The dietlibc portion of busybox is commented out right now # other stuff seems to compile fine though USE_DIETLIBC=1 @@ -21,5 +21,5 @@ UTILS_CC=gcc UTILS_AS=as UTILS_LD=ld -COMPRESS_INITRD=yes +COMPRESS_INITRD=no
The more I look at this, the more confused I get. Can someone just post a simple unified diff for this against genkernel 3.4.6?
Does anybody still care about this?
I've been compiling xen kernels with genkernel by doing the following simple procedure. Copy /usr/share/genkernel/${arch} (x86_64 in my case) to /usr/share/genkernel/${arch}-xen Apply the diff as per Comment #26, changing the arch if necessary. The run genkernel with "--arch-override=${arch}-xen" or set it in the config file. The latest available kernels don't differentiate between dom0 and domU, my domUs all use the same kernel image as the machine boots just fine. It might be wise to generate a new default kernel config, with Xen turned on. This is against genkernel 3.4.6, I've not had to build any kernels since 3.4.8 was released, although I highly doubt it'll be any different.
Will Mike's fix be integrated in future genkernel-versions? Or is there a better way to get rid of this bug?
Just been through the process I documented in #29, using genkernel 3.4.8, xen-sources-2.6.20-r6, on an x86 box, and it's worked perfectly. I've got 3 VMs all running the same kernel binary that the machine booted. Just in case anyone is interested. dom0, grub: title=Gentoo Linux (2.6.20-xen-r6) root (hd0,0) kernel /xen.gz dom0_mem=192M module /kernel-genkernel-x86-xen-2.6.20-xen-r6 root=/dev/ram0 init=/linuxrc real_root=/dev/sda3 module /initramfs-genkernel-x86-xen-2.6.20-xen-r6 domU, config: kernel = "/boot/kernel-genkernel-x86-xen-2.6.20-xen-r6"; memory = 512; name = "lvs"; vif = [ "bridge=br1" ]; disk = ['phy:mapper/vgxen-lvs,xvda1,w', 'file:/home/xen/lvs.swap,xvda2,w']; root = "/dev/xvda1 ro"; vcpus = 1;
I'm still not clear on what exactly you're wanting us to do. Please submit a patch in unified diff format like Chris asked for.
Created attachment 136298 [details] x86-xen and x86_64-xen Diff of /usr/share/genkernel. After x86 was simply copied to x86-xen, patch from #26 applied. After x86_64 was simply copied to x86_64-xen, patch from #26 applied. I would suggest the default kernel config is updated to enable Xen support, however I did this myself against xen-sources-2.6.20-r6 and got a *very* different config. For x86 change "Processor type and features" > "Subarchitecture Type" from "PC-compatible" to "Xen-compatible" (CONFIG_X86_PC is not set, CONFIG_X86_XEN=y), then enable "Xen" > "Privileged Guest (domain 0) (NEW)" (XEN_PRIVILEGED_GUEST). For x86_64 enable "Processor type and features" > "Enable Xen compatible kernel" (X86_64_XEN), and again enable "Xen" > "Privileged Guest (domain 0) (NEW)" (XEN_PRIVILEGED_GUEST). diff -u /usr/share/genkernel/x86-xen/kernel-config-2.6 /usr/src/linux/.config ..... @@ -2903,10 +2681,48 @@ # Hardware crypto devices # # CONFIG_CRYPTO_DEV_PADLOCK is not set +CONFIG_CRYPTO_DEV_GEODE=m +CONFIG_XEN=y +CONFIG_XEN_INTERFACE_VERSION=0x00030205 + +# +# XEN +# +CONFIG_XEN_PRIVILEGED_GUEST=y +# CONFIG_XEN_UNPRIVILEGED_GUEST is not set +CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_XENBUS_DEV=y +CONFIG_XEN_BACKEND=y +CONFIG_XEN_BLKDEV_BACKEND=y +CONFIG_XEN_BLKDEV_TAP=y +CONFIG_XEN_NETDEV_BACKEND=y +# CONFIG_XEN_NETDEV_PIPELINED_TRANSMITTER is not set +CONFIG_XEN_NETDEV_LOOPBACK=y +CONFIG_XEN_PCIDEV_BACKEND=y +CONFIG_XEN_PCIDEV_BACKEND_VPCI=y +# CONFIG_XEN_PCIDEV_BACKEND_PASS is not set +# CONFIG_XEN_PCIDEV_BACKEND_SLOT is not set +# CONFIG_XEN_PCIDEV_BE_DEBUG is not set +# CONFIG_XEN_TPMDEV_BACKEND is not set +CONFIG_XEN_BLKDEV_FRONTEND=y +CONFIG_XEN_NETDEV_FRONTEND=y +CONFIG_XEN_FRAMEBUFFER=y +CONFIG_XEN_KEYBOARD=y +CONFIG_XEN_SCRUB_PAGES=y +CONFIG_XEN_DISABLE_SERIAL=y +CONFIG_XEN_SYSFS=y +CONFIG_XEN_COMPAT_030002_AND_LATER=y +# CONFIG_XEN_COMPAT_030004_AND_LATER is not set +# CONFIG_XEN_COMPAT_LATEST_ONLY is not set +CONFIG_XEN_COMPAT=0x030002 +CONFIG_HAVE_IRQ_IGNORE_UNHANDLED=y +CONFIG_NO_IDLE_HZ=y +CONFIG_XEN_SMPBOOT=y
Thanks for the information. That helps out quite a bit. I'm planning on holding off on adding this until after I fix up bug #195693 since I would prefer not have to duplicate my work. There's going to be a lot of work going into genkernel soon to make it a little bit more robust and also to allow for things like Xen, which require significant enough config changes to warrant design changes within genkernel to accommodate.
*** Bug 200558 has been marked as a duplicate of this bug. ***
I've just upgraded genkernel to 3.4.10-r1 and this appears to break the x86-xen0 arch above?! When trying to genkernel after the update it tells me: ra ~ # genkernel --kernel-config=/etc/kernels/kernel-config-x86-xen0-2.6.21-xen0 all * Gentoo Linux Genkernel; Version 3.4.10 * Running with options: --kernel-config=/etc/kernels/kernel-config-x86-xen0-2.6. 21-xen0 all * Linux Kernel 2.6.21-xenU for x86-xen0... * mount: /boot mounted successfully! * kernel: >> Running mrproper... * ERROR: Failed to compile the "mrproper" target... * -- Grepping log... -- Makefile:491: /usr/src/linux-2.6.21-xen/arch/x86-xen0/Makefile: No such file or directory make: *** No rule to make target `/usr/src/linux-2.6.21-xen/arch/x86-xen0/Makefi le'. Stop. * Gentoo Linux Genkernel; Version 3.4.10 * Running with options: --kernel-config=/etc/kernels/kernel-config-x86-xen0-2.6. 21-xen0 all * ERROR: Failed to compile the "mrproper" target... Which kinda makes sense as that directory doesn't exist. I downgraded genkernel to 3.4.9 and it started working again. Does this mean that shortly this way of making Xen kernels isn't going to work?
It seems 3.4.10 lost the ability to specific an arch-override without changing the ARCH passed to the various make commands. I vaguely recall genkernel working out the actual ARCH in all cases previously. I've been able to compile a kernel, and initramfs, that look correct (the machine is back in the office, and has the livecd still in, so I can't test it right now), by changing config.sh to suit. Clearly not a permanent solution however. --- /usr/share/genkernel/x86_64/config.sh-orig 2008-07-22 23:09:43.000000000 +0100 +++ /usr/share/genkernel/x86_64/config.sh 2008-07-22 22:47:12.000000000 +0100 @@ -3,9 +3,9 @@ # # Arch-specific options that normally shouldn't be changed. # -KERNEL_MAKE_DIRECTIVE="bzImage" +KERNEL_MAKE_DIRECTIVE="" KERNEL_MAKE_DIRECTIVE_2="" -KERNEL_BINARY="arch/x86_64/boot/bzImage" +KERNEL_BINARY="vmlinuz" COMPRESS_INITRD=yes Changing x86_64 if required. Mike
The fact that the ARCH "guessing" worked at all previously was a fluke. Nothing special was done for it. When I switched the build order to put the initramfs before the kernel, it started blowing up all over the place, which is why I wrote the function to determine what ARCH should be set to. The previous support for xen (as a separate arch) was a hack, which is why it has been removed in 3.4.10. It may come back in later versions, but it will be in a different form. Anyway, since xen is no longer directly supported by genkernel, I'm marking this as WONTFIX.