View previous topic :: View next topic |
Author |
Message |
jjc53 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Apr 2004 Posts: 13
|
Posted: Mon Apr 26, 2004 3:44 am Post subject: can someone tell me how to create a script? |
|
|
My ethernet card is really finicky. The only way I can get it to work is to force the link speed to half duplex using
Code: | mii-tool etho -F 10BaseT-HD
/etc/init.d/net.eth0 restart |
However, once I reboot, that setting is lost, and then I had to wait for the bringing eth0 up to timeout at boot. Right now, my fix is I removed the net.eth0 from the runlevels, and manually type the code (only as root) above when i need network access.
Is there anyway I can create a script with these two commands that I can insert in the runlevels at boot time? I hope this isn't a stupid question, but I am new to unix. I just finished compiling gentoo-dev-sources 2.6.5 kernel. If there is a way, can you explain how to do it.
Thanks in advance |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
teknomage1 Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1170945783f87171277cf3.png)
Joined: 05 Aug 2003 Posts: 1239 Location: Los Angeles, CA
|
Posted: Mon Apr 26, 2004 4:06 am Post subject: |
|
|
Save this snippet as /etc/init.d/eth0tweak
Code: | #!/sbin/runscript
depend() {
provide eth0tweak
}
start() {
mii-tool etho -F 10BaseT-HD
}
|
Don't forget to do 'chmod + x /etc/init.d/eth0tweak' and edit the depend portion of /etc/init.d/net.eth0 to look like this
Code: | depend() {
need eth0tweak
use hotplug pcmcia
} |
and execute 'rc-update add eth0tweak default' and it should work. What this is doing is telling the init system to run the mii-tool command before it's allowed to bring up eth0. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pjp Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1154772887439692d88303b.jpg)
Joined: 16 Apr 2002 Posts: 20588
|
Posted: Mon Apr 26, 2004 4:42 am Post subject: |
|
|
Moved from Installing Gentoo. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jjc53 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Apr 2004 Posts: 13
|
Posted: Mon Apr 26, 2004 3:20 pm Post subject: |
|
|
thank you for this code. what is the purpose of the hotplug pcmcia line? i do not think i have pcmcia support becuase i have no pcmcia cards. will that effect any of the code?
thanks |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ynef n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/1297260049408f8408a1a01.gif)
Joined: 14 Jan 2004 Posts: 69 Location: Lund, Sweden
|
Posted: Mon Apr 26, 2004 5:47 pm Post subject: |
|
|
jjc53 wrote: | thank you for this code. what is the purpose of the hotplug pcmcia line? i do not think i have pcmcia support becuase i have no pcmcia cards. will that effect any of the code?
thanks |
What he means is that you should add the line that says "need eth0tweak" to the depend() portion of net.eth0
Cheers! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jjc53 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Apr 2004 Posts: 13
|
Posted: Mon Apr 26, 2004 6:07 pm Post subject: |
|
|
Ok, I see now. I thought that he was talking about the same depend function. So that hotplug pcmcia is already in the net.eth0 depend function.
Thanks a lot both of you...that's a big help
![Very Happy :D](images/smiles/icon_biggrin.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jjc53 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 15 Apr 2004 Posts: 13
|
Posted: Mon Apr 26, 2004 8:59 pm Post subject: |
|
|
I tried what you said and it worked. Thanks again.
However when I ran rc-update it said:
Code: | Cannot add provide 'eth0tweak', as a service with the same name exis |
It doesn't seem to affect anything, but do you know what that means? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|