# Genkernel and out-of-tree build.

## cwr

Does anyone know if it's possible to build an out-of-tree kernel with Genkernel?

From the docs it doesn't look like it, but I thought I'd check.

Thanks - Will

----------

## John R. Graham

I would think so since genkernel builds anything that's at /usr/src/linux. What makes you think it wouldn't work?

- John

----------

## cwr

After setting up KBUILD_OUTPUT and running genkernel in /usr/src/linux I get:

```

scripts/basic/fixdep.c:444:1: fatal error: opening dependency file scripts/basic/.fixdep.d: Permission denied

```

which is reasonable, since the /usr/src/linux directory isn't world-writeable.

I've tinkered a bit, with no real idea of what I'm doing, but got no further.

Will

----------

## John R. Graham

Don't know exactly what you were doing but this Just Worked™ for me:

```
# cd /usr/src

# wget https://cdn.kernel.org/pub/linux/kernel/v3.x/linux-3.18.46.tar.xz

<snip>

# tar -xJf linux-3.18.46.tar.xz

# ln -sf linux-3.18.46 linux

# cp linux-3.17.7-gentoo/.config linux/

# genkernel --oldconfig --no-install kernel

<snip>

* initrd: Not building since only the kernel was requested...

*

* Kernel compiled successfully!

*

* Required Kernel Parameters:

*     root=/dev/$ROOT

*     [ And "vga=0x317 splash=verbose" if you use a framebuffer ]

*

*     Where $ROOT is the device node for your root partition as the

*     one specified in /etc/fstab

* Do NOT report kernel bugs as genkernel bugs unless your bug

* is about the default genkernel configuration...

*

* Make sure you have the latest ~arch genkernel before reporting bugs.

```

This was all run as root. What did you do differently? You want to share the kernel source you were trying to build?

- John

----------

## cwr

Thanks - I'll give it shot and report back. (I'm building the most recent Gentoo sources).

Will

----------

