Tiny Core Base > TCB Q&A Forum
[Resolved] Autostart wireless connection on EeePC 901
paulfxh:
Just got TC frugal working very well on my EeePC 901.
However, still one or two small problems.
In particular, although I'm using the "tce=hdXY" and "restore=hdXY" boot codes, I still have to go through a bit of a rigmarole to get my wireless connection after boot.
This involves two steps:
1. Using AppBrowser to load both wireless_tools.tcel and wpa-supplicant.tce which remain saved to /home/tc (as does the wireless driver)
2. Run this script to launch the wireless connection
--- Code: ---#!/bin/sh
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"
ifconfig ra0 192.168.1.5 netmask 255.255.255.0
route add default gw 192.168.1.254
--- End code ---
To streamline this procedure, I would like to add the extension loading to the script but I can't figure out how. Using "tar -zxvf" seems to only partly achieve this.
Any clues?
Assuming this is possible, the next step would be to autostart the script so that the connection is available immediately after boot. Does TC handle autostarting?
Juanito:
Here's what I use for a similar task:
--- Code: ---#!/bin/sh -e
#
tce-load /mnt/sda1/source/buildtc/08_09_05/b43_firmware.tce
tce-load /mnt/sda1/extensions/wireless_tools.tcel
#
tce-load /mnt/sda1/extensions/wireless-2.6.26.tcem
tce-load /mnt/sda1/extensions/misc-2.6.26.tcem
tce-load /mnt/sda1/extensions/hwmon-cpufreq-2.6.26.tcem
#
sudo modprobe b43
#
sleep 5
sudo iwconfig wlan0 essid "ssid"
sudo iwconfig wlan0 key restricted 7D:3A:7C:72:F7:9A:6F:91:DF:CF:C9:AD:CE
#
sudo udhcpc -b -i wlan0
#
# EOF
--- End code ---
If you call your script from bootlocal.sh, it will start on boot
roberts:
--- Quote ---1. Using AppBrowser to load both wireless_tools.tcel and wpa-supplicant.tce which remain saved to /home/tc (as does the wireless driver)[/quote
Move your extensions to your tce directory as specified by the tce boot code.
They will auto load. Saving you from having to use appbrowser to manually load them.
Storing extensions in home dir only slows down the backup.
Factorization of static vs dynamic content is a principle of TC.
Extensions, code, is static. You should not have to be saving code eveytime.
Your boot time script to configure wireless can be stored in /opt/bootlocal.sh or could be made into a personal .tce.
--- End quote ---
paulfxh:
Thank you for the replies.
Moving both wireless_tools.tcel and wpa-supplicant.tce from /home/tc/ to /mnt/hdd7/tce nicely eliminated the need to load these two extensions after booting.
However, I had less success in getting the wireless configuration script to complete during the boot.
As suggested I added my script to /opt/bootlocal.sh which now looks like this:
--- Code: ---#!/bin/sh
# put other system startup command here
/opt/ra0.sh &
/opt/ra00.sh &
sudo su
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 xxxxxxxxxxxxxxxxxxxxxxxxx
iwconfig ra0 essid "xxxxxxxxxxxxxxx"
ifconfig ra0 192.168.1.5 netmask 255.255.255.0
route add default gw 192.168.1.254
--- End code ---
However, running the script (as root) after the boot works just as well as before.
Two possible reasons for this failure is that network configuration commands (like iwconfig) only run as root. I tried to include a "sudo su" line in the script but this didn't work.
Another possibility is that the script runs before the wireless_tools have had a chance to load in which case iwconfig will not be available.
Any clues?
curaga:
bootlocal already runs as root, the sudo su is not needed.
Perhaps this is a timing problem, try inserting "sleep 5" as the first command after #!/bin/sh to wait 5 secs.
Navigation
[0] Message Index
[#] Next page
Go to full version