Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: flyingfishfinger on January 15, 2020, 04:39:36 PM

Title: TC in flash doesn't detect eth0, USB, modprobe?
Post by: flyingfishfinger on January 15, 2020, 04:39:36 PM
Hello,
I've just stuffed a copy of TC in my BIOS flash chip. I'm loading with Grub2 like so: "linux /vmlinuz iommu=pt waitusb=5" and "initrd /rootfs.gz".

This gets me to a Unix shell successfully, but I can't do much with it. A plugged-in USB does not show in dmesg, or on boot. I also don't see my eth0 interface, nor can I modprobe anything (error: "modprobe: can't change directory").

I assume I'm missing something fairly basic here but I can't think of anything. I'm not a particularly experienced low-level user, so please forgive if it's obvious.

Any advice to share?
Cheers,
R
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: Juanito on January 15, 2020, 08:14:27 PM
You need rootfs.gz + modules.gz or core.gz
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: flyingfishfinger on January 16, 2020, 09:28:16 AM
Yup, figured it was something like that. Thanks!

What's the practical difference between rootfs+ modules and core.gz?

R
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: curaga on January 16, 2020, 09:29:00 AM
Nothing at all.

"cat rootfs.gz modules.gz > core.gz"
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: flyingfishfinger on February 12, 2020, 09:52:25 PM
If I remaster rootfs.gz, what do I need to add to get the tce-* commands working (assuming I've got a network module added)? Is it enough to add the binaries to the correct /bin folder, or is something else needed?

R
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: curaga on February 13, 2020, 01:35:14 AM
There are no dependency charts for what's inside the initrd, you'll have to go by trial and error. However most binaries are in busybox, so likely you can't cut rootfs size much.
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: flyingfishfinger on February 13, 2020, 09:03:27 AM
Hi,
I'm not trying to cut rootfs any smaller. Rootfs+modules is too big, so instead of removing enough stuff from modules I was wondering how to add to rootfs instead (i.e build up instead of strip down). Rootfs alone doesn't even have the tce-tools, so at minimum I'd like to add those.

Unless I misunderstood you?

R
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: Rich on February 13, 2020, 09:40:50 AM
Hi flyingfishfinger
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/rootfs.gz
Found here:
http://forum.tinycorelinux.net/index.php/topic,22398.msg140327.html#msg140327
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: flyingfishfinger on February 13, 2020, 11:18:57 AM
Quote
Hi flyingfishfinger
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

Yup, I've been doing this for adding extensions for a while using the /builtin method.  But that applies to extensions, can I do it with built-in binaries as well? That was my question.

R
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: Rich on February 13, 2020, 11:37:19 AM
Hi flyingfishfinger
... But that applies to extensions, ...
Says who?

Quote
... can I do it with built-in binaries as well? That was my question.
Sure. It's the root file system. It has /bin, /usr/bin/, ....

To stay in context, the second command should have read:
Code: [Select]
sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/rootfs.gz
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: flyingfishfinger on February 13, 2020, 12:03:05 PM
Got it.

Right now I'm trying to run the depmod step shown on the "remastering" wiki page, but I'm getting errors because there is no "modules.order" and modules.builtin" file. I'm running this on Ubuntu, not TC...

There's also no "modules.alias" and "modules.dep" as in core.gz.

Since rootfs has no modules at all to begin with; how can I resolve the above error?

I've never tried adding modules before.

Thanks,
R
Title: Re: TC in flash doesn't detect eth0, USB, modprobe?
Post by: flyingfishfinger on February 14, 2020, 11:32:00 AM
Never mind, works fine when run on TC.

R