sábado, 1 de diciembre de 2007

modprobe command

The following content is a textual copy from http://delajusco.wordpress.com/2007/08/11/modprobe/

The reason I decided to quote it here is the volatile that internet address are.

modprobe

El programa modprobe es un comando de administración del sistema en Linux hecho para la gestión (visualización, inclusión o exclusión) de módulos cargables al kernel. Módulo es la palabra que hay en Linux para referirse al tipo de software que hace el mismo truco que los drivers de Windows.

Una breve descripción.

Durante el arranque del sistema modprobe típicamente revisa el contenido de tres objetos del sistema de archivos de Linux:

  • el directorio /lib/modules/`uname -r` donde se encuentran los módulos del kernel y archivos relacionados para el kernel en uso.
  • el archivo de texto /etc/modules que contiene la lista de módulos opcionales que deben cargarse al kernel por omisión y
  • la lista negra, que es un archivo de texto ubicado en /etc/modprobe.d/blacklist que contiene la lista de módulos que no deben cargarse al kernel bajo ninguna circunstancia
nota: las ubicaciones son convencionales y pueden variar entre distribuciones. Los directorios y archivos descritos siguen la costumbre de Debian y las distros basadas en él.

Uso y opciones básicas.

Digamos que modulename es el módulo que quieres inyectar al kernel. Para eso escribe

modprobe modulename

como root o super usuario o, de otro modo,

sudo modprobe modulename

Hecho lo cual puedes revisar que el módulo esté cargado pidiéndole a modprobe la lista de módulos cargados con

modprobe -l

ó

modprobe --list

que es impráctico por que la lista suele ser muy larga. Pero puedes preguntar por un módulo particular o usar comodines

modprobe -l modulename

ó

modprobe --list modulename

Por último, puedes excluír el módulo del kernel usando la opción -r ó –remove como root o super usuario o, en su defecto, usando el comando sudo:

modprobe -r modulename

ó

modprobe --remove modulename

Modprobre excluye módulos del kernel llamando a otro comando, rmmod, que tú también puedes usar directamente.

Para más opciones e información, consulta el manual de tu sistema

man modprobe

Kubuntu - Installing wireless in a Dell Inspiron 1501

This notes applies for Kubuntu feisty on a Dell inspiron 1501. Also I have used the same notes for a Dell Latitude D620 just changing the appropriate wireless card driver.

In general terms we need to do the following in order to enable wireless using ndiswrapper:

  1. Disable bcm43xx
  2. Unistall ndiswrapper (if it is necessary, sometimes the version that came with the Kubuntu does not work correctly, that is the case for Kubuntu Edgy)
  3. Install ndiswrapper
  4. Install the wireless card driver for windows on ndiswrapper
  5. Try it!!
Disable bcm43xx

Kubuntu comes with the open source bcm43xx driver, see https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx If this driver doesn't work for you, then you should disable it, because it will conflict with ndiswrapper.

  • First we will blacklist the wrong drivers with these two commands :
#lsmod | grep 43xx #vi /etc/modprobe.d/blacklist

Add blacklist bcm43xx

  • Unload the module with:
#modprobe -r bcm43xx


Uninstalling ndiswrapper

  • Verify ndiswrapper module is installed
#modprobe --list | grep ndiswrapper
  • Make sure you unload your current ndiswrapper module with
#modprobe -r ndiswrapper
  • You need to remove the user space tools ndiswrapper (in /usr/sbin) and loadndisdriver (in /sbin), and kernel module ndiswrapper (in /lib/modules/`uname -r`/misc). If these files are not in these locations, then they may have been installed elsewhere (e.g., user spaces tools may be installed in /usr/bin). You can use which or locate command to now where the user space tools are located (e.g., which ndiswrapper gives the location of ndiswrapper tool). Once these are located, remove them; e.g., rm ndiswrapper. Note that the kernel module file is called ndiswrapper.o in 2.4 kernels and ndiswrapper.ko in 2.6 kernels.
  • Alternately, you can use locate to find where ndiswrapper files are stored. First, update the database used by locate with updatedb. This takes sometime and when it is done, run locate ndiswrapper and remove all the files listed and then run locate loadndisdriver and remove all the files listed.
  • If locate doesn’t find the module, you can use find instead: find /lib/modules/$(uname -r) -name “ndiswrapper*” -print will print the location of the modules. You should then remove all the files printed.
  • ndiswrapper installs Windows drivers under /etc/ndiswrapper directory. If you want to uninstall just a specific Windows driver, first list the drivers installed with ndiswrapper -l. If you then want to remove, say, driver “bcmwl5”, then remove it with ndiswrapper itself with ndiswrapper -r bcmwl5. If that doesn’t work, just remove the directory /etc/ndiswrapper/bcmcwl5 (e.g., with /bin/rm -rf /etc/ndiswrapper/bcmwl5). If you want to uninstall all Windows drivers, then remove /etc/ndiswrapper (e.g,. with /bin/rm -rf /etc/ndiswrapper).
  • ndiswrapper -m (creates and) installs an alias in /etc/modprobe.d/ndiswrapper. If you want to remove this alias (since you might not want ndiswrapper module to be loaded when using wlan0 network interface), remove it: rm -f /etc/modprobe.d/ndiswrapper

Install ndiswrapper

  • Download ndiswrapper from http://ndiswrapper.sourceforge.net/joomla/
  • The most recent version of ndiswrapper. For Kubuntu Feisty on a Dell Inspiron 1501 I used ndiswraper 1.50 and for Kubuntu Edgy on a Dell Latitude I used ndiswrapper 1.38
  • Extract the content of the zip file in a temp directory
#gunzip -c ndiswrapper-1.50.tar.gz | tar xvf -
  • Move to the ndiswrapper directory and execute
#make distclean #make #make install

Install the wireless card driver for windows on ndiswrapper

  • Download the windows wireless card driver for Dell Inspiron 1501
#wget http://ftp.us.dell.com/network/R140747.EXE

  • Create a temp directory and extract the R140747 driver
#mkdir R140747
#cp R140747.EXE R140747
#unzip -a R140747.EXE


  • Install the windows driver
#cd R140747/DRIVER
#ndiswrapper -e bcmwl5
#ndiswrapper -i bcmwl5.inf
#ndiswrapper -l
#ndiswrapper -m
#modprobe ndiswrapper

  • To make this tool launch at startup add to /etc/modules the word ndiswrapper at the of file
  • Reboot the system
Try it!!
  • In order to test if the wi-fi is installed correctly type:
# iwlist scanning

  • Look in the Network Manager icon and check if it detects any wireless signal.
  • In the network manager, enter your ESSID and WEP key with right click on the icon from the notification area.



sábado, 17 de noviembre de 2007

Kubuntu - Installing a package from DVD

Sometimes when your are configuring your linux, you usually do not have access to inernet, so you can use the following lines to install the package from CD:

$sudo apt-cdrom add
$sudo apt-get update
$sudo apt-get install build-essential


This will install the build-essential package necessary for any source compilation