Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: mortegai on July 29, 2025, 07:17:57 AM
-
tce-load has a routine (update_system, which includes depmod -a and udevadm trigger) designed for extensions that contain kernel modules, and it's executed if the extension contains a directory named modules.
However, there are some other extensions that contain a directory named modules, such as:
xorg-server
libfm
glib2
gtk2
xf86-input-lubinput
p11-kit (needed for gnutls)
at-spi2-core
that when loaded also run update_system unnecessarily, significantly lengthening their loading time.
Could the need to run update_system when loading an extension be refined in some way?
For example, by checking if it also contains *.ko kernel modules
-
Hi mortegai
I'm looking into it.
-
Hi mortegai
What do you think of this:
Replace this:
[ -n "`find /mnt/test/ -type d -name modules`" ] && MODULES=TRUE
With this:
MODULES_DIR=$(find /mnt/test/ -type d -name modules)
[ -n "$MODULES_DIR" ] && [ "$(find $MODULES_DIR -type f -name '*.ko*')" ] && MODULES=TRUE
And replace this:
[ -n "`find /tmp/tcloop/$APPNAME -type d -name modules`" ] && MODULES=TRUE
With this:
MODULES_DIR=$(find /tmp/tcloop/$APPNAME -type d -name modules)
[ -n "$MODULES_DIR" ] && [ "$(find $MODULES_DIR -type f -name '*.ko*')" ] && MODULES=TRUE
In both cases, the first line searches for a modules directory. If found, the second line
searches that directory for any *.ko* files. If found, MODULES gets set to TRUE.
This will detect .ko, .ko.gz, .ko.xz, etc.
Comments from you or anyone else reading this thread are welcome and encouraged.
-
Why not just (untested):
[ -d /mnt/test/usr/local/lib/modules/$KERNELVER ] && MODULES=TRUE
Then you avoid needing to run 'find'.
Assuming no extensions wrongly install to /lib/modules/, in which case:
[ -d /mnt/test/usr/local/lib/modules/$KERNELVER -o -d /mnt/test/lib/modules/$KERNELVER ] && MODULES=TRUE
-
Hi CNK
Thank you. That solves the problem the find command created. Some extensions
contain:
/usr/local/lib/ExtensionName/modules
populated with .so files. The find command returned those module directories.
This should work better:
Replace this:
[ -n "`find /mnt/test/ -type d -name modules`" ] && MODULES=TRUE
With this:
[ -d /mnt/test/usr/local/lib/modules ] && MODULES=TRUE
And replace this:
[ -n "`find /tmp/tcloop/$APPNAME -type d -name modules`" ] && MODULES=TRUE
With this:
[ -d /tmp/tcloop/$APPNAME/usr/local/lib/modules ] && MODULES=TRUE
I searched provides.db and found:
There are no extensions containing /lib/modules.
There are no /usr/local/lib/modules directories containing .so files.
-
Either option works.
I think CNK's proposal, including the use of $KERNELVER, is more specific for identifying extensions that contain modules of the currently running kernel.
Therefore, it seems more appropriate to me.
Thank you very much for your attention to this topic.
-
Hi mortegai
I modified a current copy of tce-load like this:
Replaced this:
[ -n "`find /mnt/test/ -type d -name modules`" ] && MODULES=TRUE
With this:
[ -d /mnt/test/usr/local/lib/modules/$KERNELVER ] && MODULES=TRUE
Replaced this:
[ -n "`find /tmp/tcloop/$APPNAME -type d -name modules`" ] && MODULES=TRUE
With this:
[ -d /tmp/tcloop/$APPNAME/usr/local/lib/modules/$KERNELVER ] && MODULES=TRUE
I created an initrd with the modified tce-load for you to test.
Download the tceload.gz file to your boot directory from here:
http://tinycorelinux.net/16.x/
Modify your boot loader config file like this:
initrd /boot/core.gz,/boot/tceload.gz
or this:
initrd /boot/core.gz /boot/tceload.gz
The first version should work with syslinux,extlinux, and grub-legacy.
The second version works with grub 2.
Please confirm that it speeds up your load times.
-
Hi Rich.
I'm using piCore16. I've modified config.txt to include your tceload.gz in initramfs.
I've tested loading some extensions, for example gnutls.tcz, and the loading time has been significantly reduced.
Therefore, I think the modification can be considered correct and permanently consolidated.
Thank you very much.
-
Hi mortegai
Thank you for the feedback.
I'll allow a little more time in case anyone else has
comments and push the change into git late tonight.
-
Hi mortegai
The change has been merged into git.