WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Resolved] Autostart wireless connection on EeePC 901  (Read 14736 times)

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: How to load extension from CLI?
« Reply #15 on: January 23, 2009, 12:55:40 PM »
Glad to hear it works.

Note that you could just use one script, ie startwifi, by just moving/replacing the statements over.

Offline paulfxh

  • Newbie
  • *
  • Posts: 40
Re: How to load extension from CLI?
« Reply #16 on: January 23, 2009, 02:53:07 PM »
OK, I've got it down to one script and here it is:
Code: [Select]
#!/bin/sh
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
/usr/local/sbin/iwconfig ra0 key open
/usr/local/sbin/iwconfig ra0 key xxxxxxxxxxxxxxxxxxxxxxxxxx
/usr/local/sbin/iwconfig ra0 essid "xxxxxxxxxxxxxxx"
ifconfig ra0 192.168.1.5 netmask 255.255.255.0
route add default gw 192.168.1.254
Note that the sleep command wasn't needed at all.
However, it's not clear to me why some duplication (e.g the route command) is necessary but the script doesn't seem to work without it.
Something else I don't understand is that if I put my script into /opt (from ~/) it doesn't survive a reboot. Along the same lines is the fact that the Ralink driver needs to be copied to /lib/modules/2.6.26-tinycore/kernel/drivers/net/ on every boot.
Incidentally, because I was essentially "barking up the wrong tree", the title of this thread is quite misleading. Perhaps it would be more useful to others in the future if its title was more appropriate. However, I'm not sure of your policy in this regard.

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: How to load extension from CLI?
« Reply #17 on: January 23, 2009, 03:27:11 PM »
See curaga's post for a possible explanation.  This may be better:
Code: [Select]
#!/bin/sh
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
/usr/local/sbin/iwconfig ra0 key open
/usr/local/sbin/iwconfig ra0 key xxxxxxxxxxxxxxxxxxxxxxxxxx
/usr/local/sbin/iwconfig ra0 essid "xxxxxxxxxxxxxxx"
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

Quote
Something else I don't understand is that if I put my script into /opt (from ~/) it doesn't survive a reboot.
See backup/restore, ie /opt/.filetool.lst, "Getting Started" doc

Quote
Along the same lines is the fact that the Ralink driver needs to be copied to /lib/modules/2.6.26-tinycore/kernel/drivers/net/ on every boot.
You could use the generated extension instead (posted something on this in this thread iirc) which is recommended, or one of the other options to have it persistent.

Quote
Incidentally, because I was essentially "barking up the wrong tree", the title of this thread is quite misleading. Perhaps it would be more useful to others in the future if its title was more appropriate.
You can change the title if you wish, but it will not change the titles of the replies.

Offline paulfxh

  • Newbie
  • *
  • Posts: 40
Re: How to load extension from CLI?
« Reply #18 on: January 23, 2009, 09:27:49 PM »
Thanks for the suggestions.
I tried your suggested script but this didn't work. It seems you need to run the extended "ifconfig ra0 up" before running the "iwconfig ra0" commands which seems reasonable.
This one works fine for me:
Code: [Select]
#!/bin/sh
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 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255 up
/usr/local/sbin/iwconfig ra0 key open
/usr/local/sbin/iwconfig ra0 key a784947226d4aedbfadce86783
/usr/local/sbin/iwconfig ra0 essid "eircom6523 7524"
route add default gw 192.168.1.254

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: [Resolved] Autostart wireless connection on EeePC 901
« Reply #19 on: January 24, 2009, 09:58:20 AM »
You could tar up your /lib/modules/2.6.26-tinycore/kernel/drivers/net/rt2860sta.ko.gz and name it rt2860sta.tcem then copy it to your tce directory

tces are basically tarballs with optional menu and icon items.
The ending 'm' signals that the extension has module(s) and thus depmod is automactic.

By doing so, you can then drop these lines
Code: [Select]
cd /home/tc
cp rt2860sta.ko.gz /lib/modules/2.6.26-tinycore/kernel/drivers/net/
depmod -a

This also saves you from backing up and restoring the static content of rt2860sta.ko.gz
Something that TC encourages, factorization of static from dynamic content via making your own personal extensions.
10+ Years Contributing to Linux Open Source Projects.

Offline paulfxh

  • Newbie
  • *
  • Posts: 40
Re: [Resolved] Autostart wireless connection on EeePC 901
« Reply #20 on: January 24, 2009, 03:00:49 PM »
You could tar up your /lib/modules/2.6.26-tinycore/kernel/drivers/net/rt2860sta.ko.gz and name it rt2860sta.tcem then copy it to your tce directory

tces are basically tarballs with optional menu and icon items.
The ending 'm' signals that the extension has module(s) and thus depmod is automactic.

By doing so, you can then drop these lines
Code: [Select]
cd /home/tc
cp rt2860sta.ko.gz /lib/modules/2.6.26-tinycore/kernel/drivers/net/
depmod -a

This also saves you from backing up and restoring the static content of rt2860sta.ko.gz
Something that TC encourages, factorization of static from dynamic content via making your own personal extensions.
I very much would like to do this but I'm running into a problem (essentially due to inexperience  :D).
I have read the creating extensions guide but note that this refers to packages rather than to single files such as this driver.
In any event, what I did was to copy the "/lib/modules/2.6.26-tinycore/kernel/drivers/net/rt2860stta.ko.gz" file to "rt2860sta.filelist" and ran this command:
Code: [Select]
sudo tar -cvzpf rt2860sta.tcem rt2860sta.filelistI was unable to use the --numeric-owner switch as it caused the command to fail.
I then placed the resulting rt2860sta.tcem in /mnt/hdd7/tce and commented out the three lines you referred to in your post from my script (startwifi).
However, during the next reboot, not only was wireless not started but the ra0 interface wasn't created either.
Obviously, I've slipped up somewhere.  :-[

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: [Resolved] Autostart wireless connection on EeePC 901
« Reply #21 on: January 24, 2009, 03:12:58 PM »
I was just thinking of tar command like this, after you have copied the module:

tar -C / -czvf ra2860.tcem  lib/modules/2.6.26-tinycore/kernel/drivers/net/rt2860sta.ko.gz

Then move the ra2860.tcem to your tce directory.
10+ Years Contributing to Linux Open Source Projects.

Offline paulfxh

  • Newbie
  • *
  • Posts: 40
Re: [Resolved] Autostart wireless connection on EeePC 901
« Reply #22 on: January 24, 2009, 05:49:08 PM »
Well, that wasn't too difficult and it works fine.
My wireless autostart script is down to just eight lines now:
Code: [Select]
#!/bin/sh
echo nameserver 208.67.222.222 > /etc/resolv.conf
echo nameserver 208.67.220.220 >> /etc/resolv.conf
modprobe rt2860sta
ifconfig ra0 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255 up
/usr/local/sbin/iwconfig ra0 key open
/usr/local/sbin/iwconfig ra0 key xxxxxxxxxxxxxxxxxxxxxxxxxx
/usr/local/sbin/iwconfig ra0 essid "xxxxxxxxxxxxxxx"
route add default gw 192.168.1.254
Thanks for the advice.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: [Resolved] Autostart wireless connection on EeePC 901
« Reply #23 on: February 12, 2009, 07:14:18 PM »
I was just thinking of tar command like this, after you have copied the module:

tar -C / -czvf ra2860.tcem  lib/modules/2.6.26-tinycore/kernel/drivers/net/rt2860sta.ko.gz

Then move the ra2860.tcem to your tce directory.

I just tried modprobing bcm43.xx.ko and got an invalid module format error for some reason.

edit: after a little research, I can see broadcom requires a bit more......think  I'll stick with my simple
ath0 cards....
« Last Edit: February 13, 2009, 04:26:53 AM by jpeters »