Karmic 9.10: cannot uncompress initrd.lz

Asked by Giovanni Minniti

Trying to uncompress initrd.lz with "unlzma -c -S .lz initrd.lz | cpio -id" always fails.
Instead I get the following error message unlzma: Decoder error.

Is this a bug? If not please advice

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu casper Edit question
Assignee:
No assignee Edit question
Solved by:
Giovanni Minniti
Solved:
Last query:
Last reply:
Revision history for this message
Delan Azabani (azabani) said :
#1

First of all, it's "/initrd.gz", not "/initrd.lz". Why are you trying to uncompress this anyway? This is an important system file for linux and is handled internally by the kernel. You shouldn't have a need to touch it.

Revision history for this message
Giovanni Minniti (giminni) said :
#2

1) Karmic 9.10 use initrd.lz instead of initrd.gz
2) I need to change some casper init scripts in a live-cd context

Revision history for this message
Giovanni Minniti (giminni) said :
#3

I found a solution by myself!

1) Install p7zip-full via synaptic package manager
2) Create a subdirectory to preserve the init subdirectory tree
3) Decompress initrd.lz with "7z e -so ../initrd.lz | cpio -id"

To compress it again go to the init subdirectory and execute:
4) find | cpio -o -H newc > ../newinitrd
5) go up one directory
6) 7z a -m0=lzma:a=1 initrd-mod.lz newinitrd

Revision history for this message
Giovanni Minniti (giminni) said :
#4

See comment above

Revision history for this message
Colin Ian King (colin-king) said :
#5

To uncompress and

gunzip < initrd.gz | cpio -i

and then to recompress I'd use:

find . | cpio -o -H newc | gzip -9 > newinitrd.gz

Revision history for this message
Giovanni Minniti (giminni) said :
#6

Hi Colin,

thx for your reply. Indeed your statements are right for Jaunty not for Karmic.