Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-06-2010, 12:44 AM
|
#1
|
LQ Newbie
Registered: Nov 2008
Posts: 9
Rep:
|
How to obtain Image from zImage?
Hi,
I have obtained zImage from uImage by using this script http://buffalo.nas-central.org/wiki/...ract_an_uImage
Then I used the zlib library from www.zlib.net and the accompanying zpipe.c file to uncompress zImage but I am getting this error
zpipe: invalid or incomplete deflate data
Am I on the right path? My aim is to obtain completely uncompressed Image.
EDIT: The kernel is 2.6.29
Last edited by Ho0ligaN; 08-06-2010 at 12:46 AM.
|
|
|
08-06-2010, 07:46 AM
|
#2
|
Senior Member
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,127
Rep: 
|
zimage is a self extracting gzip compressed image, you might be able to decompress it by finding the starting offset of the data in the file
|
|
|
08-06-2010, 08:25 AM
|
#3
|
Senior Member
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,127
Rep: 
|
|
|
1 members found this post helpful.
|
08-09-2010, 04:43 AM
|
#4
|
LQ Newbie
Registered: Nov 2008
Posts: 9
Original Poster
Rep:
|
Hey thanks for the link. I followed that method as follows
Code:
$ arm-linux-objdump -EL -b binary -D -m armv5t zImage | grep 8b1f
39e0: 088b1f00 stmeq fp, {r8, r9, sl, fp, ip}
11a60: c8b1f58e ldmgt r1!, {r1, r2, r3, r7, r8, sl, ip, sp, lr, pc}
Then obtained piggy.gz
Code:
$ dd if=zImage of=piggy.gz bs=1 skip=14816
Now, when I try gunzipping piggy.gz it still says its not in gunzip format
Code:
$ gunzip piggy.gz
gzip: piggy.gz: not in gzip format
any solutions?
|
|
|
08-10-2010, 04:18 AM
|
#5
|
LQ Newbie
Registered: Nov 2008
Posts: 9
Original Poster
Rep:
|
Bump!
|
|
|
08-10-2010, 06:41 AM
|
#6
|
Senior Member
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,127
Rep: 
|
Are you sure you wanted little-endian? ARM can be either.
|
|
|
08-10-2010, 07:10 AM
|
#7
|
LQ Newbie
Registered: Nov 2008
Posts: 9
Original Poster
Rep:
|
I tried both, but to no avail
This is for android BTW, but I think it should work for all zImages?
|
|
|
08-10-2010, 08:13 AM
|
#8
|
LQ Newbie
Registered: Nov 2008
Posts: 9
Original Poster
Rep:
|
Code:
dd if=zImage of=piggy.gz bs=1 skip=14817
That did the trick!
|
|
|
11-30-2010, 06:04 PM
|
#9
|
LQ Newbie
Registered: Nov 2010
Posts: 1
Rep:
|
armeb-linux-gnu-objdump.zz
openinkpot.org/wiki/Documentation/ZImageFormat refers to armeb-linux-gnu-objdump.zz. I don't have that executable, so I just used
hexdump zImage |grep -E "8b ?1f" and it worked just fine.
|
|
|
07-15-2017, 04:29 AM
|
#10
|
LQ Newbie
Registered: Jul 2017
Posts: 6
Rep: 
|
xz
your piggy can also be in xz format. have you tried executing file?
edit:
i mean the built in file command with the magic files
|
|
|
07-15-2017, 07:47 AM
|
#11
|
LQ Guru
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 5,116
|
zImage is a compressed format of Linux kernel, not an actual image.
|
|
|
07-15-2017, 08:30 PM
|
#12
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
Hello and welcome to LQ, willem640.
We usually try to avoid posting to very old threads. They tend to have out of date information. If you can advance some old threads then OK otherwise we have many current questions that need assistance. 
|
|
|
All times are GMT -5. The time now is 05:35 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|