Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help exteracting initramfs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
l88
n00b
n00b


Joined: 29 Nov 2013
Posts: 4

PostPosted: Thu Jan 16, 2014 10:39 am    Post subject: Help exteracting initramfs Reply with quote

Hello,

I need help, i'm trying to extract an initramfs file from gentoo but no joy till now.

the initramfs file is

/boot/initramfs-genkernel-x86-3.10.17-gentoo

and I tried zcat command, gunzip with | cpio -i and everytime i get this error message

gzip: ../initramfs-genkernel-x86-3.10.17-gentoo: not in gzip format
cpio: premature end of archive


does anyone know how to extract the initramfs file i have here?? I need to get some part of the script in the init

Thanks,
Badar
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1746

PostPosted: Thu Jan 16, 2014 1:44 pm    Post subject: Reply with quote

`file <path to initramfs image>` is your friend.
Genkernel uses xz compression
Back to top
View user's profile Send private message
l88
n00b
n00b


Joined: 29 Nov 2013
Posts: 4

PostPosted: Thu Jan 16, 2014 4:12 pm    Post subject: Reply with quote

szatox wrote:
`file <path to initramfs image>` is your friend.
Genkernel uses xz compression


I tried that earlier

but it's still not doing it for me -- am i doing something wrong


root~: /boot/initram# xz --decompress ../initramfs-genkernel-x86-3.10.17-gentoo
xz: ../initramfs-genkernel-x86-3.10.17-gentoo: Filename has an unknown suffix, skipping
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2970
Location: Germany

PostPosted: Thu Jan 16, 2014 4:18 pm    Post subject: Reply with quote

try piping

Code:

mkdir /tmp/initramfs
cd /tmp/initramfs
unxz < /path/to/initramfsfile | cpio -i -d -H newc --no-absolute-filenames


if it's not xz after all (verify with 'file initramfsfile') use gunzip, bunzip2, etc. etc. instead
Back to top
View user's profile Send private message
kurisu
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2011
Posts: 147
Location: Munich, Germany

PostPosted: Thu Jan 16, 2014 6:48 pm    Post subject: Reply with quote

Try:

Code:
xzcat /path/to/initramfs/image > initramfs.cpio


Never had any issues this way.
Back to top
View user's profile Send private message
l88
n00b
n00b


Joined: 29 Nov 2013
Posts: 4

PostPosted: Mon Jan 20, 2014 5:25 pm    Post subject: Reply with quote

thanks all for your help

I've managed to extract the initramfs content by doing the following

unxz < /path/initramfs-genkernel-x86-3.10.17-gentoo | cpio -i -d -H newc --no-absolute-filenames

Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum