[OT?] is there no package containing the raw "vmlinux" kernel image?
Stefan Bader
stefan.bader at canonical.com
Thu Jul 1 12:58:57 UTC 2010
On 07/01/2010 02:27 PM, Robert P. J. Day wrote:
> On Thu, 1 Jul 2010, Stefan Bader wrote:
>
>> Its always hard to tell whether things are detailed enough. Try
>>
>> https://wiki.ubuntu.com/Kernel/Dev and there
>> https://wiki.ubuntu.com/KernelTeam/KernelMaintenanceStarter in particular.
>
> great, thanks, i'll check that out, but let me (reluctantly) drag
> this out for one most post since i think i found what i want.
>
> to recap (and sorry for boring folks with what are trivialities
> relative to what normally happens on this list), i'm updating a lesson
> on how to debug a running kernel and loadable modules with simple gdb,
> and that requires both access to /proc/kcore and a raw vmlinux file
> that corresponds *exactly* to the running kernel.
>
> if a student of mine can rebuild a new kernel and reboot, then it's
> trivial. but in some cases, i know some of my students *don't* have
> the freedom to reboot the system to get to a new kernel -- they can,
> however, download source and configure and build to get a vmlinux file
> that (ideally) would match the running kernel.
>
> from reading:
>
> https://help.ubuntu.com/community/Kernel/Compile
>
> all i really want is to download the source tree that was used to
> build the running kernel:
>
> $ uname -r
> 2.6.32-22-generic
> $
>
> at which point i can simply configure based on the appropriate
> /boot/config file and build, does that make sense?
>
> i installed what *looked* like an appropriate kernel source file:
>
> $ sudo apt-get install linux-source-2.6.32
>
> that gave me a kernel source tar file, i unloaded it and now i have a
> source tree. but the actual info is:
>
> ii linux-source-2.6.32 2.6.32-23.37
>
> which doesn't exactly match my current kernel. so ... long story
> short, all i want is the pristine, unconfigured source tree that
> matches my current kernel, and i'm pretty sure i can take it from
> there. i apologize if i'm making this harder than it has to be.
>
> i'm not *trying* to be dense about this, i am merely succeeding.
>
> rday
>
The package linux-source is one I personally find the least useful. It contains
the raw upstream part of the kernel tree (iirc) but misses the configuration and
I believe also any additions.
The method of using apt-get has its limits as you need to have source packages
enabled in your config and packages can get removed when they are superseded.
The command would be "apt-get source linux-image-2.6.32-23-generic" for example.
I am not sure it really is sounding simpler to you, but I find the method of
using git simpler. You would do a one time:
#> git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
#> cd ubuntu-lucid
#> uname -a
Linux maximegalon 2.6.32-23-generic #37-Ubuntu SMP Mon Jun 28 13:06:35 UTC 2010
i686 GNU/Linux
(Note the #37)
#> git checkout Ubuntu-2.6.32-23.37
Now you have the exactly matching kernel source and could build a generic kernel
with:
#> fakeroot debian/rules binary-generic
Even without the debug package, you got the vmlinux file you are looking for in
debian/build/build-generic.
-Stefan
More information about the kernel-team
mailing list