Tiny Core Base > Micro Core
Help with trimming modules.gz to minimum size?
(1/1)
flyingfishfinger:
Hi,
I'm looking for a bit of assistance with trimming modules.gz. I've read the remastering guide and I should just be able to remove stuff I don't need and repack it, correct?
To that end, the "drivers/net" folder is the largest and under "ethernet" alone I find 3.5MB of stuff. I've got a Realtek chipset, so would I be correct in saying I can delete every folder in that directory except the Realtek one, to start with?
Is there a good method to take this further, like looking at what things DO get loaded when I boot Core on my machine and then delete everything that doesn't?
Cheers,
R
Rich:
Hi flyingfishfinger
--- Quote from: flyingfishfinger on January 16, 2020, 06:06:59 PM ---Hi,
I'm looking for a bit of assistance with trimming modules.gz. I've read the remastering guide and I should just be able to remove stuff I don't need and repack it, correct? ...
--- End quote ---
Yes.
--- Quote ---To that end, the "drivers/net" folder is the largest and under "ethernet" alone I find 3.5MB of stuff. I've got a Realtek chipset, so would I be correct in saying I can delete every folder in that directory except the Realtek one, to start with?
--- End quote ---
Modules can have dependencies, and they might be in other folders.
--- Quote ---Is there a good method to take this further, like looking at what things DO get loaded when I boot Core on my machine and then delete everything that doesn't?
--- End quote ---
I suppose you could use the output of:
--- Code: ---lsmod
--- End code ---
to decide which modules to keep. First make sure you've run all your installed programs in case any of them rely on any of the
modules included in the base. Here's a brief summary on unpacking/repacking the modules.gz file:
--- Code: ---# Unpack modules.gz which is in the current directory
tc@E310:~$ mkdir -p tmp/extract
tc@E310:~$ cd tmp/extract/
tc@E310:~/tmp/extract$ zcat ../../modules64.gz | cpio -i -H newc -d
43955 blocks
# Make your changes, then repack modules.gz
tc@E310:~/tmp/extract$ depmod -a -b . 4.19.10-tinycore64
depmod: ./kernel.tclocal: No such file or directory
tc@E310:~/tmp/extract$ find lib usr | cpio -o -H newc | gzip -9 > ../modules64.gz
# The new modules.gz is in tc@E310:~/tmp/
--- End code ---
Replace 4.19.10-tinycore64 with the version you are running.
Navigation
[0] Message Index
Go to full version