Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: cnlohr on January 09, 2014, 08:39:35 PM

Title: [SOLVED] Can't remaster initrd on TC5.x?
Post by: cnlohr on January 09, 2014, 08:39:35 PM
I am using Tiny Core Linux for an application where everything should (if possible) fit in the initramfs.  It just isn't working, though.

*EDIT* None of the systems described here work: http://wiki.tinycorelinux.net/wiki:remastering (http://wiki.tinycorelinux.net/wiki:remastering)

It seems that whenever I overlay the .tcz's on top of the existing FS, those packages don't work right.  For instance, if I load everything except for firefox, and have firefox installed in the initramfs, then firefox can't find some random DLLs.

I'm doing the following:

Mount the hard drive TC is installed on.
Code: [Select]
mkdir -p mountpt
losetup /dev/loop1 128M -o 32256
mount /dev/loop1 mountpt

CPIO the data out of the initramfs.
Code: [Select]
cat ../mountpt/tce/boot/core.gz | gunzip | cpio -id -H newc --preserve-modification-time

Unsquashfs all of the tcz's:
Code: [Select]
files=`ls mountpt/tce/optional/*.tcz`
mkdir overlay
cd overlay
for file in $files; do
        echo $file
        unsquashfs -f ../$file
done

(Manually remove entries from the the bootup entries)

overlay all of the tcz's.
Code: [Select]
cp -a overlay/squashfs-root/* mountcore/

re-cpio the initramfs
Code: [Select]
cd mountcore
find . | cpio --create --format='newc' > ../image.dd.cpio
ls -l ../image.dd.cpio
echo "image made."
cat ../image.dd.cpio | gzip -6f > ../mountpt/tce/boot/core.gz

unmount everything:
Code: [Select]
sync
umount mountpt
rm -rf mountpt
losetup -d /dev/loop1

Any idea why everything would be broken... If I do this for all entries, I can't even start X!
Title: Re: Can't remaster initrd on TC5.x?
Post by: curaga on January 10, 2014, 05:33:48 AM
Quote
Any idea why everything would be broken... If I do this for all entries, I can't even start X!

Unpacking extensions like that is not supported, so it's not surprising they wouldn't work. Extensions have startup scripts, and the loader does some things, both of which aren't done when just extracting.

You should take a look at EZRemaster, or if you want to do things manually, store the tcz extensions as-is and then load them from bootsync, for example.
Title: Re: Can't remaster initrd on TC5.x?
Post by: cnlohr on January 10, 2014, 11:18:12 AM
Wow, you need a lot of RAM to do that, but luckly, it's 2014, so that's exactly what I have.

It looks like EZRemaster's "Extract TCZ to in to initrd" is exactly what I was looking for.  I'll try it out tonight.

Just curious, though... where are the startup/install/whatever scripts stored in the tcz's?

Thanks!!!

Charles
Title: Re: Can't remaster initrd on TC5.x?
Post by: zerophnx on January 10, 2014, 11:21:52 AM
From http://wiki.tinycorelinux.net/wiki:creating_extensions#adding_custom_startup_scripts

it's in:
/usr/local/tce.installed/<extension>


Edit: Added wiki link
Title: Re: Can't remaster initrd on TC5.x?
Post by: curaga on January 10, 2014, 02:23:41 PM
Quote
Wow, you need a lot of RAM to do that, but luckly, it's 2014, so that's exactly what I have.

Do you mean EZRemaster or having tcz extensions there? EZRemaster allows you to specify a temp dir on a HD, and using non-extracted TCZs actually takes less RAM than having them extracted.
Title: Re: Can't remaster initrd on TC5.x?
Post by: cnlohr on January 12, 2014, 03:02:29 PM
So, this remaster thing works.  I am aware it takes less RAM, but I can't have anything other than an initrd.  I.e. it would be difficult to mount an NFS filesystem or anything. 

Considering these TCZ's... is it possible to do something like that from RAM?  I.e. keep the TCZ's in the initrd?

Charles
Title: Re: Can't remaster initrd on TC5.x?
Post by: gerald_clark on January 12, 2014, 03:23:30 PM
You have to be booting off something.  Why can't you store your extensions on your boot media?
Title: Re: Can't remaster initrd on TC5.x?
Post by: tinypoodle on January 12, 2014, 06:33:24 PM
is it possible to do something like that from RAM?  I.e. keep the TCZ's in the initrd?

Do wiki search for "remaster".
Title: Re: Can't remaster initrd on TC5.x?
Post by: curaga on January 13, 2014, 06:13:45 AM
Considering these TCZ's... is it possible to do something like that from RAM?  I.e. keep the TCZ's in the initrd?

Several of the options do just that? The "inside initrd" ones.
Title: Re: Can't remaster initrd on TC5.x?
Post by: cnlohr on January 13, 2014, 11:12:52 PM
The inside initrd one is more and more attractive.  I initially thought it would use more ram, but now, it appears that is not the case. 

Re: Gerald... It's booting off of a PXE boot system, and setting up the additional stuff is kind of a pain.  Initrd + kernel = easy, though :)

Regardless, I think it's safe to say this topic is solved!  EZRemaster was the way!
Title: Re: Can't remaster initrd on TC5.x?
Post by: gerald_clark on January 13, 2014, 11:32:53 PM
I boot almost all my Core systems off PXE. Once PXE is setup, and NFS is setup, Setting up a new workstation is simply adding a new PXE config file for the MAC address, and creating an empty directory in NFS.
Boot the workstation and tce-load the desired applications.  It works just like you have a hard drive installed.