Showing posts with label Toshiba Satellite L305. Show all posts
Showing posts with label Toshiba Satellite L305. Show all posts

Wednesday, May 6, 2009

Ubuntu 9.04 on the Toshiba Satellite L305

Previously I had written about installing Ubuntu 8.10 on the Toshiba Satellite L305. It was not without its problems, the hardware on Toshiba systems can be pretty picky. The omnibook module got the fan and brightness keys working, but on some systems, this also caused the laptop to turn itself on three to fifteen minutes after being shut down. The good news for those who had this problem is that in 9.04, the fan problem is easily fixable without the module, and with a few workarounds, the brightness keys work too. Furthermore, wireless now works out of the box with the ath5k module, so madwifi or ndiswrapper are no longer necessary.

If you are already running the omnibook module without this problem, I recommend using that instead, as it is a simpler fix.

Step 1: Install and get the fan going

Download and install Ubuntu 9.04. In my experience, the DVD drive in the L305 can be a little picky, so I recommend either installing from a usb stick or burning the Ubuntu CD at a slower speed. The installation should go smoothly. When it boots to your new Ubuntu desktop, you first need to get the fan going.

This is a pretty easy fix, all you need to do is modify your grub file. Open up a terminal and type:

sudo gedit /boot/grub/menu.lst

*note: You can use nano, vi, kate, or whatever your preferred text editor is.

Add 'acpi_osi="Linux"' to your kernel's boot parameters. This is an example of my menu.lst file, with the part you need to add in bold (the rest may differ slightly in your file):


title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid a91f7379-e93b-490c-b541-0681173bccc2
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=a91f.. ro quiet splash acpi_osi="Linux"
initrd /boot/initrd.img-2.6.28-11-generic
quiet


Reboot and your fan should work fine. In my experience, it turns on at about 50 degrees and turns back off at about 35. Your brightness keys might be usable now, too. In my experience, though, these keys stop working after a few reboots. (If your keys continue to work, you can skip the brightness keys workaround section).

Optional: monitor your temperatures with lm-sensors
I wanted to make sure that the fan was working appropriately, so I wanted to monitor the computer's temperature. This is easy to do by installing the lm-sensors package. After you set up the sensors, you can either run the sensors package to display temperatures, or install the sensors-applet package to monitor them from the desktop:

sudo apt-get install lm-sensors sensors-applet
sudo sensors-detect

sensors-detect will set up the sensors. It will ask a lot of questions, the defaults should all be fine, though when asked if I want to add the modules to /etc/modules, I say yes. either reboot or manually add the modules it specifies manually. Add the sensors applet to the panel and you should be able to monitor your temperatures.

Step 2: Get the brightness keys working
For some reason, after a couple of reboots, the function keys no longer work for me. It seems the function key (fn) doesn't get input. I've developed a workaround to make the super (Windows) key to work with F6 and F7 to change brightness levels.

First you need to modify the keyboard with xmodmap to allow the use of the super key, because by default it is set to a different use. Though it is supposedly changeable through Gnome, I have had no luck. It is actually quite easy to do manually though.

First open a console and run xev. Hit the windows key and look for the keycode output. On my computer, it is 147, though may be different (there are a few different models of L305s). Close out of xev and make (or modify) ~/.Xmodmap (note the dot and the capital X). Add the following lines to .Xmodmap:

keycode 147 = Super_L
add mod4 = Super_L

Save and close the file, then run xmodmap. The super key should now be mapped to "Super_L" (you can test this again in xev, if you like)

Next you need to bind super+F6 and super+F7 to the brightness keys. This is doable with xbindkeys, which is installable in the console, and you may also need the keytouch daemon: (sudo apt-get install xbindkeys keytouch). Xbindkeys will be mapped to run acpi keys with "acpi_fakekey", which should already be installed on your system. The keytouch daemon will install apci-related things that make acpi_fakekey work (I'm not exactly sure how, but in my experience, without the keytouch daemon, acpi_fakekey doesn't work)


You are also going to need to install the lineakd package to find out what the event keys are for your brightness keys. Lineakd comes with a program called evtest. Run it (as root) on the different events in /dev/input/ until you find the one with brightness event codes. Mine is in /dev/input/event5, though it may be different for you:

sudo apt-get install lineakd
sudo evtest /dev/input/event5

It lists for me that brightness down is 224 and brightness up is 225.

Next you need to modify the xbindkeys config file. This is easiest by installing the xbindkeys-config package, and run that. Here you can add various commands for different combinations of keypresses. Click “add.” Name the command whatever you like. Click on “get key” and press your key combination. For the action type in “acpi_fakekey [keycode]”, where [keycode] is the event code you found with evtest. For example, for my brightness down key I put acpi_fakekey 224. You can also use this for other commands, too.

Save the file and close xbindkeys-config. Here, I like to move the config file from its default location (~/.xbindkeysrc) to its own folder in /etc, because the commands should be system wide, and also for security (the commands it will be running will be running as root). I copied it to /etc/xbindkeys/xbindkeysrc


Now it's time to test it. run xbindkeys as root with "sudo xbindkeys -f [location of xbindkeysrc file]" . Press super+F6 and super+F7 to make sure they adjust the brightness as they should. If everything is set up right, your brightness should be changing now!

Step 3: Get xbindkeys to run at boot:
As long as the keys are working, the only thing left to do is to make xbindkeys run on boot. The following is the only way I've been able to find to get that to work (init scripts make it run too early and it segfaults). Many thanks to Ubuntu Forums user BslBryan for this tip!

First, modify the sudoers file with the command "sudo visudo" Add the following to the end of the file:

[your username(s)] ALL= NOPASSWD: /usr/bin/xbindkeys

This makes xbindkeys able to be run as root without a password. It's important for the next step. Next go to System -> Preferences -> Startup Applications. Click on add. Name it xbindkeys. For the command, type "sudo /usr/bin/xbindkeys" (without the quotes). Sudo won't ask for a password now because we edited the sudoers file earlier with visudo. Type a description if you like and click add, then close out of startup applications.

Now reboot. If all went well, when you reboot super+F6 and super+F7 should adjust the brightness. Along with the easy fix for the fan, this makes Ubuntu 9.04 much more usable on newer Toshiba laptops.

Monday, November 17, 2008

Ubuntu on the Toshiba Satellite L305: Howto

EDIT: If you are having the problem with the omnibook module starting up your computer after shutdown, install the latest version of Ubuntu (9.04) and follow the directions in my newer post here.

I decided to upgrade from Ubuntu 8.10 32-bit to the 64-bit version on my Toshiba Satellite L305. While going with the 64-bit version came with its own set of difficulties, the need to reinstall made me realize one important thing about installing 8.10 (rather than the beta I did before) on this laptop: it no longer comes with the kernel modules needed to run the fan or the brightness buttons.

This is extremely important because if the fan doesn't work, the processor will overheat.

The problem stems from the fact that without the module, the fan will not change speeds as the computer heats up. When the computer first boots, the fan does not turn on immediately, causing the fan to never turn on. If you run the computer for a while and reboot, you will notice the fan running at full speed nonstop.

The following is a guide to installing what is needed to get your Ubuntu install running as it should on the Satellite L305.
Step 1: Download and install.

Download and install your desired flavor of Ubuntu (Ubuntu/Kubuntu/Xubuntu) in the 32 bit or 64 bit version (the 64 bit version takes a bit of work to get set up, so only use the 64 bit version if you are prepared for a little work,) EDIT: After beating my head against it for quite a while I would suggest against installing the 64 bit version. I ended up going back to the 32 bit version. If you have installed Ubuntu before you know the drill, if not, follow the prompts the installation gives you. And though it is less pretty, I recommend the alternate (non-graphical) install, because I have had less luck with the live cd install.

Step 2: Install omnibook module.

Older Toshiba laptops use their own proprietary bios that required the toshiba_acpi module to be compiled with the kernel. Toshiba now uses the Phoenix bios, which means that this has to be done another way, which is a bit deceptive. You have to download the omnibook module (Omnibook is actually an HP model laptop) which will allow these functions. You can download the module source package here: http://packages.kirya.net/debian/pool/main/o/omnibook/omnibook-source_2.20070211+svn20071217-1_all.deb Edit: The omnibook-source package has been updated, which broke the link. Updated versions of the omnibook-source can be found at http://packages.kirya.net/debian/pool/main/o/omnibook/
Install the source, extract it, install dependencies, and install the module in the terminal:

sudo dpkg -i omnibook-source_2.20070211+svn20071217-1_all.deb
cd /usr/src
tar -xvf omnibook-source_2.20070211+svn20071217-1_all.tar.bz2
cd modules/omnibook
sudo apt-get install build-essential linux-headers-`uname -r`
sudo make install


The install may say it lacks a few other dependencies which can be installed with apt-get. Once the source is installed, the module should be able to be loaded, however it needs a special argument when it is loaded or else it won't work.

sudo depmod -a
sudo modprobe omnibook ectype=11


If everything was set up correctly, you will most likely hear your fan kick on and the screen brightness change. You can now change the brightness with the function keys, and the fan will start up when you turn on the laptop. Make sure the module loads when you boot by adding "omnibook ectype=11" to the bottom of your /etc/modules file.

Step 3: Wireless
If you have the Atheros wireless card (I am not sure what other options the L305 can have) you can go about wireless two ways, madwifi drivers or ndiswrapper. Ndiswrapper is the required method if you go with 64 bit, so that is the method I went with, though I would recommend either madwifi for the 32 bit install. Install ndiswrapper:
sudo apt-get install ndiswrapper-common ndiswrapper-utils-1.9 ndisgtk


Ndiswrapper is a wrapper application for windows networking drivers so that they can be used on Linux. This means that for it to work, you need to also get the windows drivers. The 64 bit drivers can be found at http://blakecmartin.googlepages.com/ar5007eg-64-0.2.tar.gz, or the 32 bit version can be found at http://blakecmartin.googlepages.com/ar5007eg-32-0.2.tar.gz. Unzip the files from the file and start ndisgtk from the terminal (open the terminal and type "sudo ndisgtk"). Click on "install new driver" and navigate to the folder where you unzipped the drivers. Select the file ending in .inf and then install it. Make sure ndiswrapper is loaded:

sudo modprobe ndiswrapper


You should also blacklist the module that tries to load for the wireless drivers by adding the following to /etc/modprobe.d/blacklst

blacklist ath_pci


You should now have wireless internet access. One caveat is that for reasons that are unknown to me, the module has trouble connecting sometimes on boot. If it keeps saying it is getting disconnected, or if it keeps asking for the passphrase when you know it is right, you need to remove and reload the module:

sudo rmmod ndiswrapper
sudo modprobe ndiswrapper


This should cause the wireless device to play nice and allow you to connect. For now, it is the best solution I have as I have yet to find a permanent fix.

Sunday, October 26, 2008

Ubuntu on Toshiba Satellite L305

I've noticed a sudden increase in traffic to my little blog, most of which is coming from Google searches pertaining to the topic of installing Ubuntu on the Toshiba L305 (somehow it seems that my post about installing DEBIAN on the laptop found its way to the top of Google's search.) But, Google searchers, you happen to be in luck, for after my failure to install (an adequate version of) Debian on my L305, I decided to go back to Ubuntu on my laptop.

If you are installing Ubuntu 8.04 (Hardy Heron) the system will hang in a few spots but eventually show a bright red screen saying that it can't detect any network devices. This as it turns out is the exact problem I had trying to install Debian. The reason this happens is that the network devices in the L305 were unsupported at the time of Hardy's release. This will cause the installer to pretty much refuse doing the rest of the install in my experience.

The good news is that these drivers will be fully supported in the upcoming release 8.10, Intrepid Ibex. The even better news is that as of this writing, Intrepid is a mere four days away from launch. (Intrepid will be released on October 30th.) If you absolutely cannot live with Windows Vista for four more days, and are willing to try Intrepid before it is fully finished, you can download the latest release candidate off of the Ubuntu website. I have been using the release candidate for the past week and a half and have had no major problems, but do be prepared for a less-than-perfect install (I have had my fair share of minor problems). If you are still a little new to the Linux world, I'd suggest waiting out the four days and downloading the finished product. If you are wanting to download Hardy for the fact that it is the Long-Term Support (LTS) release, then I don't really know what to tell you.

The other good news is that having used Ubuntu 8.10 for the last week and a half, I can tell you that it is yet another good release by the Ubuntu team.

Thursday, October 16, 2008

Debian Lenny on Toshbia Satellite L305, or A comedy of errors

I got a new laptop a few days ago, the Toshiba Satellite L305. It's pretty cool. My first goal with it was to split the default Vista partition in half and dual boot Vista/Debian. Dual booting if only so I can run Photoshop and the like on the Vista side. Plus, I suppose it wouldn't hurt to actually dive in and see what all the anti-Vista stuff is about.

Step one: Repartitioning
Vista claims it is easy to shrink a partition. No, it is not. The shrink partition dialog kept insisting that only 7GBs could be pulled out of the partition. There were a bunch of steps I found online that required disabling system restore, page file, etc. etc. but even after all that I could only get 7GBs out of it. The solution was to use the Gparted Live CD. I ended up having to download a new version because the old (and it wasn't even THAT old) version couldn't load the hard drive. I shrunk the partition in half, and formatted a few ext3 partitions and a swap for my impending Debian install. After shrinking the partition I ran the Vista recovery CD to regenerate the Master Boot Record. This is *required* to boot back into Vista (at least before installing grub.) I did this anyways in case I couldn't successfully install Debian, and also just to make sure the grub installation found Vista.

Step Two: Getting the right Debian installer
I happened to have a CD of Debian Lenny beta 2 from my desktop's install, so I threw it in and went to install. The problem was that the installer couldn't detect some of the hardware. After a lot of research, I discovered that the hardware in specific was my network adapters. I tried downloading a weekly build CD overnight and that could not detect the hardware either. Turns out the solution was to boot the net installer from a USB drive. The instructions came from a wiki entry on how to install Debian to an Acer Aspire One, as it has the same two network interfaces as the L305.

First download the boot.img.gz and the daily build of the netinst.iso.

Insert the USB drive (with at least 256MB) and find it in /dev. Make sure this is the right device, or you might lose information on your other drives. Mine, for example, was /dev/sdc. Make sure any files are backed up, as this will erase anything on the drive. As root, run the command
zcat /path/to/boot.img.gz > /dev/sdc
Then mount the flash drive and load the netinst.iso onto the drive.

Step Three: Install Debian
With the bootable USB drive, I was finally able to install Debian. Put the USB drive in, turn the computer on and press F12, which will then display different devices to boot from. Pick USB Memory, and the Debian installer should boot. Though the network devices will be found, they may not be usable unless you install with acpi turned off. I forget the exact way to do it, but the help, boot options menu gives an example that happens to exactly what we need (I think it is "acpi-off", though the Aspire One page says different.) The Debian install will now commence flawlessly. You should have a wired connection during this isntall, because the WiFi won't work right away, and since it is the net installer, a functioning network is extremely important.

Conclusion
The downside to my (eventual) Debian install is that perhaps through problems with install (perhaps turning off acpi during install?) or perhaps with problems with me, I can't access any of the power fucntions a laptop really need (batery power, CPU scaling, etc.) So while I was successful eventually, all was perhaps for naught. If you successfully install these thigns on the Toshiba Satellite L305 let me know, but for now I'm going to try out Ubuntu (8.10 beta) to see if it configures anything better for me.