Home » Questions » Computers [ Ask a new question ]

Where is vmlinux on my Ubuntu installation?

Where is vmlinux on my Ubuntu installation?

I'm trying to work with starting up oprofile, and I'm running into a problem at this step:

Asked by: Guest | Views: 109
Total answers/comments: 5
Guest [Entry]

"It should be in your /boot directory - mu Ubuntu actually has compressed versions along the lines of vmlinuz-2.6.28-16-generic.

Whether oprofile can work with those is not a question I can answer."
Guest [Entry]

"Hm, just wanted to put this as a comment to the above answer by @paxdiablo, but cannot find the comment button? Anyways..

The thing is that the vmlinuz file is compressed - and for debugging purposes, you need an uncompressed vmlinux one (and preferably one built with debugging symbols - which the default vmlinuz-es coming with Ubuntu do not have, as they are stripped of symbols).

Now, it is possible to unpack a vmlinuz into a vmlinux file - however, that is not trivial; first you have to find a byte offset in vmlinuz where the compressed file starts, and then use dd and zcat to unpack only the necessary part. In detail, this is explained in: ""[ubuntu] How to trace this bug? - Ubuntu Forums - post #4""; in brief, below is my example terminal command log, based on that post:

$ od -A d -t x1 /boot/vmlinuz-$(uname -r) | grep '1f 8b 08 00' --colour
0013920 f3 a5 fc 5e 8d 83 70 23 3d 00 ff e0 *1f 8b 08 00*

$ wcalc 13920+12
= 13932

$ dd if=/boot/vmlinuz-$(uname -r) bs=1 skip=13932 | zcat > vmlinux-$(uname -r)
4022132+0 records in
4022132+0 records out
4022132 bytes (4,0 MB) copied, 42,1695 s, 95,4 kB/s

gzip: stdin: decompression OK, trailing garbage ignored

$ file vmlinux-2.6.32-25-generic
vmlinux-2.6.32-25-generic: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped

Well, hope this helps,

Cheers!"
Guest [Entry]

See bugs.launchpad.net/ubuntu/+source/linux/+bug/289087
Guest [Entry]

"Packages that contain linux kernel (the vmlinuz file) are called linux-image-VERSION-ARCH in Debian/Ubuntu.

You can list them with command dpkg -l linux-image-*, and for installed package (it has ii mark in first column) you can get a list of files in it with dpkg -L linux-image-VERSION-ARCH, e.g. dpkg -L linux-image-2.6.31-17-386 for a recent Karmic install.

Notice that l is lowercase in first command and uppercase in second."
Guest [Entry]

"Try the following command:

apt-get linux-image.*-dbg

usually the vmlinux locates in /usr/lib/debug/ after installation"