Rebuild specific kernel modules on PandaBoard


This procedure rebuilds the kernel modules for usb networking but the same procedure can be applied to other modules as well.

Environment

I am running Ubuntu 11.04 preinstalled netbook image for OMAP4.

Obtain Kernel Source

Download debian package from launchpad. I could not apt-get it for some reason. So I installed the deb package using

sudo dpkg -i linux-source-2.6.38_2.6.38-11.48_all.deb

Extract kernel source

After installation, the compressed kernel source is available at /usr/src/linux-source-2.6.38. You can extract the kernel source to your home folder like this

tar xjf /usr/src/linux-source-2.6.38/linux-source-2.6.38.tar.bz2

Obtain Kernel Headers

You may already have the kernel headers installed, otherwise

sudo apt-get linux-headers-omap4

Rebuild module

Head over to the folder of the module

cd ~/linux-source-2.6.38/drivers/net/usb

Rebuild using make

make -C /usr/src/linux-headers-2.6.38-1208-omap4 M=`pwd`

Replace modules

Backup existing module objects in case something goes wrong. Replace them

sudo cp *.ko /lib/modules/2.6.38-1208-omap4/kernel/drivers/net/usb/

Check if a module is already loaded

lsmod

and remove it

rmmod cdc_ether

Do something like plugging in the hardware so that the new module gets loaded.

That’s all.

[With some inspiration from here. The reason I was rebuilding was to fix a regression in the usbnet driver reported here.]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s