djwhitt.com/blog

Archive for the ‘Gentoo’ Category

Hacks for Intel 3945ABG Wireless Card

without comments

My laptop has an Intel 3945ABG mini-pci wireless card. Overall it seems to be a pretty good card, but there are some driver issues on Linux (as of 2.6.24). First wpa_supplicant has an annoying habbit of spewing out an error message (ioctl[SIOCSIWAUTH]: Operation not supported) whenever I start up the network interface. It seems to work fine regardless, but the message annoys me. I silenced it by adding the following line to my /etc/conf.d/net:

wpa_supplicant_wlan0="-Dwext 2> /dev/null"

Another problem I had was that the card wasn’t properly powering itself up and down when I restarted the network interface. I took care of that with this little preup script which I also added to /etc/conf.d/net:

preup() {
  if [ ${IFACE} = "wlan0" ]; then
    echo 0 > /sys/bus/pci/drivers/iwl3945/*/rf_kill
    iwconfig wlan0 txpower on
  fi
}

Update: As of 2.6.25 the powerup issue seems to be resolved, but I still see the error message from wpa_supplicant.

Written by djwhitt

August 31st, 2008 at 12:26 am

Posted in Gentoo, Linux, T61p

Remapping Capslock

with 2 comments

Despite its uselessness Capslock takes up some pretty prime realestate on the keyboard. Control, on the other hand, though extremely useful, languishes in the corners. To help fight this injustice I remap Capslock to Control.

For the console on Gentoo I put the following in /usr/share/keymap/i386/include/nocaps.map (I also gzip the file but you don’t have to):

keycode 58 = Control

and add the following to /etc/conf.d/keymaps:

EXTENDED_KEYMAPS="nocaps"

For X I add the following to my ~/.Xmodmap (which I load using xmodmap in my .xinitrc):

remove Lock = Caps_Lock
remove Control = Control_L
keysym Caps_Lock = Control_L
add Control = Control_L

On Windows I use SysInternals excellent Ctrl2cap utility.

Written by djwhitt

July 18th, 2008 at 6:46 pm

Posted in Gentoo, Linux, Windows

CPU Frequency Scaling

without comments

I just setup CPU frequency scaling in Gentoo on my Thinkpad T61p (Intel Core 2 Duo). These are the steps I followed:

  1. Enable relevant kernel modules/options:
    #
    # CPU Frequency scaling
    #
    CONFIG_CPU_FREQ=y
    CONFIG_CPU_FREQ_TABLE=m
    CONFIG_CPU_FREQ_DEBUG=y
    CONFIG_CPU_FREQ_STAT=m
    # CONFIG_CPU_FREQ_STAT_DETAILS is not set
    CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
    # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
    # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
    # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
    CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
    CONFIG_CPU_FREQ_GOV_POWERSAVE=m
    CONFIG_CPU_FREQ_GOV_USERSPACE=m
    CONFIG_CPU_FREQ_GOV_ONDEMAND=m
    CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

    #
    # CPUFreq processor drivers
    #
    CONFIG_X86_ACPI_CPUFREQ=m
    # CONFIG_X86_POWERNOW_K8 is not set
    # CONFIG_X86_SPEEDSTEP_CENTRINO is not set
    # CONFIG_X86_P4_CLOCKMOD is not set

    Screenshot linux kernel CPU frequency scaling menuconfig on my T61p

  2. Add the appropriate modules to /etc/modules.autoload.d/kernel-2.6 so that they are loaded at boot time:
    # cpu frequency scaling
    acpi-cpufreq
    cpufreq_ondemand
  3. Install cpufrequtils:
    emerge cpufrequtils
  4. Set CPU frequency governor in /etc/conf.d/cpufrequtils:
    # /etc/conf.d/cpufrequtils: config file for /etc/init.d/cpufrequtils
    # Which governor to use. Must be one of the governors listed in:
    # cat /sys/devices/system/cpu/cpu?/cpufreq/scaling_available_governors
    #
    GOVERNOR="ondemand"
  5. Add cpufrequtils to boot runlevel:
    rc-update add cpufrequtils boot
  6. Reboot (or start the stuff by hand) and enjoy a more efficient system.

Written by djwhitt

June 3rd, 2008 at 11:44 pm

Posted in Gentoo, Linux, Meta, Ruby, T61p