WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: bootlocal.sh is executed before extensions are loaded?  (Read 1689 times)

Offline jvalencia

  • Newbie
  • *
  • Posts: 7
bootlocal.sh is executed before extensions are loaded?
« on: July 30, 2016, 09: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

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: bootlocal.sh is executed before extensions are loaded?
« Reply #1 on: July 30, 2016, 09: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

Download a copy and keep it handy: Core book ;)

Offline jvalencia

  • Newbie
  • *
  • Posts: 7
Re: bootlocal.sh is executed before extensions are loaded?
« Reply #2 on: July 30, 2016, 09: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.