# (Solved) Ubuntu kernel on Gentoo

## magemaster

Hello, I want to use the ubuntu feisty Fawn (2.6.20-15) on my laptop, because this was the only one that doesn't freeze on my laptop so far, an HP DV6110BR, chipset nvidia 6150, sempron 3400+...Last edited by magemaster on Sun Apr 29, 2007 2:44 am; edited 1 time in total

----------

## PaulBredbury

This is what I'm using.

/usr/local/portage/sys-kernel/ubuntu-sources/ubuntu-sources-2.6.20_p15-r27.ebuild

```
# Copyright 1999-2007 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

REV_MAJOR=15

REV_MINOR=27

KV="2.6.20"

MY_PV="ubuntu${REV_MAJOR}-r${REV_MINOR}"

KV_FULL="${KV}-${MY_PV}"

DIR="linux-${KV_FULL}"

DESCRIPTION="Ubuntu kernel"

HOMEPAGE="http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/pool/main/l/linux-source-2.6.20/"

SRC_URI="http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/pool/main/l/linux-source-${KV}/linux-source-${KV}_${KV}-${REV_MAJOR}.${REV_MINOR}_all.deb"

KEYWORDS="~x86 ~amd64 ~ppc ~ppc64"

PROVIDE="virtual/linux-sources"

S=${WORKDIR}/usr/src

src_unpack() {

   unpack ${A}

   unpack ./data.tar.gz

   cd "${S}" || die

   unpack ./linux-source-${KV}.tar.bz2

   mv "linux-source-${KV}" "${DIR}" || die

}

src_install() {

   insinto /usr/src

   doins -r "${DIR}" || die

}

pkg_postinst() {

   cd "${ROOT}usr/src" || die

   ln -sfn "${DIR}" linux || die

}
```

Edit: Added missing "tar". Added PROVIDE. Renamed "postinst_sources" to "pkg_postinst" so that it works without inheriting a kernel eclass.Last edited by PaulBredbury on Mon May 14, 2007 5:20 pm; edited 4 times in total

----------

## magemaster

Thanks MAN!!!!!!!!!!!!

----------

## magemaster

Hi, i got some problems here

I create the folder and copied the file inside exactly how is in your post

and emerge ubuntu-sources complain about manifest file.

----------

## Suicidal

do:

```
ebuild /usr/local/portage/sys-kernel/ubuntu-sources/ubuntu-sources-2.6.20_p15-r27.ebuild digest
```

----------

## magemaster

Got some errors, on Lines

4,8,12,16,18,20,21:Syntax error near unexpected token `{

src_unpack() {

----------

## kernelOfTruth

 *PaulBredbury wrote:*   

> This is what I'm using.
> 
> /usr/local/portage/sys-kernel/ubuntu-sources/ubuntu-sources-2.6.20_p15-r27.ebuild
> 
> ```
> ...

 

the linux-source-2.6.20_2.6.20.orig.tar.gz tar-gz file should do it too   :Wink: 

----------

## magemaster

Installed the ubuntu-sources and the systems still freezes.... I give up....

----------

## Suicidal

Its probably not the sources but the config; on the ubuntu system try 

```
zcat /proc/config.gz > ubuntu.config 
```

then copy that to your gentoo system's /usr/src/linux/.config

and recompile your kernel.

----------

## magemaster

Ubuntu doesn't have a /proc/config.gz, but I didn't try /proc/config.... I will ask for a friend that have the same notebook with ubuntu to try.

Someone here have the ubuntu feisty installed to post the output of .config?

----------

## PaulBredbury

There's also:

Any kernel parameters in /boot/grub/menu.lst (e.g. pci=nomsi)

Which modules are loaded at startup.

It may be these which fix it, rather than any Ubuntu-specific kernel source-code tweaks.

----------

## magemaster

Worked so far with the grub parameters from ubuntu ro quiet noapic nolapic and the ubuntu kernel...

will try gentoo kernel later....

And thanks for everyone, I am always quickly and well replied here !

----------

## PaulBredbury

 *magemaster wrote:*   

> noapic

 

Check if there's a firmware upgrade for your laptop available, to fix its APIC.

----------

## magemaster

There isn't any new bios to fix the apic, but they removed the last bios from the page....

My bios is f.28, the I download on the site a month ago, now they removed and the bios now is f.18

http://h10025.www1.hp.com/ewfrf/wc/softwareList?os=228&lc=en&cc=us&dlc=en&product=3289551&lang=en

----------

## PaulBredbury

Here's a new Ubuntu kernel, if anyone's interested. It works with ndiswrapper-1.46

Note that this kernel needs, to compile successfully:

```
$ grep INITRD .config

CONFIG_BLK_DEV_INITRD=y
```

Find it by running make menuconfig and then press / to search on blk_dev_initrd.

/usr/local/portage/sys-kernel/ubuntu-sources/ubuntu-sources-2.6.22_p12-r39.ebuild

```
# Copyright 1999-2007 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

# Posted at http://forums.gentoo.org/viewtopic-p-4056098.html#4056098

# Sources in http://archive.ubuntu.com/ubuntu/pool/main/l/linux-source-2.6.22/

inherit versionator

KV=$(get_version_component_range 1-3)

REV_MAJORP=$(get_version_component_range 4-4)

REV_MAJOR=${REV_MAJORP/p}

REV_MINOR=${PVR##*-r}

MY_PV="ubuntu${REV_MAJOR}-r${REV_MINOR}"

KV_FULL="${KV}-${MY_PV}"

DIR="linux-${KV_FULL}"

DESCRIPTION="Ubuntu kernel"

HOMEPAGE="http://packages.ubuntu.com/gutsy/devel/linux-source-2.6.22"

SRC_URI="http://archive.ubuntu.com/ubuntu/pool/main/l/linux-source-${KV}/linux-source-${KV}_${KV}-${REV_MAJOR}.${REV_MINOR}_all.deb"

KEYWORDS="~x86 ~amd64 ~ppc ~ppc64"

IUSE="symlink"

PROVIDE="virtual/linux-sources"

S=${WORKDIR}

src_unpack() {

   unpack ${A}

   cd "${WORKDIR}"

   [[ -e data.tar.gz ]] && unpack ./data.tar.gz

   # Standardize dir

   if [[ -e usr/src ]] ; then

      unpack ./usr/src/linux-source-${KV}.tar.bz2

   fi

   # Flexible, to handle .deb and .tar.gz sources

   local dir

   [[ -e "${DIR}" ]] && dir="${DIR}"

   [[ -z "${dir}" ]] && dir=$(find -maxdepth 1 -type d -name \*source\*)

   [[ -z "${dir}" ]] && die "source directory"

   if [[ "${dir}" != "${DIR}" ]] ; then

      mv "${dir}" "${DIR}" || die "mv"

   fi

}

src_compile() { :; }

src_install() {

   insinto /usr/src

   doins -r "${DIR}" || die

}

pkg_postinst() {

   if use symlink ; then

      cd "${ROOT}usr/src" || die

      ln -sfn "${DIR}" linux || die

   fi

}
```

----------

