Tiny Core Extensions > TCE Q&A Forum

how do firmware extensions work without startup script?

<< < (2/10) > >>

Rich:
Hi GNUser
Check tc-config for:

--- Code: ---/usr/bin/tce-setup "booting"
--- End code ---
tce-setup fires off udev if it detects /etc/sysconfig/newmodules.

GNUser:
Nice find, Rich. I almost have the complete picture now. Do you know what creates /etc/sysconfig/newmodules?

GNUser:

--- Quote from: GNUser on August 27, 2024, 10:32:42 AM ---Do you know what creates /etc/sysconfig/newmodules?

--- End quote ---
I found it: It's /usr/bin/tce-load:


--- Code: ---...
[ -n "`find /mnt/test/ -type d -name modules`" ] && MODULES=TRUE
...

update_system() {
if [ "$BOOTING" ]; then
[ "$MODULES" ] && sudo /bin/touch /etc/sysconfig/newmodules
--- End code ---
So if tce-load loads an extension that contains modules, it creates the newmodules flag. The new modules flag causes tce-setup to fire off udev after all extensions have been loaded. Mystery solved. Thank you both very much.

Rich:
Hi GNUser

--- Quote from: GNUser on August 27, 2024, 10:32:42 AM ---Nice find, Rich. I almost have the complete picture now. ...
--- End quote ---
Yeah, there's a lot going on there. It can be tricky trying to follow it all.

GNUser:
Hi Rich. I did some simple experiments and it seems I'm missing a small piece of the puzzle.

I connected a wifi usb adapter that uses the Atheros AR9271 chipset.

First experiment (firmware extension loaded during boot):
    I add firmware-atheros.tcz to my onboot.lst. Then I reboot. When machine is done booting, I do ifconfig -a I can see wlan1 listed, so the usb adapter is working.

Second experiment (firmware extension loaded manually after boot):
    I remove firmware-atheros.tcz from onboot.lst. Then I reboot. After boot is complete, I open a terminal and run these commands:

--- Code: ---$ dmesg | grep firmware # the failed firmware load here is not a surprise
[    0.071368] Spectre V2 : Enabling Restricted Speculation for firmware calls
[    2.880738] psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 3/3
[   13.148438] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   13.233707] usb 2-1.2: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[   13.285943] usb 2-1.2: Direct firmware load for htc_9271.fw failed with error -2
[   13.295216] usb 2-1.2: no suitable firmware found!
[   13.295221] usb 2-1.2: ath9k_htc: Failed to get firmware htc_9271.fw
$ tce-load -i firmware-atheros
$ sudo depmod -a
$ sudo udevadm trigger
$ dmesg | grep firmware # why no new attempt at loading firmware?
[    0.071368] Spectre V2 : Enabling Restricted Speculation for firmware calls
[    2.880738] psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 3/3
[   13.148438] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   13.233707] usb 2-1.2: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[   13.285943] usb 2-1.2: Direct firmware load for htc_9271.fw failed with error -2
[   13.295216] usb 2-1.2: no suitable firmware found!
[   13.295221] usb 2-1.2: ath9k_htc: Failed to get firmware htc_9271.fw

--- End code ---
Then I run ifconfig -a there is no wlan1 in the output (obviously, since firmware has not been loaded onto the device). I must manually unplug the adapter and plug it back in for it to work.

Any idea what's the secret sauce in the boot process that re-detects usb devices after driver and firmware extensions have been loaded? (It's not udevadm trigger.)  I've looked in /etc/init.d/ as well as in /usr/bin/tce-setup and have not found an obvious answer.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version