How to extract the content of the Knoppix 5.3.0 minirt.gz ?

View: New views
7 Messages — Rating Filter:   Alert me  

How to extract the content of the Knoppix 5.3.0 minirt.gz ?

by Gilles van Ruymbeke-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Klaus,
I am very pleased to read that you will release very soon a new
public Knoppix 5.3 release.
Thank You so much !
In order to customize your minirt and some features like: iso boot
from ntfs, customized hostname,...
I found out this problem: how do you extract the content of the
Knoppix 5.3.0 minirt.gz ?
Usually "gunzip initrd.gz" and "cpio -imvd -I ../initrd" does the job
but not this time:
Each files of the minirt cpio archive file contains a leading "/"
which makes the data of the minirt cpio archive to be stored in the "root"
instead of the current directory, overriding the system files of the
running system if logged as a super user.
I cannot find any cpio option to override the leading "/". Could you
please help ?
Thank you and Best Regards,
Gilles


--
To UNSUBSCRIBE, email to debian-knoppix-request@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: How to extract the content of the Knoppix 5.3.0 minirt.gz ?

by John Woods :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Gilles,

Well I gave it a try... but this is beyond me apparently.

gunzip minirt.gz
mkdir init_tmp
cd init_tmp
cpio -imvd --no-absolute-filenames -I ../minirt

 make changes... to these files... then

find . | cpio --quiet -o -H newc | gzip -9 > ../minirt.gz

but my minirt.gz is smaller

-rw-r--r-- 1 root root 1465564 Mar 14 00:11 minirt.gz
-r--r--r-- 1 knoppix knoppix 1471612 Feb 16 16:19 minirt.orig.gz

Also The first cpio command had some curious error messages... where
it looked like it was trying to remove the leading slashes... but at
times it looked like it was trying to overwrite device names from the
root of the filesystem. I am puzzled, and glad I can't break this
Knoppix. The only thing I can break is my knoppix.img  which I
probably would have had I done that as root.

Lot of these types of errors...
cpio: Removing leading `/' from member names
cpio: dev/ttyp6: Operation not permitted
dev/ttyp6

and more of these.

cpio: Removing leading `/' from member names
etc/mtab
cpio: Removing leading `/' from member names
cpio: cannot remove current lib/terminfo/l/linux: Read-only file system
lib/terminfo/l/linux
cpio: Removing leading `/' from member names
static/ntfs-3g

It produced enough errors to consume the whole Konsole buffer and some.
Klaus?

On 3/8/08, Gilles van Ruymbeke
<gvr_knoppix_mailing_list_no_spam_123@...> wrote:

> Hello Klaus,
> I am very pleased to read that you will release very soon a new
> public Knoppix 5.3 release.
> Thank You so much !
> In order to customize your minirt and some features like: iso boot
> from ntfs, customized hostname,...
> I found out this problem: how do you extract the content of the
> Knoppix 5.3.0 minirt.gz ?
> Usually "gunzip initrd.gz" and "cpio -imvd -I ../initrd" does the job
> but not this time:
> Each files of the minirt cpio archive file contains a leading "/"
> which makes the data of the minirt cpio archive to be stored in the "root"
> instead of the current directory, overriding the system files of the
> running system if logged as a super user.
> I cannot find any cpio option to override the leading "/". Could you
> please help ?
> Thank you and Best Regards,
> Gilles
>
>
> --
> To UNSUBSCRIBE, email to debian-knoppix-request@...
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@...
>
>


--
To UNSUBSCRIBE, email to debian-knoppix-request@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Parent Message unknown Re: How to extract the content of the Knoppix 5.3.0 minirt.gz ?

by John Woods :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well I gave it a try... and then another.
Then I backed up my knoppix.img.
Then I did the commands that previously gave me all kinds of errors... as root.
Which produced only the expected output about removing leading slash...

gunzip minirt.gz
mkdir init_tmp
cd init_tmp

cpio -imvd --no-absolute-filenames -I ../minirt
yada yada yada... well all I did here was touch ./linuxrc
find . | cpio --quiet -o -H newc | gzip -9 > ../minirt.gz

and the new minirt.gz is about the same size as the original.
It booted up ok.

What's with the error about a missing selinuxfs on these minirts?
.


--
To UNSUBSCRIBE, email to debian-knoppix-request@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: How to extract the content of the Knoppix 5.3.0 minirt.gz ?

by John Woods :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well after wondering what the missing 2k bytes or so were... it would
seem that because ~lib is restored as a link... whatever is below
can't be restored in the relative tree maybe.
Same with files under ~sbin.

lib/terminfo/l/linux
and sbin/mount.ntfs  as well as sbin/mount.ntfs-3g are missing after
the restore to the working directory.

There's the 2k.
So that doesn't reall work to well.

-rwxr-xr-x   1 root     root         1695 Feb  2 18:25 /lib/terminfo/l/linux
-rwxr-xr-x   1 root     root       652380 Feb 11 17:34 /static/ntfs-3g
-rwxr-xr-x   1 root     root          209 Jul 31  2002 /etc/auto.mnt
lrwxr-xr-x   1 root     root           18 Feb 16 15:51
/sbin/mount.ntfs -> ../static/ntfs-3g
lrwxr-xr-x   1 root     root           18 Feb 16 15:51
/sbin/mount.ntfs-3g -> ../static/ntfs-3g


On 3/15/08, John Woods <gtbutton@...> wrote:

> Well I gave it a try... and then another.
> Then I backed up my knoppix.img.
> Then I did the commands that previously gave me all kinds of errors... as
> root.
> Which produced only the expected output about removing leading slash...
>
> gunzip minirt.gz
> mkdir init_tmp
> cd init_tmp
>
> cpio -imvd --no-absolute-filenames -I ../minirt
> yada yada yada... well all I did here was touch ./linuxrc
> find . | cpio --quiet -o -H newc | gzip -9 > ../minirt.gz
>
> and the new minirt.gz is about the same size as the original.
> It booted up ok.
>
> What's with the error about a missing selinuxfs on these minirts?
> .
>


--
To UNSUBSCRIBE, email to debian-knoppix-request@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: How to extract the content of the Knoppix 5.3.0 minirt.gz ?

by John Woods :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 3/15/08, John Woods <gtbutton@...> wrote:

> Well after wondering what the missing 2k bytes or so were... it would
> seem that because ~lib is restored as a link... whatever is below
> can't be restored in the relative tree maybe.
> Same with files under ~sbin.
>
> lib/terminfo/l/linux
> and sbin/mount.ntfs as well as sbin/mount.ntfs-3g are missing after
> the restore to the working directory.
>
> There's the 2k.
> So that doesn't reall work to well.
>
> -rwxr-xr-x 1 root root 1695 Feb 2 18:25 /lib/terminfo/l/linux
> -rwxr-xr-x 1 root root 652380 Feb 11 17:34 /static/ntfs-3g
> -rwxr-xr-x 1 root root 209 Jul 31 2002 /etc/auto.mnt
> lrwxr-xr-x 1 root root 18 Feb 16 15:51
> /sbin/mount.ntfs -> ../static/ntfs-3g
> lrwxr-xr-x 1 root root 18 Feb 16 15:51
> /sbin/mount.ntfs-3g -> ../static/ntfs-3g
>
>
> On 3/15/08, John Woods <gtbutton@...> wrote:
> > Well I gave it a try... and then another.
> > Then I backed up my knoppix.img.
> > Then I did the commands that previously gave me all kinds of errors... as
> > root.
> > Which produced only the expected output about removing leading slash...
> >
> > gunzip minirt.gz
> > mkdir init_tmp
> > cd init_tmp
> >
> > cpio -imvd --no-absolute-filenames -I ../minirt
> > yada yada yada... well all I did here was touch ./linuxrc
> > find . | cpio --quiet -o -H newc | gzip -9 > ../minirt.gz
> >
> > and the new minirt.gz is about the same size as the original.
> > It booted up ok.
> >
> > What's with the error about a missing selinuxfs on these minirts?
> > .
> >
>

Just for completeness sake...
The answer to this riddle is... you must have a chroot setup to extract it to.
I made a quick and dirty chroot to see and left my steps to make one here.
http://www.knoppix.net/forum/viewtopic.php?t=28645

john


--
To UNSUBSCRIBE, email to debian-knoppix-request@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: How to extract the content of the Knoppix 5.3.0 minirt.gz ?

by Klaus Knopper-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello John,

On Fri, Mar 14, 2008 at 01:29:40AM -0400, John Woods wrote:
> Hi Gilles,
>
> Well I gave it a try... but this is beyond me apparently.
>
> gunzip minirt.gz
> mkdir init_tmp
> cd init_tmp
> cpio -imvd --no-absolute-filenames -I ../minirt

A shortcut would be:
mkdir -p init_tmp && init_tmp
zcat ../minirt.gz | sudo cpio -idmv --no-absolute-filenames

>  make changes... to these files... then
>
> find . | cpio --quiet -o -H newc | gzip -9 > ../minirt.gz

Looks OK.

> but my minirt.gz is smaller
>
> -rw-r--r-- 1 root root 1465564 Mar 14 00:11 minirt.gz
> -r--r--r-- 1 knoppix knoppix 1471612 Feb 16 16:19 minirt.orig.gz
>
> Also The first cpio command had some curious error messages... where
> it looked like it was trying to remove the leading slashes... but at
> times it looked like it was trying to overwrite device names from the
> root of the filesystem. I am puzzled, and glad I can't break this
> Knoppix. The only thing I can break is my knoppix.img  which I
> probably would have had I done that as root.
>
> Lot of these types of errors...
> cpio: Removing leading `/' from member names

That's not an error, though.

> cpio: dev/ttyp6: Operation not permitted
> dev/ttyp6

It means "you cannot create a device file if you are not root".

> and more of these.
>
> cpio: Removing leading `/' from member names
> etc/mtab
> cpio: Removing leading `/' from member names
> cpio: cannot remove current lib/terminfo/l/linux: Read-only file system
> lib/terminfo/l/linux

This looks like you extracted from within the wrong directory, indeed.
The filename is relative (otherwise it would start with a /), but maybe
there are existing symlinks to the rot filesystem inside the current
directory? Please recheck if this error really occurs when you are in a
subdirectory.

> cpio: Removing leading `/' from member names
> static/ntfs-3g
>
> It produced enough errors to consume the whole Konsole buffer and some.
> Klaus?

I have done this extract and recompress, and it worked fine, without
overwriting files The only prblem is that you cannot create device files
if not being root, and also, file owners are wrong.

I may reconsider the abslute filenames in initramfs for the next release,
it really does not seem to be necessary. But they should do no harm when
using option --no-absolute-filenames either.

Regards
-Klaus Knopper


--
To UNSUBSCRIBE, email to debian-knoppix-request@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: How to extract the content of the Knoppix 5.3.0 minirt.gz ?

by John Woods :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for taking the time to address this one...
Ok... I will try that out.

from a console... as root.

mkdir -p init_tmp && init_tmp ->gives bash: init_tmp: command not found
(I guess this would be where I change directory into init_temp so I do that)

then the zcat portion yields...

etc/mtab
cpio: Removing leading `/' from member names
cpio: cannot remove current lib/terminfo/l/linux: Read-only file system
lib/terminfo/l/linux

cpio: cannot make directory `sbin': No such file or directory
cpio: sbin/mount.ntfs: No such file or directory
sbin/mount.ntfs
cpio: Removing leading `/' from member names
cpio: cannot make directory `sbin': No such file or directory

cpio: etc/mtab not created: newer or same age version exists
etc/mtab


Did I mention I am doing this from a Knoppix 5.1.1 and a persistent home?
~lib points to /KNOPPIX/lib which on a running Knoppix is valid, but
is a absolute path that bypasses /UNIONFS/ and is readonly. If you are
on a real system you might not get that error. But I am in init_temp
when I do the command.

root@Knoppix:/KNOPPIX.IMG/home/knoppix/Desktop/init_tmp# ls -al
total 96
drwxr-xr-x 14 root    root     4096 Apr 11 14:26 .
drwxr-xr-x 20 knoppix knoppix  4096 Apr 11 14:15 ..
drwxr-xr-x  2 root    root     4096 Mar 26 05:20 KNOPPIX
lrwxrwxrwx  1 root    root        7 Apr 11 14:17 bin -> /static
lrwxrwxrwx  1 root    root       13 Apr 11 14:17 boot -> /KNOPPIX/boot
drwxr-xr-x  2 root    root     4096 Mar 26 05:20 cdrom
drwxr-xr-x  5 root    root     8192 Apr 11 14:17 dev
drwxr-xr-x  2 root    root     4096 Apr 11 14:17 etc
lrwxrwxrwx  1 root    root        8 Apr 11 14:17 init -> /linuxrc
lrwxrwxrwx  1 root    root       12 Apr 11 14:17 lib -> /KNOPPIX/lib
-rwxr-xr-x  1 root    root    34086 Mar 26 05:20 linuxrc
drwxr-xr-x  5 root    root     4096 Apr 11 14:17 media
drwxr-xr-x  2 root    root     4096 Mar 26 05:20 mnt
drwxr-xr-x  3 root    root     4096 Apr 11 14:17 modules
lrwxrwxrwx  1 root    root       12 Apr 11 14:17 opt -> /KNOPPIX/opt
drwxr-xr-x  2 root    root     4096 Mar 26 05:20 proc
lrwxrwxrwx  1 root    root        7 Apr 11 14:17 sbin -> /static
drwxr-xr-x  2 root    root     4096 Mar 26 05:20 selinux
drwxr-xr-x  2 root    root     4096 Apr 11 14:17 static
drwxr-xr-x  2 root    root     4096 Mar 26 05:20 sys
drwxrwxrwt  2 root    root     4096 Mar 26 05:20 tmp
lrwxrwxrwx  1 root    root       12 Apr 11 14:17 usr -> /KNOPPIX/usr
root@Knoppix:/KNOPPIX.IMG/home/knoppix/Desktop/init_tmp#

Even if you remove forward slashes... links that point to absolute
locations still need a chroot... wouldn't they?
The chroot environment worked out ok for this...
(Why I posted a howto on the forum, because I will forget how I did it!)

Regards,
John


--
To UNSUBSCRIBE, email to debian-knoppix-request@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...

LightInTheBox - Buy quality products at wholesale price!