Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: uekawi on May 11, 2020, 12:49:54 PM

Title: extract and recompress core.gz
Post by: uekawi on May 11, 2020, 12:49:54 PM
Hi guys,

since the wiki on this site is down, can you please tell me, how do i extract and recompress "core.gz"?

When i extract those files, edit stuff, and try to recompress it with: "find | cpio -o -H newc | gzip -2 > core.gz"

i get this message: "cpio: File ./core.gz grew, 524288 new bytes not copied 48622 blocks"

And when i look inside the core.gz archive that was just created, the file inside is of type "unknown" instead of "CPIO archive".

The OS is Ubuntu 20.04 64bit

Thanks
Title: Re: extract and recompress core.gz
Post by: Rich on May 11, 2020, 01:05:24 PM
Hi uekawi
Welcome to the forum.
... since the wiki on this site is down, can you please tell me, how do i extract and recompress "core.gz"? ...

Try this:
To unpack:
Code: [Select]
mkdir tempdir
cd tempdir
zcat /path/to/existing/rootfs.gz | sudo cpio -i

To repack:
Code: [Select]
sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/initrd.gz
Found here:
http://forum.tinycorelinux.net/index.php/topic,22398.msg140327.html#msg140327

An alternative link to the Wiki is:
http://wiki.tinycorelinux.net/doku.php?id=wiki:start
Title: Re: extract and recompress core.gz
Post by: curaga on May 11, 2020, 01:11:02 PM
Your error sounds like you tried to put the new core.gz inside itself.
Title: Re: extract and recompress core.gz
Post by: uekawi on May 11, 2020, 01:26:12 PM
Hi uekawi
Welcome to the forum.
... since the wiki on this site is down, can you please tell me, how do i extract and recompress "core.gz"? ...

Try this:
To unpack:
Code: [Select]
mkdir tempdir
cd tempdir
zcat /path/to/existing/rootfs.gz | sudo cpio -i

To repack:
Code: [Select]
sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/initrd.gz
Found here:
http://forum.tinycorelinux.net/index.php/topic,22398.msg140327.html#msg140327

An alternative link to the Wiki is:
http://wiki.tinycorelinux.net/doku.php?id=wiki:start

thanks @rich and @curuga for your quick reply :D

i did exactly what @rich said and ended up with this command: "find . | cpio -o -H newc | gzip > /tmp/test/core.gz" and i was in the dir "/tmp/tempdir" logged in as root (did sudo su at the beginning).

Now i don't get the error message anymore, thank you for that, but the file inside the newly created core.gz file is now of type "program crash data".

(https://i.imgur.com/vynFmO5.jpg)

thank you in advance for your help :)

EDIT: typo
Title: Re: extract and recompress core.gz
Post by: Rich on May 11, 2020, 01:34:51 PM
Hi uekawi
... Now i don't get the error message anymore, thank you for that, but the file inside the newly created core.gz file is now of type "program crash data". ...
No, it's not. You're file manager is probably just looking at the file name and assuming it's a compressed core dump file.
Title: Re: extract and recompress core.gz
Post by: uekawi on May 13, 2020, 03:25:49 AM
Thank you so much guys!

i just managed to get it to work.

It indeed was not broken, but i opened the original and the new core.gz in the same file manager and it displayed in two different ways, so i was a little confused.

But as @Rich pointed out, it didn't matter. I repacked it to the iso and everything except the touch screen went fine!