WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TC in flash doesn't detect eth0, USB, modprobe?  (Read 727 times)

Offline flyingfishfinger

  • Jr. Member
  • **
  • Posts: 74
TC in flash doesn't detect eth0, USB, modprobe?
« 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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12251
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #1 on: January 15, 2020, 08:14:27 PM »
You need rootfs.gz + modules.gz or core.gz

Offline flyingfishfinger

  • Jr. Member
  • **
  • Posts: 74
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #2 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

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10240
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #3 on: January 16, 2020, 09:29:00 AM »
Nothing at all.

"cat rootfs.gz modules.gz > core.gz"
The only barriers that can stop you are the ones you create yourself.

Offline flyingfishfinger

  • Jr. Member
  • **
  • Posts: 74
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #4 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

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10240
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #5 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.
The only barriers that can stop you are the ones you create yourself.

Offline flyingfishfinger

  • Jr. Member
  • **
  • Posts: 74
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #6 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

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 7934
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #7 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/initrd.gz
Found here:
http://forum.tinycorelinux.net/index.php/topic,22398.msg140327.html#msg140327

Offline flyingfishfinger

  • Jr. Member
  • **
  • Posts: 74
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #8 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

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 7934
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #9 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

Offline flyingfishfinger

  • Jr. Member
  • **
  • Posts: 74
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #10 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
« Last Edit: February 13, 2020, 12:15:25 PM by flyingfishfinger »

Offline flyingfishfinger

  • Jr. Member
  • **
  • Posts: 74
Re: TC in flash doesn't detect eth0, USB, modprobe?
« Reply #11 on: February 14, 2020, 11:32:00 AM »
Never mind, works fine when run on TC.

R