Announcement

Collapse
No announcement yet.

Prevent system upgrades from clubbing wireless set-up

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Prevent system upgrades from clubbing wireless set-up

    My computer is not born with wireless, so I use one of these USB-things. Set-up requires modifications to and compiling of the Linksys WUSB600N driver for wireless network, but it works nicely. Except that quite a few system upgrades, including the latest kernel upgrade, club the whole set-up, so that I have to remove the /etc/Wireless/ directory and install all over.
    Philosophically it makes me wonder why system upgrades are made so that they replace rather than upgrade the network installation, but on a more practical level: is there a way to tell the system that Network set-up is off limits during upgrades?

    Thanks,

    kpete

    #2
    Re: Prevent system upgrades from clubbing wireless set-up

    The short answer is no, but there may be a way to save your setup and re-install it in a single action rather than repeating the entire install.

    If you want help figuring that out, you need to post in detail the steps you go through to make this happen.

    In my case, I use port aggregation (bonding) and the network settings require re-doing at every upgrade/install. To make things more fun - the change from 10.10 to 11.04 changed the way this is set up so I had to re-learn the correct way to do it. I always start with a fresh install rather than attempting an upgrade anyway so I figure this is just one of the costs of using a free OS.

    Please Read Me

    Comment


      #3
      Re: Prevent system upgrades from clubbing wireless set-up

      Thanks a lot. The procedure that follows is not for the faint of heart and I would never have come up with it myself. (I do not know what 'bonding' is, in case that matters to your explanation).
      A clever guy who calls himself BabyStuey posted the following at LinuxQuestions.org, and this is what I do. It is not every step that needs to be redone, but here follows BabyStuey's procedure:


      A present for everyone having trouble with the Cisco/Linksys Wireless-N USB Network Adapter with Dual-Band Version 2 (aka WUSB600N v2)!

      NOTE: The code for the Ralink driver is currently NOT 64-bit clean, so any success compiling and installing on a 64-bit kernel (amd64, x86_64, etc.) is pure fluke. If anyone has any luck getting the adapter to work in a 64-bit environment, please let me know! These instructions are proven only for 32-bit environments.

      NOTE: These were the steps required to install the driver on a system running Debian GNU/Linux 2.6.26-2-686, installed from the 5.0.4 (lenny) i386 image available at: http://www.debian.org/CD/

      They were revised to be clearer for users running different distributions, including Ubuntu and Fedora. Others may require minor tweaks, but should work as well.

      Additional Tests Performed:

      Fedora 12 (2.6.31.5-127.fc12.i686.PAE)
      Installed from: Desktop Edition i686 Live CD
      http://download.fedoraproject.org/pu...-i686-Live.iso
      Result: EASY! No added packages were required. Only requires you compile and install the driver - no additional tweaks necessary.

      Ubuntu 10.04 Lucid Lynx (2.6.32-21-generic)
      Installed from: PC (Intel x86) desktop CD image, ubuntu-10.04-desktop-i386.iso
      http://www.ubuntulinux.org/getubuntu/download
      Result: Pretty easy. No added packages were required. Follow the instructions and it should work.

      Ubuntu 10.10 Maverick Meerkat (2.6.35-22-generic) requires version 2.5.0.0 or newer of the driver to work correctly.

      NOTE: pico and nano are command-line text editors. If nano doesn't work in the commands below, try pico. You can always link one to the other by making a link:
      Code:
      # ln /usr/bin/nano /usr/bin/pico
      which will run nano whenever you (accidentally) type pico.

      NOTE: Ubuntu users, please read: https://help.ubuntu.com/community/RootSudo for information running commands as the super-user.

      NOTE: Fedora users are able to ignore the prerequisites, perform Steps 0 through 6, 11 and 12, skipping steps 7 through 10 completely.



      WUSB600N v2
      Quickstart Guide for Linux

      Debian Prerequisites (mostly precautionary):
      - Plug into a wired connection and do a full update with System > Administration > Update Manager.
      - Load Synaptic Package Manager
      - You will have have "linux-image-${VERSION}" installed
      - ...where ${VERSION} is the output from the command `uname -r`. For example: linux-headers-2.6.26-2-686.
      - Make sure you have "linux-headers-${VERSION}" installed
      - Make sure you have "linux-source-${VERSION}" installed
      - Install "build-essential" (and also possibly "kernel-package", "kbuild", "linux-kbuild-${VERSION}", "linux-support-${VERSION}", though I doubt if these were actually required)


      Step 0.
      Stop pretending ndiswrapper will work reliably! lol.

      Step 1.
      Download the correct chipset driver from Ralink:
      - http://www.ralinktech.com/support.php?s=2
      - You need RT3572USB 2.3.0.0 (12/22/2009) or similar
      - NOT RT2870USB (This is for Version 1 only!)

      Step 2.
      Unpack the tarball {DATE}_RT3572_LinuxSTA_{VERSION}.tar.bz2 to a location where you can find it (home folder, Desktop, etc.) All paths listed below are in reference to the folder you just unpacked, for example ${BASE} actually refers to the folder: "/home/username/Desktop/2009_1214_RT3572_LinuxSTA_V2.3.0.0/" (or similar)

      Step 3.
      From the command line, run lsusb. You should get some output that looks like this:
      "ID 1737:0079 Linksys WUSB600N Wireless-N USB Network Adapter with Dual-Band ver. 2"

      Step 4.
      - Open the file ${BASE}/common/rtusb_devid.c (this file has been renamed to rtusb_dev_id.c in newer releases)
      - Line 103 shows the device id for WUSB600N Version 1:
      {USB_DEVICE(0x1737,0x0071)}, /* Linksys WUSB600N */
      - We need to tell the driver to work with Version 2.
      - At line 119, add (which should match your output from Step 3):
      {USB_DEVICE(0x1737,0x0079)}, /* Linksys WUSB600N v2 */
      - Like so:


      Code:
      #ifdef RT35xx
      {USB_DEVICE(0x148F,0x3572)}, /* Ralink 3572 */
      ...
      {USB_DEVICE(0x167B,0x4001)}, /* 3572 */
      {USB_DEVICE(0x1737,0x0079)}, /* Linksys WUSB600N v2 */
      #endif // RT35xx //
      { }/* Terminating entry */
      Step 5.
      As per the ${BASE}/README_STA file's instructions, change the two values in ${BASE}/os/linux/config.mk from =n to =y:
      - HAS_WPA_SUPPLICANT=y
      - HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

      Step 6. --- more on this step below in post #13.
      Compile the driver:
      - cd to the driver's home folder ${BASE}

      $ cd ${BASE}
      $ make
      - Deal with any missing package and/or configuration issues that may be displayed.

      - Once the driver compiles correctly, install it as the superuser:
      $ sudo make install
      OR
      $ su
      # make install
      Step 7.
      If you scroll waaaay to the bottom of ${BASE}/README_STA, you'll see some confusing instructions. What they are trying to say is:
      - As the superuser, open /etc/modules
      $ sudo nano /etc/modules
      OR
      $ su
      # nano /etc/modules
      - In Ubuntu, add the lines:

      rt3572sta # Ubuntu only!
      alias ra0 rt3572sta
      - In Debian, add only the line:

      alias ra0 rt3572sta
      Step 8.
      If you want your driver module to load at startup (and this you do)...
      - As the superuser, open /etc/network/interfaces

      $ sudo nano /etc/network/interfaces
      OR
      $ su
      # nano /etc/network/interfaces
      - Update the line that starts with "auto" to include "ra0", for example:

      auto lo ra0
      and add the line:

      allow-hotplug ra0
      - For more information on this step, type the command:

      man 5 interfaces

      Step 9.
      Blacklist the alternate drivers:
      - As the superuser, open /etc/modprobe.d/blacklist or blacklist.conf (whichever you have)
      $ sudo nano /etc/modprobe.d/blacklist.conf
      OR
      $ su
      # nano /etc/modprobe.d/blacklist
      - Add the lines:

      Code:
      #default WUSB600 staging drivers
      blacklist rt2870sta
      blacklist rt2800usb
      Step 9 Troubleshooting:
      You may have to also blacklist a selection of additional drivers that come with your kernel. For example, the default Ubuntu 2.6.32-21-generic installation may require the following:

      Code:
      blacklist rt2860sta
      blacklist rt2870sta
      blacklist rt3090sta

      blacklist rt2x00usb
      blacklist rt2500usb
      blacklist rt2800usb
      blacklist rt73usb
      If you do a module listing, you can see the kernel object modules attached to your kernel:

      Code:
      modprobe -l
      This is a pretty long list, so let's shorten it to see what we want. One of these should do the trick:


      Code:
      modprobe -l | grep wireless
      modprobe -l | grep sta.ko
      modprobe -l | grep usb.ko
      Look for any drivers that match rtXXXXsta.ko or rtXXXXusb.ko that are NOT rt3572sta.ko and try blacklisting them as well (minus the .ko extension).


      Step 10.
      Reboot.

      Step 11.
      Open up your favourite network manager and configure your wireless connection.

      If you're still not getting a connection, repeat Step 3 to ensure your adapter is present. If it does not show, unplug it and reinsert. lsusb should now show your adapter and you should be able to connect.

      If you're STILL not getting a connection, Consider installing "Wicd", an alternative network manager. You will need to manually input "ra0" as your "Wireless interface in the Preferences pane.

      Step 12.
      Happy surfing, dude(tte)!

      Comment


        #4
        Re: Prevent system upgrades from clubbing wireless set-up

        Forgive me for asking the obvious, but have you considered buying a wireless dongle that *doesn't* need a driver compiled with each kernel upgrade?
        we see things not as they are, but as we are.
        -- anais nin

        Comment


          #5
          Re: Prevent system upgrades from clubbing wireless set-up

          If we assume you know the model you have, we can skip some of that. Lets also assume you've done a new install and fully updated and rebooted and are now ready to install the driver.

          There are actually two cases when you might need to do this - New install and Kernel (or driver) update.

          Let's break it down to actual commands and automate as much as possible. I've replaced your steps with shorter commands (for K(U)buntu - other distros YMMV) when able. By changing the sequence of events slightly
          you can automate a bit further.


          The downloading and unpacking would have to be manually because the website requires authentication, but you could keep the current driver on a thumb drive or in your /home (on a separate partition from your install). Then this step would only need to be done if you wanted an updated driver. The data entered on the website is not really verified so maybe someone could write script to automate that.

          Step 0 : Download the driver to /home/pete/radriver

          Step 1 : Install needed packages

          sudo apt-get install linux-headers-`uname -r` linux-source-`uname -r` build-essential kernel-package kbuild linux-kbuild-`uname -r` linux-support-`uname -r`

          Step 2. Unpack the tarball {DATE}_RT3572_LinuxSTA_{VERSION}.tar.bz2 to /home/pete/radriver/ with this command

          ark -b -a /home/pete/radriver/ {DATE}_RT3572_LinuxSTA_{VERSION}.tar.bz2

          Step 3 : You should know your device info by now.

          Step 4 : Add "v2" to rtusb_dev_id.c

          sed -i 's/Linksys WUSB600N/Linksys WUSB600N v2/g' /home/pete/radriver/ {DATE}_RT3572_LinuxSTA_{VERSION}/rtusb_dev_id.c

          Step 5 : Change the two values in ${BASE}/os/linux/config.mk from =n to =y:
          sed -i 's/HAS_WPA_SUPPLICANT=n / HAS_WPA_SUPPLICANT=y /g' /home/pete/radriver/ {DATE}_RT3572_LinuxSTA_{VERSION}/os/linux/config.mk

          sed -i 's/HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n /HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y /g' /home/pete/radriver/ {DATE}_RT3572_LinuxSTA_{VERSION}/os/linux/config.mk

          Step 6 : Skipping for now

          Step 7 : Add the module

          sudo sed -i '$a\alias ra0 rt3572sta' /etc/modules

          Step 8 : Set module to load at startup

          sudo sed -i 's/auto lo/auto lo ra0/g' /etc/network/interfaces
          sudo sed -i '$a\allow-hotplug ra0' /etc/network/interfaces




          I'll stop there for now...

          My point is as you can see - if you keep the driver in a fixed location and are using only Kubuntu, you could write a script file (maybe two) that could do almost all of the work for you. With the exception of the downloading of the file (still might be possible) and the actual compiling (I'm not educated enough to script that, but I bet someone could), you would only have to run the script(s) and wait for it.

          You might have to do an occasion check of the scripts if there was a change of the drivers files structure or the kernel drastically changed,but I doubt that would happen often.

          Please Read Me

          Comment


            #6
            Re: Prevent system upgrades from clubbing wireless set-up

            Wow, I get the general idea. It will take a while to digest some of the steps, but I'll get there; many thanks,
            kpete

            Comment

            Working...
            X