Sunday, 24 February 2008

NVIDIA Linux driver 1.0-9625 fails to compile with kernel

I was getting errors like:
  • 'kmem_cache_t' is deprecated
  • SA_SHIRQ and SA_INTERRUPT undeclared
You can get a patch here.

To apply it:

wget -nc
sh --extract-only --target virgin_dir
cd virgin_dir/
patch -p1 < ../NVIDIA-Linux-x86-1.0-9625-

Thursday, 8 November 2007

Recent Debian update (Nov 2007) breaks Nvidia propietary driver

To fix it, just do:

apt-get install xserver-xorg-dev

and recompile the driver again.

Sunday, 16 September 2007

Firefox hogs CPU, 100% use on (II breakthrough)

I have realised that firefox hogs my CPU ONLY if I use the open source NV driver. Using the proprietary NVIDIA driver seems to fix the problem although it is still using too much CPU in my opinion. At least, with the proprietary driver I can browse, something impossible to do with the open source driver.

This is really a shame, because the NVIDIA driver does not allow me to suspend to RAM (crash on resume) and the NV one does. So, I'm still waiting for a proper solution...

Firefox hogs CPU, 100% use on (I)

This is a problem that has been annoying me for the last year or so. Somehow, my firefox (v2.0.0.6 on an up to date debian testing) seems to choke on some websites like, and others.

Lots of people seem to be having this issue and on some boards I've seen suggestions like:
  • Install Flashblock: crap flash support on Linux is legendary.
  • Install NoScript: some javascripts may be too heavy?
  • Remove all the extensions: try to pinpoint a badly written extension.
  • Change default firefox config: play with memory limits, cache size... etc.

Well, I've tried them all and the problem is still there. I decided then to change the approach and try to see if it somehow was NOT a firefox issue. After two hours googling these are the results:


So I just added this line to the "Device" section of my /etc/X11/xorg.conf:

Option "AccelMethod" "exa"

And restarted X... Firefox is suddenly faster than it's ever been for
me :D

Interestingly enough, AccelMethod "exa" causes this on my laptop.
The laptop is a Pentium 4 2.8Ghz with 1G memory and an ATI Radeon Mobility 9000 (R250) sharing the main memory.
However, AccelMethod "XAA" and having RenderAccel "true" fixes it.
exa was faster on Edgy.

I had the same problem till I installed nvidia-glx. Now it seems to work fine.

[Bug 38131] Re: Firefox causes massive Xorg CPU usage

I can also confirm on

100% cpu usage while loading the page, and 100% while scrolling.

Option "AccelMethod" "exa"
in xorg.conf does not help.

Feisty w/ current updates
Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20061201
Firefox/ (Ubuntu-feisty)
ATI Radeon (the original)

Saturday, 1 September 2007

Windows partitions (NTFS) in read-write for Debian

This procedure will let you automount your windows partition on Linux in a way that almost any user can read AND WRITE to it.

First, make sure you have ntfs-3g installed (you will also need fuse support, not sure now but you may need to recompile your kernel...)

Now, given this drive:

brw-rw---- 1 root disk 3, 1 Sep 1 18:55 /dev/hda1

put this line into your /etc/fstab:

/dev/hda1 /mnt/windows ntfs-3g defaults,gid=disk 0 1

which will automount /dev/hda1 into /mnt/windows and will set the group to "disk", so any user on that group will have permissions to read and write.

Reboot, and your windows drive will be ready!

Thursday, 30 August 2007

How to automount a usb stick and make it accessible to non root users

I will assume that you have autofs and udev installed.

First of all, go to /etc/udev and create a file called usbstick.rules
The contents of that file are as follows:

ACTION!="add", GOTO="usbstick_rules_end"
SUBSYSTEM=="usb_device", GOTO="usbstick_rules_real"
SUBSYSTEM=="scsi", GOTO="usbstick_rules_real"


SYSFS{idVendor}=="XXXX", \
SYSFS{idProduct}=="XXXX", \
KERNEL=="sd?1", \
NAME="%k", \
SYMLINK="usbstick", \
MODE="0660", \


This will create a symlink to /dev/sdX1 called "usbstick" with the group "usbstick" each time the usb device with the given product and vendor id is inserted. You can check the ids with "lsusb -v"

Remember to create a link from /etc/udev/rules.d to that file usbstick.rules

After restarting the udev daemon and inserting the stick you should see something like:

lrwxrwxrwx 1 root root 4 Aug 30 20:58 /dev/usbstick -> sdb1
brw-rw---- 1 root usbstick 8, 17 Aug 30 20:58 /dev/sdb1

So, we now have a link to the device that should be accessible to anyone on the usbstick group.

Only thing left is to mount the device. It can be done adding this line to /etc/auto.removable

usbstick -fstype=vfat,rw,gid=1004,umask=002 :/dev/usbstick

gid 1004 is the id for the usbstick group.

We will also need to create a link to the removable device, something like (from /)

ln -s /var/autofs/removable/usbtick usbstick

After inserting the stick and changing dir into /usbstick you should now see the contents of your stick.

Sunday, 10 June 2007

Hostap Injection patch on Ubuntu 7.04 (Feisty Fawn)

This is a quick tutorial on how to compile the hostap driver with the aircrack-ng injection patch. Everything is done from scratch on a vanilla feisty fawn.

We are going to be doing some kernel compilation, so make sure that at least these two packages are installed on your system: "dpkg-dev" and "linux-kernel-devel" (they are normally not included in the basic distro).

Create a temp directory where we can download the kernel sources and the injection patch:

mkdir HostApInjection
cd HostApInjection

Create a sub directory to hold the compilation output. Copy your current kernel config onto it:

mkdir OutputDir
cp /boot/config-2.6.20-16-generic OutputDir/
ln -s OutputDir/config-2.6.20-16-generic OutputDir/.config

Now get the kernel:

apt-get source linux-image-2.6.20-16-generic

Get the injection patch:

wget -nc

or just click here. This is the SAME patch as in, it's just tailored for 2.6.20-16

Patch the kernel:

patch -p1 < hostap-kernel-injection-2.6.20-16.patch

And compile just the hostap module:

cd linux-source-2.6.20-2.6.20/
make O=../OutputDir outputmakefile
make O=../OutputDir archprepare
make O=../OutputDir modules SUBDIRS=scripts
make O=../OutputDir modules SUBDIRS=drivers/net/wireless/hostap

The new module should now be ready. We just need to replace the old one (you may want to save a copy somewhere safe):

cd OutputDir/drivers/net/wireless/hostap/
sudo cp -dpR *.ko /lib/modules/2.6.20-16-generic/kernel/drivers/net/wireless/hostap/

And that's it! Hostap should now support injection and you can start playing with aircrack-ng.