Comment 33 for bug 801840

Revision history for this message
Daniel Manrique (roadmr) wrote : Re: [Bug 801840] Re: MCE Kernel Panic on kernel 2.6.38

On 12-03-28 09:16 AM, Brendan McLearie wrote:
> Thanks Daniel. Sounds like fun.
>
> I've had a quick read of the wiki. Before I get underway, a few
> questions:
>

It's OK, I'm glad to be able to help with any questions.

> 1. It sounds like the ubuntu versions are going to be easier to work
> with because there already looks to be a fari bit of guiding material.
> Is there any problem with using the ubuntu versions rather than
> mainline? Would it be worthwhile / good practice to confirm the results
> of the kernel version bisect using the corresponding ubuntu versions
> before getting underway?

I'd say it's OK to use the Ubuntu kernel, since it already contains the
packaging setup needed to produce .debs to install. But using mainline is also
straightforward enough, see here for how to build from a mainline kernel (sorry
for dumping more documentation on you!)

http://newbiedoc.sourceforge.net/system/kernel-pkg.html

I'll also share my procedure with you, at the end of this comment.

>
> 2. Tool dependencies eg gcc, libraries etc - is it worth installing a
> clean copy of ubuntu in a virtual with specific tools? Particular
> versions?

I don't think it's needed, the dependencies are relatively simple, basically I
just install build-essential and kernel-package and then, if the build process
complains of missing tools, I apt-cache search for them and install any extra
needed stuff.

>
> 3. What version of Ubunutu as a platfrom to actually do the bisect work
> and complile etc?

I'd suggest either Maverick or Natty, but really the compiled kernels should be
version-independent; for instance, when I compiled Jakub's kernels I was running
(I think) either Natty or Precise (and that was kernel 2.6.35 from Maverick). So
you can potentially create the kernels on your current box and then copy them to
the server to be tested.

>
> 4. I have some minimal / rusty experience with eclipse as an IDE. Would
> it be worthwhile trying for some sort of git plugin?

Since you won't really be touching the kernel source code proper, it's probably
not worth it. If anything, you can look for existing GUI tools for git like gitk
or gitg and use that, but it's really not needed I think.

>
> 5. Once compiled is there an easy way to package the result as a .deb
> for installation on the test machine? Is this involved? I have never
> looked at deb packaging.

Yes! The Ubuntu kernel contains everything needed to produce a .deb (look in the
ubuntu/ directory).

Then you can follow instructions here (more documentation, yay):
https://help.ubuntu.com/community/Kernel/Compile

>
> Probably heaps of other questions to come as I get underway......
>

What I usually do is start with a mainline kernel checkout (from linux
upstream), then do each bisect step and run this script to prepare and compile
the kernel, updating only the revision number so it's unique for each step of
the bisection; this assume kernel-package is installed and:

- create $HOME/linux-source
- In there, you need a directory "linux" with the mainline kernel git tree from
kernel.org.
- Also, you need a directory ubuntu-natty with the git tree from ubuntu for that
release.

#!/bin/bash
#Where the linux directory resides
BASE=$HOME/linux-source
REVISION=1step1
BUG=lp801840

cd $BASE/linux
git clean -f -d -x
git clean -f -d -X
cp /boot/config-`uname -r` .config
yes '' | make oldconfig
sed -i 's/CONFIG_DEBUG_INFO=y/CONFIG_DEBUG_INFO=n/' .config
sed -i 's/CONFIG_SYS_HYPERVISOR=y/CONFIG_SYS_HYPERVISOR=n/' .config
sed -i 's/CONFIG_XEN_SYS_HYPERVISOR=y/CONFIG_XEN_SYS_HYPERVISOR=n/' .config
sed -i 's/CONFIG_XEN=y/CONFIG_XEN=n/' .config

sed -rie 's/echo "\+"/#echo "\+"/' scripts/setlocalversion
cd $BASE
cp -a /usr/share/kernel-package ubuntu-package
#The following should be one line each cp command
cp ubuntu-oneiric/debian/control-scripts/{postinst,postrm,preinst,prerm}
ubuntu-package/pkg/image/
cp ubuntu-oneiric/debian/control-scripts/headers-postinst
ubuntu-package/pkg/headers/
#OK, let's compile
cd $BASE/linux
CONCURRENCY_LEVEL=3 fakeroot make-kpkg --initrd \
    --append-to-version=-roadmr-$BUG --revision=$REVISION \
    --overlay-dir=$BASE/ubuntu-package kernel_image kernel_headers