You are not logged in.
Pages: 1
Hello,
everyone
I would like mount the init-img of the kernel.
I`ve tried:
gunzip -dc /boot/kernel26.img >/anywhere/kernel26.dec.img
and then
mount -o loop /anywhere/kernel26.dec.img /elsewhere/
but didn`t have any success.
Then mount -t ext2 -o loop /anywhere/kernel26.dec.img /elsewhere/
Same here.
Is the init.img really a file system or something else.
I would like to look at the kinit-img.
Oh and between i looked and decompressed image with an hex
and it contains some path-like cleartext.
Can anybody help me here?
Offline
Well file give this information on the uncompressed kernel26.img
uncopmress.img: ASCII cpio archive (SVR4 with no CRC)
However any attempt to uncompress it or list the files just fails.
Last edited by pyther (2008-11-10 14:08:19)
Offline
Offline
Thank you for your fast reply.
i`ve tried :
http://www.meinews.net/cpio-t170074.htm … 1359b1a6c&
with
$ mkdir work
$ cd work
$ zcat ../initird | cpio -iv
but it didn`t decompress the files and with directory parameter it
only says xxxx Blocks. By the way don`t try it as root, because the files have
absolute paths!
I could look into the degzipped file with archive-manager.
Which is enough at the moment, but in the above page, it is mentioned
that i could put in changes of the image back into a gzipped image as the original
one.
Maybe some has one idea or experience in this. Let`s wait.
Offline
Once again: http://wiki.archlinux.org/index.php/Mki … r_the_hood
Both methods there work for me.
Offline
Thank you,
bender02
As you mentioned "once again", i am a little bit ashamed.
I should have looked in the wiki, but i didn`t thought
this case would even be mentioned.
I didn`t have heard about cpio and for my excuse, i looked
for "mount kernel26.img". I thought it would be an image,
overlayed by gzip. Very nice that you repeat this case again.
For completing the wiki or better say for extracting the files into
a chosen dir, it would be like that:
zcat /boot/kernel26.img | cpio -id --no-absolute-filenames "target-dir"
You help me a lot. If you can, could you tell my how to change the files
and then create a img like the original one with absolute paths, out of the
"target-dir"?
Thanks for your answers
Offline
Sorry, I could have said that it's impossible to just mount the first time
For assembling it back (change the filenames as needed) (to be run as root) (make sure that you also extract the image as root in the first place, since it contains some device nodes, which regular users are not allowed to create):
cd /tmp/initrd
find . | cpio -o -H newc > /tmp/initrd.temp
gzip -c /tmp/initrd.temp > /boot/kernel26.img
EDIT: As far as editing files goes: once you extract the image, you can edit the extracted files normally, as any other files. After you're done editing, just compress it back with the method above.
Last edited by bender02 (2008-11-10 23:26:15)
Offline
Pages: 1