LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 07-19-2008, 11:11 PM   #1
sunnior
Member
 
Registered: Feb 2008
Distribution: ubuntu
Posts: 43

Rep: Reputation: 15
make a change permanent ubuntu


hi, everyone. just a simple question:

I have made my wireless work by using nidswrapper. Because of a fatal bug,
every time, before I start my wireless , I have to do this chore:

Quote:
sudo rmmod ssb
sudo modprobe ndiswrapper
sudo modprobe ssb
How can I make this change permanent? TIA

Last edited by sunnior; 07-19-2008 at 11:35 PM.
 
Old 07-20-2008, 12:11 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
You can try the following. (The worst that can happen is it won't work. )

Create the following script in your home directory (directory chosen for ease) with (for example) the name wireless_kludge.

Code:
#!/bin/bash

#Change the following statement to reflect the interface that is used for wireless!

WIRELESS=eth1

[ $IFACE == $WIRELESS ] || exit 0

rmmod ssb
modprobe ndiswrapper
modprobe ssb
Make sure to change the name of the interface assigned to $WIRELESS to the actual wireless interface. Then install the script to /etc/network/if-pre-up.d/ :

Code:
sudo install wireless_kludge /etc/network/if-pre-up.d
You can, of course, name the script anything (preferably descriptive!) that you want so long as that name is not already used in if-pre-up.d. After installing it, you may delete the copy in your home directory if you wish.

Explanation: The scripts in if-pre-up.d are run (as root) before bringing up interfaces. The statement with exit causes this script to do nothing unless the interface about to come up is your wireless interface. Since the script is already running as root you don't need sudo statements. The install statement copies the script to the desired directory, changing the user/group to root/root and setting correct permissions.
 
Old 07-20-2008, 12:49 AM   #3
sunnior
Member
 
Registered: Feb 2008
Distribution: ubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
It didn't work.

When I login in on tty2, I get the following message:

Quote:
error:removing 'ssb' : Operation not permitted
fatal:error inserting ndiswrapper (/lib/modules/2.6.24-16-generic/ubuntu/misc/ndiswarapper/ndiswrapper.ko) : operation not permitted
Does that mean this script didn't run as root?
 
Old 07-20-2008, 01:39 AM   #4
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
What is that 'ssb' driver?

You can cheat a little; create a file in /etc/modprobe.d/ which has a line like this:
install ssb /sbin/modprobe ndiswrapper && /sbin/modprobe ssb

That should force 'ndiswrapper' to load before 'ssb' - assuming that loading ssb isn't done by the initrd's 'init' script.
 
Old 07-20-2008, 07:30 AM   #5
sunnior
Member
 
Registered: Feb 2008
Distribution: ubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
You can cheat a little; create a file in /etc/modprobe.d/ which has a line like this:
install ssb /sbin/modprobe ndiswrapper && /sbin/modprobe ssb
Tried this.
Operation not permitted, still.
 
Old 07-20-2008, 03:45 PM   #6
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by sunnior View Post
It didn't work.

When I login in on tty2, I get the following message:



Does that mean this script didn't run as root?
Placing the script script in /etc/network/if-pre-up.d should cause it to run automaticlly as root when you try to bring up the wireless interface. Were you trying to run the script manually? If you want to do that (presumably to test it) you will have to:

Code:
IFACE=eth1 sudo <path>/wireless_kludge
Substitute the correct path for <path> (I am not sure where you are running this from) and substitute the correct interface for eth1. (The interface must match what you set in the script or the script will exit w/o doing anything. And you should have set the value in the script to the interface that is used for wireless.)

I am not sure what the underlying problem is that this works around. So, after my first post, it occurred to me that depending on the underlying problem you may need to put the script in /etc/network/if-post-down.d instead of /etc/network/if-pre-up.d. This would cause it to run every time after the wireless is shutdown rather than before the wireless is started.

EDIT: After thinking about this, I may have misinterpreted your post. Were you seeing these error messages as a result of the script running in if-pre-up.d? If so you might need to run the script after you shutdown by moving the script to /etc/network/if-post_down.d. If you still need to run it prior to the first time you bring up the wireless, you can put the commands in /etc/rc.local (or call the script from there, prefacing it -- on the same line -- with the appropriate IFACE= statement).

EDIT2: Yet further reflection makes me realize there might be a problem with the order that scripts are executing. In if-pre-up.d and if-post-down.d the scripts are executed in alphabetical order. If the script is in if-pre-up.d, add the letter "a" to the beginning of the name to force it to run first. If the script is in if-post-up.d, add the letter "z" to the beginning of the name to force it to run last.

Last edited by blackhole54; 07-20-2008 at 04:19 PM.
 
Old 07-20-2008, 11:41 PM   #7
sunnior
Member
 
Registered: Feb 2008
Distribution: ubuntu
Posts: 43

Original Poster
Rep: Reputation: 15
Yesterday, I followed this tread: https://help.ubuntu.com/community/Wi...eisty_No-Fluff

and I did as what it told me to make this change permanent.

Quote:
echo -e '#Hardy ssb/ndiswrapper workaround, added' `date` '\ninstall ndiswrapper modprobe -r b43 b44 b43legacy ssb; modprobe --ignore-install ndiswrapper $CMDLINE_OPTS; modprobe ssb; modprobe b44;' | sudo tee -a /etc/modprobe.d/ndiswrapper
it works now, thanks you for your advice , blackhole54
 
  


Reply

Tags
ubuntu, wireless


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Permanent hostname change in OS X 10.4 air4s_1 Other *NIX 1 06-16-2006 04:40 PM
Making MTU change permanent Firestarter75 Mandriva 2 02-16-2005 07:20 PM
net.ipv4.tcp_syn_retries - how to make change permanent syx Linux - Networking 1 01-05-2005 11:54 AM
rmmod - making the change permanent? DiBosco Linux - General 0 06-20-2004 06:32 AM
make the permanent change to /etc/sysctl.conf ashley75 Linux - General 1 09-15-2003 01:24 PM


All times are GMT -5. The time now is 03:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration