public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin Schlemmer" <Martin.Schlemmer@nwu.ac.za>
To: "Willy Tarreau" <w@1wt.eu>,
	"Martin Schlemmer" <Martin.Schlemmer@nwu.ac.za>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: Initramfs from existing vmlinuz
Date: Wed, 24 Dec 2008 13:37:59 +0200	[thread overview]
Message-ID: <49523B37.3D93.006F.0@nwu.ac.za> (raw)
In-Reply-To: <20081223233410.GC6800@1wt.eu>

>>> On 2008/12/24 at 01:34 AM, Willy Tarreau <w@1wt.eu> wrote:
> On Wed, Dec 24, 2008 at 12:28:53AM +0200, Martin Schlemmer wrote:

Hi Willy

>> I had a bit of an accident, and wondered if somebody already had to try to 
> extract the initramfs image from an existing vmlinuz?
>> 
>>  I did try google, but either my search terms was not right, or nobody 
> really touched on the subject before, because all the results mostly dealt 
> with an external image.
>> 
>> Any advice will be appreciated.
> 
> yes, it happens to me from time to time.
> You first have to extract and uncompress the ELF image from vmlinuz. For
> this, look for the gzip signature 1F 8B 08 in your vmlinuz, and feed all
> data starting from this point to zcat. Either you do the same on the
> resulting file -and you may find several compressed images- or you simply
> pass it through "objdump -h". It will show you a .init.ramfs section. Use
> the fourth field as the file offset, and dump from that position. You'll
> find your initramfs, likely starting with 1F 8B 08 since it's supposed
> to be compressed with gzip.
> 
> You need an hex editor, dd, zcat and objdump for this. It's not much
> complicated once you have the tools, but it might require a few attempts
> before finding the right image (I tend to find config.gz before initramfs).
> 

Appreciated, I should be able to go from here now - just getting the starting point is sometimes the main issue.


Thanks

M



  reply	other threads:[~2008-12-24 11:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-23 22:28 Initramfs from existing vmlinuz Martin Schlemmer
2008-12-23 23:34 ` Willy Tarreau
2008-12-24 11:37   ` Martin Schlemmer [this message]
2008-12-25 17:55     ` Martin Schlemmer
2008-12-25 18:17     ` Initramfs from existing vmlinuz (#2) Martin Schlemmer
2009-01-05 11:12   ` Initramfs from existing vmlinuz Ian Campbell
2009-01-05 11:47     ` Willy Tarreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49523B37.3D93.006F.0@nwu.ac.za \
    --to=martin.schlemmer@nwu.ac.za \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox