# how do you compile this kernel??

## idella4

I've just installed gentoo for one main purpose, to run xen.  I thought if any system can do it, it's gentoo.  I've tried it on Ubuntu and fedora 8 and I am yet to get a guest system to boot.  

So I got this far and installed the xen kernel.  The only thing is that the guide I've been following turns out to be cxompletely wrong when it comes to compiling the new gentoo xen kernel.

The guide ia a gentoo document, at http://www.gentoo-wiki.com/Xen.  This is the most disappointing aspect.  It instructs;

 *Quote:*   

> 
> 
> To build the -xen kernel edit the top level Makefile so that this line:
> 
> KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
> ...

 

Looks great, falls flat on its face.  Reports 'doesn't have a target world'.  How did a gentoo document do this??

I've compiled xen from source in Ubuntu.  The source demands a 2.6.18 kernel which has been specially prepared.  I tried pairing the xen source with the gentoo kernel but it doesn't work.  it's hard coded to compile a 2.6.18.hg kernel.

I've tried a basic configuration and 'make', but it hardly gets started before it pulls an error;

```

In file included from arch/i386/kernel/ptrace.c:25:

include/asm/i387.h: In function ‘save_init_fpu’:

include/asm/i387.h:101: warning: implicit declaration of function ‘stts’

  CC      arch/i386/kernel/time-xen.o

arch/i386/kernel/time-xen.c:983: error: redefinition of ‘raw_safe_halt’

include/asm/paravirt.h:223: error: previous definition of ‘raw_safe_halt’ was here

arch/i386/kernel/time-xen.c:992: error: redefinition of ‘halt’

include/asm/paravirt.h:228: error: previous definition of ‘halt’ was here

arch/i386/kernel/time-xen.c: In function ‘halt’:

arch/i386/kernel/time-xen.c:993: warning: implicit declaration of function ‘raw_local_save_flags’

make[1]: *** [arch/i386/kernel/time-xen.o] Error 1

make: *** [arch/i386/kernel] Error 2

idella@ubuntu8:/mnt/data/xen/gentoo-2.6.20/linux-2.6.21-xen$ 

```

So kernel savants of gentoo, remembering it's probably unsupported software, how do you compile this kernel so as to run xen?

----------

## yabbadabbadont

You didn't say, did you emerge xen-sources?  They are keyword masked, but in the portage tree.

http://www.gentoo-portage.com/sys-kernel/xen-sources

Edit: See also http://www.gentoo.org/doc/en/xen-guide.xml

----------

## idella4

Yes, I emerged xen-sources.  I just followed the instructions in the guide and unmasked them.

The second document looks good, but it still doesn't work.  I suggests the line

```

make O=~/build/dom0 menuconfig

```

to build, but the O= option is unknown to make.

So just enter make to build a dom0 kernel, end it leads to the failed point I have already highlightd.

That's why I ask, how do you build this kernel?

----------

## newtonian

Seeing many of your other posts I think you're well past this issue, but...  

Just to add a tip because you haven't set this as solved.  I've found through experience that splitting up sources for into domU and dom0 makes things complicated.

I found it much more straight forward to build dom0 and only dom0 on the dom0 system.  I build domU from within each domU and boot the domU's kernel with pvgrub.  This helps to keep you from adding frontend configs to the backend and vice versa when updating the dom0 kernel.  You also get full use of modules in your domU's which is nice.

https://forums.gentoo.org/viewtopic-t-857650-highlight-howto+pvgrub.html

Cheers,

----------

