Archive for November, 2005

Gentoo on Toshiba Satellite Pro L10

Wednesday, November 9th, 2005

This is a work in progress. It’s my latest tinkering assignment. I liked Gentoo whilst it was running on my test system so have decided to stick it onto my laptop as well. It’s not as if the Tosh Pro L10 is an old laptop, far from it. It’s very, very nippy, especially with a stage 1 Gentoo install carried out to ensure everything is optimised. Whenever you see people bragging about how wonderful they are because they managed a stage 1 install, it makes me laugh. So does this. There really isn’t anything special about it in my opinion in terms of technical competence and so how wonderful you must be for completing it. But, will let them bask in their own smugness.

So, these are the specs of the laptop:

  • Processor: Intel Celeron M 1.5Ghz
  • RAM: 512Mb DDR
  • Hard Drive: 60Gb 4,200
  • Optical drive: DVD-RW
  • Graphics: Intel 855GME 64Mb
  • Sound: Intel 82801DB AC’97 audio controller
  • Wireless Intel PRO/Wireless IPN 2200 802.11b/g
  • Network: Realtek 8139C 10/100
  • Modem: Intel 82801 Scopio AC’97 soft modem

And now, onto actually getting things running. Rather than copy chunks from other sites, I’ll add in notes as to what resources on the web work and what don’t. As always with stuff like this, you can read 5 different articles that all say 5 different things and often none will work. Things like the wireless setup, ACPI configuration, and sound system can be a pain, but I’ll include links to articles I’ve used to get things running.

Base Gentoo Install
Whilst people brag about a Gentoo install, it’s not really anything special and not beyond the grasp of anyone with even basic Linux knowledge. Since the Gentoo documentation is so good, there isn’t much more to say about. I used the Gentoo Handbook rather than the 2005.1 edition as it seemed a little more comprehensive. Maybe not.

Providing you follow things through step by step you’ll be find. The only downside is lack of wireless networking during the install. I never really tried, but since you have to load up the ndiswrapper modules and Windows driver, it’s easier to use the spiffy Realtek wired network, especially if you can sit on a big fat Internet pipe like we’ve got at work…

Wireless Networking
So, assuming you’ve got your Gentoo system installed, first thing I did was get the networking going. Is very straightforward. Simply grab the latest ndiswrapper release and follow the instructions outlined in the ndiswrapper installation wiki. If you need the driver .inf file, get it here. Making sure you have the correct driver was the most difficult part. nsidwrapper installation is fairly straightforward, but do make sure you test the installed driver to ensure the hardware is detected correctly.

With regards to configuring the wep settings, essid, access point, etc., this will vary depending on your setup. The ndiswrapper installation wiki is very good at guiding you through step by step, but you probably want this scripted. Reading through Gentoo Wireless Configuration + Startup should help with scripting your configuration automatically, or look under the odds + sods section for my scripts.

One thing I did find weird was that when defining your default gateway, if you specified the netmask as follows:

route add default gw 192.168.1.1 netmask 255.255.255.0

then the card would connect with your access point, ping it and any local machines, but not external machines. Leaving off the netmask so it becomes:

route add default gw 192.168.1.1

allowed the connection to work fine. My wired network requires the netmask, my desktop machine connecting into the same access point requires a netmask, but maybe it’s this driver, it doesn’t. Maybe that will help – took a good 5-10 minutes of head scratching with that problem.

Installing + Configuring x.org
By default, your spiffy Gentoo system probably doesn’t look too sweet on the eye. If you’re using this as server it’s not a problem as you don’t want a dirty X-server installed. For our laptop, we do. Gentoo makes it painfully easy to install x.org, there X-server of choice, as detailed in the Gentoo X Server Configuration HOWTO. At the moment, I haven’t quite got my head around lack of tty0, tty1, etc. with X running, but I haven’t really looked to be honest.

The only couple of changes to be made were within the x.org config file to make sure we grabbed our mouse correctly. The basic touchpad can be used without the synaptics settings put in, but make sure you’re using /dev/input/mouse0, not /dev/mice or /dev/mouse, both of which I’ve seen x.org fail to connect to.

Also, I’ll include a login manager here, as although they detail it under configuring your window manager, it’s a generic step in my opinion. I’ve always prefered gdm, though kdm can be used if you wish:

emerge gdm
rc-update add xdm default

Fluxbox
Admitedly, on this kind of laptop you could run pretty much any window manager as you’re not going to be struggling for resources. However, one of the reasons I run Linux is it’s speed and power. Along with Fluxbox, I have a few other light-weight apps running for which more feature-rich but slower alternatives exist, such as rox and nedit.

Installing Fluxbox is easy, as with anything in Gentoo. Let Portage do the work for you. Full instructions can be found in the Fluxbox Configuration HOWTO along with info on installing a desktop monitor, icons (urgh), file browser, etc. I’m a gKrellM man myself, which is simply installed with:

emerge gkrellm

That was hard, wasn’t it?

ACPI stuff
Getting ACPI working is important on a laptop, not just from the point of view of not allowing the processor to get hot enough to cook eggs, but also for the power management features allowing you to monitor battery life. Very important on a laptop. Unfortunately, as the L10 is fairly new, Linux support isn’t too hot. Toshiba, pulling the usual trick of hardware manufacturers, seem to have completely ignored the rulebook for maintaining standards which makes it harder.

There is *some* light at the end of the tunnel which isn’t being caused by an oncoming train. You can get battery + thermal monitoring working, but that’s about it. Hot keys should be fairly easy, but I never use them anyways as there’s only the basic media buttons on the L10. Adjusting the screen brightness doesn’t work, but you can still do this manually through the function keys. Also, CPU throttling isn’t provided with the Celeron M, which means unfortunately (depending on whether you find not having to configure this beast a bad thing…) can’t be done.

But, monitoring battery life is critical for a laptop I think. If you’re always running it off the mains, then you’re kinda defying the point of a mobile computer. gKrellM without a battery monitor just isn’t right in my opinion. The Gentoo Power Management HOWTO is your main document for guiding you through things. I did setup the extra runlevel to switch between running on batteries and on mains, as I set it to turn off uneeded services and play with the syslogging levels. I’ve never tried hibernating or sleep states, but there’s nothing special stopping it from working on the L10. Let me know if you try it.

In order to get the ACPI functions to allow battery monitoring, the Smart Battery Systems and iasl compiler needing installing in order to patch the ACPI dsdt components. Full instructions can be found here, which also gives a little more of an overview on running Gentoo on the L10. The only problem I had was specifying the custom .hex file whilst re-compiling the kernel. In order the provide the file, you need to hit ‘Enter’ on the menu option:

-> Power management options (ACPI, APM)
-> Power Management support (PM [=y])
-> ACPI (Advanced Configuration and Power Interface) Support
-> [x] ACPI_AC
-> [x] ACPI_BATTERY
.
.
-> [x] Include custom dsdt
(/usr/src/linux/dsdt.hex) < --- Hit 'Enter' and type this in

otherwise it doesn't do anything. After
re-compiling the kernel, battery status can now be monitored. Definately people way smarter than me were able to figure out the dsdt patch, and I salute them. I wouldn't have the patience even if I had the technical know-how.

Odds & Sods
Configuring the rest of the system is up to you. Install whatever apps, themes, desklets, etc. you want. Extra hardware such as the sound card is straight-foward. Simply emerge alsa-utils then run alsaconf as detailed in the Gentoo ALSA HOWTO and it should work fine. If you run gKrellM as I do and you want to use extra plugins not available in the Portage tree, you might want to read this quick HOWTO on manually installing gKrellM plugins. Otherwise, the other stuff I've quickly written about general howto's and guides might be useful, available here.

A few other bits though - here's my wireless script. Updated 24.11.05 with menu script - I now use the following script to move between wireless networks. This simply brings up a menu system, allowing you to select which network to connect to. If you did some tweaking with iwlist, you could get it scanning for an AP, search the script for the relevant section, then activate the required settings, but that's too overkill for me!

#!/bin/bash

# Wireless network connection script
# Displays easy menu allowing the seletion of prefered network

# 22.11.05 - fouldsy.com

# Change the settings for your own network. This assumes you're using
# static IP addressing and connecting it with encryption enabled.

clear
echo "Please select which wireless you would like to connect to:"
echo " "
echo "1. School wireless network (GCS-WAP-003)"
echo "2. School wireless network (GCS-WAP-004)"
echo "3. Home wireless netork"
echo "4. None, exit this menu"
echo ""
echo "Your choice:"

read character

case $character in
1 ) echo "Connecting in to school wireless network (GCS-WAP-003)"

depmod -a
modprobe ndiswrapper

ifconfig eth0 down
ifconfig wlan0 down

iwconfig wlan0 essid "youressid"
iwconfig wlan0 key restricted [1] yourkey
ifconfig wlan0 youripaddress netmask yournetmask

route add default gw yourdefaultgw

# I also switch to different nameservers depending on the network
# Uncomment the following + adjust if you wish to do the same
# cp /etc/schoolresolv.conf /etc/resolv.conf

ifconfig wlan0 up
;;
2 ) echo "Connecting in to school wireless network (GCS-WAP-004)"

depmod -a
modprobe ndiswrapper

ifconfig eth0 down
ifconfig wlan0 down

iwconfig wlan0 essid "youressid"
iwconfig wlan0 key restricted [1] yourkey
ifconfig wlan0 youripaddress netmask yournetmask

route add default gw yourdeaultgw

# I also switch to different nameservers depending on the network
# Uncomment the following + adjust if you wish to do the same
# cp /etc/schoolresolv.conf /etc/resolv.conf

ifconfig wlan0 up

;;
3 ) echo "Connecting in to home wireless network"

depmod -a
modprobe ndiswrapper

ifconfig eth0 down
ifconfig wlan0 down

iwconfig wlan0 essid "youressid"
iwconfig wlan0 key restricted [1] yourkey
ifconfig wlan0 youripaddress netmask yournetmask

# I also switch to different nameservers depending on the network
# Uncomment the following + adjust if you wish to do the same
# cp /etc/homeresolv.conf /etc/resolv.conf

route add default gw yourdefaultgw

ifconfig wlan0 up
;;
4 ) echo "Okay, no wireless network required. Exiting..."
;;
* ) echo "Please select an option between 1 and 4 to choose a wireless network"
esac

The neti2220.inf file can be downloaded here to save scrambling round for one that doesn’t work.

My kernel config file can be downloaded here for those that are interested. If you’re running Gentoo, I’m assuming you’re comfortable enough with your own kernel compilations and choosing your own modules + features, but feel free to base your kernel off mine.

The End
If you have any comments, questions, suggestions, rantings, etc. please let me know. For those that are running into problems, please refer to the original documentation or the associated support forums and mailing lists. I’m often around on LinuxQuestions.org where a bunch of people can help, along with the excellent Gentoo Support Forums All the stuff I’ve found to get things going have been on those two sites, and, of course Google Linux. Read first, ask second!

Also, if you come across something new, such as updates to the Toshiba utilities allowing screen brightness, let me know. Or, of course, if something is completely wrong, shout at me a bit!

Sports sports sports sports sports!

Monday, November 7th, 2005

Along with getting all our hotels booked up for Christmas + New Year, I managed to convince Kat to get tickets for the ice hockey up in Winnipeg on New Year’s eve for Manitoba vs Toronto and basketball tickets down in Minneapolis to see the Timberwolves play the Dallas Mavericks. Down-side is I have to spend a day at the Mall of America and I’m not allowed to complain about it. A whole day!

So long as I get me some nachos, a giant hot dog and an air horn I suppose I can cope.

xorg – changing default keyboard language

Sunday, November 6th, 2005

Sometimes after an install the keyboard just ain’t right under X. It’s annoying. You can charge all sorts within your windowmanager, but it’s easiest to change the xorg.conf or XF86Config file depending on your X server. Simply change the XkbLayout to whatever language you require:

Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"

Option "XkbModel" "pc104"
Option "XkbLayout" "uk"
EndSection

Using a USB digital camera

Sunday, November 6th, 2005

This is a generic how-to and should work for pretty much any USB digital camera. Basically, we use the principal of it simply being a USB mass storage device, meaning we don’t need any drivers. People often wonder “Will my camera work under Linux?”. Of course it will. Plug it in under Windows and it will work out of the box – all those damn CD’s are just clunky apps to download your images and edit them. You don’t need them.

So, first up, let’s create a location to mount our camera. Feel free to change the location, however I like things like DVD drivers, cameras, USB pens, etc. to all be under /media:

mkdir /media/camera

Now, let’s plug our camera in and turn it on. Type in the following whilst you do this:

tail -f /var/log/messahes

What we should see flashing by is something similar to below.If not, you don’t have USB working which is a whole other kettle of fish:

Nov 6 15:42:03 homer kernel: Initializing USB Mass Storage driver...
Nov 6 15:42:03 homer kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Nov 6 15:42:03 homer kernel: Vendor: FUJIFILM Model: USB-DRIVEUNIT Rev: 1.00
Nov 6 15:42:03 homer kernel: Type: Direct-Access ANSI SCSI revision: 02
Nov 6 15:42:03 homer usb.agent[16240]: usb-storage: loaded successfully
Nov 6 15:42:03 homer kernel: usbcore: registered new driver usb-storage
Nov 6 15:42:03 homer kernel: USB Mass Storage support registered.
Nov 6 15:42:03 homer kernel: SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
Nov 6 15:42:03 homer kernel: sda: assuming Write Enabled
Nov 6 15:42:03 homer kernel: /dev/scsi/host2/bus0/target0/lun0: p1
Nov 6 15:42:03 homer scsi.agent[16305]: sd_mod: loaded sucessfully (for disk)
Nov 6 15:42:03 homer kernel: Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0

The key line here is [b]SCSI device sda[/b], which tells us which device to use. 9/10 this will /dev/sda1, but it may vary on your system. So, alter the following line depending on what device you have assigned:

mount /dev/sda1 /media/camera

With a bit of luck, it should drop you back to your prompt. If the system complains about filetypes, try mounting it as root to start off with as you’re likely to having permission issues as a normal user mounting external devices. Once sorted, head over to /media/camera and you should find all your photos listed. Happy days.

If you wish, you can edit /etc/fstab to set it so normal users can mount the device along with other parameters in case the camera is unplugged during writing, etc. View the man page for fstab for more info about auto mounting devices and other useful goodies. My entry looks like this:

/dev/sda1 /media/camera auto rw,user,noauto 0 0

Configuring Linksys ADM8211 802.11b Wireless Interface

Sunday, November 6th, 2005

I tell a lie, it’s actually a Belkin card, but under Linux that doesn’t matter – it’s the chipset that’s the key. Depending on your chipset, you will use a different driver. For this device, we can make use of ndiswrapper.

After downloading ndiswrapper, we need to install it. Quite a few distros include pre-compiled packages for ndiswrapper, however these can be slightly outdated. Compiling from source should be fairly painless and it’s worth using the most recent version. Once downloaded, we simply untar it, and then compile + install:

tar -xvzf ndiswrapper-version.tar.gz
cd ndiswrapper
make distclean

and then finish off as root:

make
make install

That should work providing you have wireless support built into your kernel. If your kernel was supplied with your distro, it should already be done. If you compiled your kernel yourself, you should be able to build wireless support in without problems. You need to go to Device Drivers | Networking Support | Wireless LAN (non-hamradio) and enable Wireless LAN drivers (non-hamradio) & Wireless Extensions.

So, with ndiswrapper installed, we now need to grab the drivers for our card. Do not use the drivers supplied with your CD. You are likely to experience problems, but feel free to ignore this suggestion and give it a go. The more sensible idea is to head to ndiswrapper supported drivers and download the appropriate driver that has been tried + tested under Linux. Once you have downloaded your driver, there’s only one file you need from it – the .inf file. Installing is easy:

ndiswrapper -i netadm11.inf

That should simply happily bring you back to the prompt with any error messages. Now, you want to test the driver to make sure it has worked and detected your card. If not, head back to the ndiswrapper driver listing and try a different driver

ndiswrapper -l

which should return something along the lines of:

Installed ndis drivers:
netadm11 driver present, hardware present

Only two more steps now – loading the ndiwrapper module and our driver:

depmod -a
modprove ndiswrapper

which should flash up a message confirming the module + driver are loaded. From here, you configure you network interface through whichever method you wish – either editing your interfaces file manually, through your hardware configuration tool, or with your control panel depending on your distro.

gKrellM – manually installing plugins

Sunday, November 6th, 2005

gKrellM appears on so many screenshots of Linux desktops it’s untrue. Why? Because it covers so many areas. On mine, it lets me view time, weather, CPU + RAM usage, system temperatures, mount devices, launch apps, adjust audio volumes, check new mails, ping my router periodically and countdown to special events.

Depending on your distro, you will find various plugins available as pre-compiled packages. Debian is very good at this, however there are some wicked plugins available from the gKrellM plugins page that aren’t packaged. Installing these manually doesn’t work. A couple of quick changes to the makefile file gets it all going though:

  • Untar your plugin and change into the newly created directory
  • Open makefile with your favourite editor
  • Look for a line detailing PLUGIN_DIR or similar. It varies depending on the author. Here’s an example:

    PLUGIN_DIR ?= /usr/local/lib/gkrellm2/plugins

  • Change the location to match your actual plugin directory, depending on your system:

    PLUGIN_DIR ?= /usr/lib/gkrellm/plugins

  • Save your changes and run make

That should be it, your plugin now knows exactly where the plugin directory is and will compile correctly. Within gKrellM, right-click, select Configuration then Plugins and enable + configure your newly compiled plugin

Fluxbox – using your own theme

Sunday, November 6th, 2005

Themes massively alter the way your desktop appears. Default Fluxbox themes are rather boring. Jazz it up a bit – your only limit is your imagination. Good places for themes include http://themes.freshme.at.net and http://www.boxwhore.org

Anyways, once you’ve downloaded a theme, it will usually be compressed. Uncompress it:

tar -xvzf name-of-your-theme.tar.gz

This should present you with a new folder. Within there, you will usually find two additional folders called backgrounds and styles. Simply copy the background image to ~/.fluxbox/backgrounds and your style file to ~/.fluxbox/styles

cp backgrounds/image.jpg ~/.fluxbox/backgrounds
cp styles/style ~/.fluxbox/styles

Now, you will probably need to edit the style with whichever image setting tool you have. For me, this is fbsetbg. Your root.command line is what defines the background image:

rootCommand: fbsetbg -f ~/.fluxbox/backgrounds/NVA-91.jpg

I can now right-click on my desktop, choose Styles from my Fluxbox menu, and select my new style. If you receive an error setting your background image, you will need to go back and adjust the image setting tool in your root.command line.

Fluxbox – loading apps on startup

Sunday, November 6th, 2005

There’s a few different ways of loading apps when starting Fluxbox – you could set them in ~/.fluxbox/startup, within your .xinitrc, or within ~/.fluxbox/apps. I prefer it in the apps file:

[startup] {gkrellm -w}
[startup] {gdesklets}

Just a brief heart-attack, nothing to worry about…

Saturday, November 5th, 2005

“Bro, there’s been a change to your flights at Christmas”

“buggerit”

Isn’t that bad, just knocking my flight out of Minneapolis up to Anchorage back 40 minutes or so. Guess this is a result of the NWA re-shuffling, so looking at the positive side, they’re not cancelling that service which means I’m safe up to Anchorage and since Amsterdam-Minneapolis is one of their core trans-Atlantic flight, am safe on that one too. Happy days.

Ah well, 46 days now…

Anyone sad to see him go?

Wednesday, November 2nd, 2005

Blunkett's school report card

Dr. Strange is yer man