Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started 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
-
You need rootfs.gz + modules.gz or core.gz
-
Yup, figured it was something like that. Thanks!
What's the practical difference between rootfs+ modules and core.gz?
R
-
Nothing at all.
"cat rootfs.gz modules.gz > core.gz"
-
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
-
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.
-
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
-
Hi flyingfishfinger
To unpack:
mkdir tempdir
cd tempdir
zcat /path/to/existing/rootfs.gz | sudo cpio -i
To repack:
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
-
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
-
Hi flyingfishfinger
... But that applies to extensions, ...
Says who?
... 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:
sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/rootfs.gz
-
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
-
Never mind, works fine when run on TC.
R