Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: jvalencia on July 30, 2016, 06:15:51 AM

Title: bootlocal.sh is executed before extensions are loaded?
Post by: jvalencia on July 30, 2016, 06:15:51 AM
I'm using copy2fs.flg so that means that at boot, extensions are copied to fs.

I supposed that copying happened before executing bootlocal.sh but I've found that my wlan module isn't loaded at the moment.

I know I can insert a sleep in the script, but it's ugly.

How would you implement a hook so the script is only run after the module is loaded?

How can I know if all extensions have already been copied in case I need one for my script?

Thanks
Title: Re: bootlocal.sh is executed before extensions are loaded?
Post by: Misalf on July 30, 2016, 06:42:31 AM
bootlocal.sh  is executed  after  extensions are loaded or copied to RAM.

Why is sleep ugly?
bootlocal.sh runs in background so you shouldn't notice any delay.

However, you can also do
Code: [Select]
{ sleep 2 ; /your/script ; } &
or
Code: [Select]
for i in `seq 10 -1 0` ; do
if [ -e /sys/class/net/wlan0 ] ; then
/your/script &
break
fi
sleep 1
done

Title: Re: bootlocal.sh is executed before extensions are loaded?
Post by: jvalencia on July 30, 2016, 06:47:26 AM
bootlocal.sh  is executed  after  extensions are loaded or copied to RAM.

Why is sleep ugly?
bootlocal.sh runs in background so you shouldn't notice any delay.

However, you can also do
Code: [Select]
{ sleep 2 ; /your/script ; } &
or
Code: [Select]
for i in `seq 10 -1 0` ; do
if [ -e /sys/class/net/wlan0 ] ; then
/your/script &
break
fi
sleep 1
done


Yes, it's the module that is not autoloaded in time. I suppose I can manually load it from the script or just wait for
the interface to appear, like your script.