[lkml]   [2007]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Determine version of kernel that produced vmcore
On Mon, Jul 09, 2007 at 02:41:31PM +0300, Dan Aloni wrote:
> I don't think it would add much complexity to build process as it
> is now, just like the other tools that transparently do post-linking
> modifications. As far as the developer is concerned, there's just
> the vmlinux and/or bzImage files that get emitted at the end.
> > > Then inside initramfs of the first kernel, a small
> > > util will modify the vmlinux file of the kdump kernel before it
> > > gets loaded so that another special file appearing as
> > > /proc/ under the kdump kernel will present the same
> > > info.
> >
> > Where do you get the info from? If you're in the kdump initrd,
> > then the kdump kernel is already loaded. Do you want to attach the
> > info from the crashed kernel to the initrd of the kdump kernel?
> Not exactly. Let me describe the procedure in greater detail.
> Basically, it would go like this:
> 1. <normal bootloader boot>
> 2. <normal initramfs>
> 3. embed_configfile /proc/ /vmlinux-kdump
> 4. kexec -l vmlinux-kdump <....>
> 5. <boot continues>
> 6. <crash>
> 7. <kdump kernel boot>
> 8. <kdump initramfs runs>
> 9. makedumpfile -i /proc/ <....>
> ** in step 3 embed_configfile modifies vmlinux-kdump in place,
> copying /proc/ into the data section of the vmlinux-kdump
> at certain symbol (e.g. 'char core_info[0x1000]').
> ** in step 9 that data section variable (e.g. core_info) which was
> originally holds the content of /proc/ is being presented
> as /proc/ for the util to use.
> To complete the picture, at the final build stage of vmlinux we
> would have this:
> makedumpfile -g vmlinux.configfile -x vmlinuxx
> embed_configfile vmlinux.configfile vmlinux
> rm vmlinux.configfile

Are you planning to move makedumpfile utility in kernel source three then
for this command to run? Output of "makedumpfile -g" is pretty non-standard
and very customized for filtering. At the same time, this will only work
if first kernel was compiled with debug info. (I think makedumpfile
retrieves all the structure member offset info from .debuginfo seciton).

I am still thinking that why can't we change initrd building process
(Be it mkinitrd or mkdumprd depending on distriution). Whole idea is
that while building an initrd/initramfs for the first kernel, one will
ask user for kdump kernel (if user wishes to load kdump kenrel through
initrd) and then it will generate kdump kenrel's initrd and pack into
first kernel's initrd.

So steps would look something like this.

- mkinitrd takes second kernel's vmlinux as argument
- mkinitrd runs "makedumpfile -g" on debug version of first kernel's vmlinux.
- mkinitrd generates the initramfs for kdump kernel and packs output
of "makedumpfile -g" into that.
- mkinitrd packs statically linked kexec, kdump kernel vmlinux/bzImage,
and kdump kernel initramfs into first kernel's initramfs.

This will save us from doing any changes to kernel build process and
also avoid any run time updation of vmlinux code. Exporting a particular
non-standard output through proc interfaces does not seem to be a very good
idea (/proc/ or /proc/

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-07-10 17:03    [W:0.104 / U:1.452 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site