Tiny Core Base > TCB Q&A Forum

[Resolved] Autostart wireless connection on EeePC 901

<< < (2/5) > >>

paulfxh:
Unfortunately, putting in the "sleep 5" line in the bootlocal.sh script didn't get me any further.
Indeed, I tried sleep 10, sleep 60 and sleep 300 but none of them worked. What was noticeable, however, was that there was no indication at all that the boot was being prolongued by the time included in the "sleep" line.
In fact, for "sleep 300", the script didn't seem to run at all as typing  "iwconfig" after boot did not show the ra0 interface.
Other things I tried were:
1. Load both wireless_tools and wpa-supplicant as part of the bootlocal.sh script using the commands shown in Juanito's post to make sure that wireless_tools were indeed loaded before needing to use iwconfig in the script
2. Include my script as part of ra0.sh which itself is part of the bootlocal.sh script.
However, neither of these caused any improvement.
This is very puzzling as I've already used very similar scripts to autostart wireless connections in some other OSes on this EeePC 901.
Perhaps somebody else can see what might be wrong here?
 

^thehatsrule^:
That's because bootlocal.sh is backgrounded.  If you put "sleep 300" in it, you would have to wait 5 min after boot for the rest of the script to be executed.

Also, note that tce-load will not run as root.

What's in the /opt/ra0.sh and ra00.sh?

paulfxh:
/opt /ra0.sh now looks like this

--- Code: ---#!/bin/sh
pkill udhcpc
ifconfig ra0 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255 up
route add default gw 192.168.1.254
echo nameserver 208.67.222.222 > /etc/resolv.conf
echo nameserver 208.67.220.220 >> /etc/resolv.conf
#cd /home/tc
#cp rt2860sta.ko.gz /lib/modules/2.6.26-tinycore/kernel/drivers/net/
#depmod -a
#modprobe rt2860sta
#ifconfig ra0 up
#iwconfig ra0 key open
#iwconfig ra0 key xxxxxxxxxxxxxxxxxxxxxxxxxx
#iwconfig ra0 essid "xxxxxxxxxxxxxxx"
--- End code ---
The commented-out stuff is what I had added in one of my "experiments".
Here below is /opt/ra00.sh

--- Code: ---#!/bin/sh
pkill udhcpc
ifconfig ra00 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255 up
route add default gw 192.168.1.254
echo nameserver 208.67.222.222 > /etc/resolv.conf
echo nameserver 208.67.220.220 >> /etc/resolv.conf
--- End code ---

Juanito:

--- Quote from: paulfxh on January 22, 2009, 03:24:08 PM ---1. Load both wireless_tools and wpa-supplicant as part of the bootlocal.sh script using the commands shown in Juanito's post to make sure that wireless_tools were indeed loaded before needing to use iwconfig in the script

--- End quote ---
In case it wasn't clear, I don't call the script via bootlocal.sh and I run the script as user tc - since I'm using tc in development/testing mode 95% of the time, I don't have a backup.

If you did want to load an extension via bootlocal.sh, I guess you could use "su tc tce-load /path/extension"

paulfxh:
@Juanito
Thanks for those comments.

--- Quote ---I don't call the script via bootlocal.sh and I run the script as user tc
--- End quote ---
Do you, therefore, run the script during the boot but not as root?
If so, how do you do that?
I'm fairly convinced now that my problem is that I can't get wireless_tools loaded before my script runs with the result that the three "iwconfig" commands don't function.
As bootlocal.sh runs as root, and "tce-load" cannot be run as root, I've got a problem.
I did, of course, try your suggestion

--- Quote ---If you did want to load an extension via bootlocal.sh, I guess you could use "su tc tce-load /path/extension"
--- End quote ---
but this didn't work for me.
Indeed, If I run the script (after boot) in a root terminal, the two "tce-load" lines give me this error:

--- Quote ---sh: can't open tce-load
--- End quote ---
So, in summary I believe what I need are either a) a means to allow the wireless_tools and wpa-supplement tce's to be loaded from bootlocal.sh or b) some way to get a script to be run during, or immediately after (but automatically), the boot other than through bootlocal.sh

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version