Linux on the Toshiba U505-S2960

Author: Michael Minn (www.michaelminn.com)

January 31, 2010

Describes how to set up an Ubuntu 9.10 operating system on a Toshiba Satellite U505-S2960 notebook computer.

1. Introduction

This page describes how to install 64-bit Ubuntu v9.10 on a Toshiba U505-S2960 notebook computer. Although the initial install is fairly painless, some of the hardware in this machine is fairly new and is not supported by the drivers that come with 9.10. The wireless card is (as of this writing) not supported at all in the 64-bit environment and you may want to install the 32-bit version rather than the 64-bit version for this reason. Ubuntu 10 is scheduled for release in April 2010 and, hopefully, will fix some of these issues.

The U505 that I purchased in December of 2009 features:


2. Install From CD

The install from CD is fairly straightforward, except for partitioning. The following are my choices and you may need to make other choices depending on your situation.

This installation assumes that you will be building a system that can dual-boot into either Windoze or Linux. For systems that can run both simultaneously, you will need to explore virtualization software like VMWare.

Defrag: Prior to installing Linux, you should boot into Windoze at least once and defragment the drive. I'm not sure if this is still necessary to maximize available disk space, but it can't hurt.

Download and Burn: the current Ubuntu release CD image ISO from Ubuntu.com and burn it to a CD.

Boot from Install CD: Insert the boot CD into the CD-ROM drive and reboot. When the American Megatreds BIOS splash screen comes up press F-12 and choose CD/DVD P-1MATSHITADVD-RAM UJ862.

Initial Prompt: Choose the language of your choice and select install.

Welcome: choose language and click forward.

Where are you?: select time zone.

Keyboard layout: Default is USA.

Prepare disk space: This step defines how you will partition your hard disk. The easiest choice is, "Install them side-by-side, choosing between them each startup." However, if you know what you're doing, choosing "Specify partitions manually," will allow you to set up separate root and home partitions, making future OS upgrades a bit easier. My steps:

This left me with the following partition table, which includes three residual (and mysterious) NTFS partitions.

	/dev/sda1  ntfs             1572MB
	/dev/sda2  ntfs   /windows  100000MB
	/dev/sda5  ext2   /boot     1019MB
	/dev/sda6  swap             4096MB
	/dev/sda7  ext4   /         29997MB
	/dev/sda8  ext4   /home     171908MB
	/dev/sda3  ntfs             11472MB

Who are you?: These steps configure the name, password, and name of computer. Since you don't know how this info will be hacked, tou may not want to use real name. I named my computer localhost and require password for login.

Migrate documents and settings: Why?

Install: Kick it off and it takes around 20 minutes.

Reboot: Restart Ubuntu and you should be able to boot from the hard drive.

Update Your Package Repository: Once you get the machine on the internet, you should update your application package repository with a list of the latest security patches and repository updates. This may take a few minutes.

	sudo apt-get update

This particular combination of hardware and software release is a bit touchy, and some fairly important tweaks follow.


3. Fan Issues

The first thing you may notice about the machine is that the wrist rest gets really hot and the fan doesn't seem to be running. Apparently, there are issues with this particular BIOS and version of ACPI, which doesn't turn the fan on. There supposedly is a thermocouple that will force the fan on at a critical temperature, but you will not want to test that feature very often.

None of the fixes given in various forum threads ( 1, 2, 3, 4, 5, 6) seemed to work for me and it looks like this is something that will just have to wait for another release. The sensors-detect program finds the "EDID EEPROM" with a Intel Core family thermal sensor, but installing the suggested coretemp driver didn't do anything for me.

The nasty workaround is to simply suspend and reawaken the machine once it starts getting warm:

	sudo pm-suspend

The BIOS apparently feels the heat on reawakening and turns the fan on. It stays on, but that allows you to continue to stay cool. You can check the temperature with the "sensors" command, with the -f option giving readouts in Farenheit for Americans who haven't caught up with the rest of the planet.

	sensors -f

	acpitz-virtual-0
	Adapter: Virtual device
	temp1:      +109.4°F  (crit = +226.4°F)                  

	coretemp-isa-0000
	Adapter: ISA adapter
	Core 0:      +84.2°F  (high = +185.0°F, crit = +185.0°F)  

	coretemp-isa-0001
	Adapter: ISA adapter
	Core 1:      +84.2°F  (high = +185.0°F, crit = +185.0°F)  

4. Screen Brightness

Out of the box the screen brightness can be a bit overwhelming, especially in contrast to older, dimmer LCD displays. The backlight intensity can be changed with with xrandr and the contrast (gamma) adjustment can be tweaked with xgamma. I put the following in my .xinitrc file in my home directory to set the values when X starts.

	xgamma -gamma .7
	xrandr --output LVDS1 --set BACKLIGHT 5

You can use xrandr --verbose to view other configurable display options and the range of available values.


5. Sound

The version of the Advanced Linux Sound Architecture (ALSA v1.0.20) included in Ubuntu 9.10 does not support the Realtek ALC269 audio chip in this machine. Despite the numerous config file tweaks mentioned on the web, the only solution as of this writing seems to be to recompile and install from current source on the ALSA website.

Download: You will need the driver, lib, plugins and utils source packages from the ALSA website.

Dependencies: You will also need the following packages installed in order to compile. The xmlto package (for compiling man pages) is especailly large and may take awhile on lower speed connections.

	sudo apt-get install linux-headers-`uname -r`
	sudo apt-get install patch
	sudo apt-get install ncurses-dev
	sudo apt-get install xmlto
	sudo apt-get install gettext

Remove existing ALSA packages:

	sudo apt-get remove pulse-audio
	sudo apt-get remove alsa-utils
	sudo apt-get remove alsa-base

Decompress and Compile:

	bunzip2 alsa*.bz2
	tar -xvf alsa-driver*
	tar -xvf alsa-lib*
	tar -xvf alsa-plugins*
	tar -xvf alsa-util*

	cd alsa-lib*
	sudo make install
	cd ../alsa-driver*
	sudo make install
	cd ../alsa-plugins*
	sudo make install
	cd ../alsa-util*
	sudo make install

Add yourself to the audio group: Audio devices are created with ownership by the root but with the "audio" group. Adding the username you operate under to the audio group will allow your audio applications to access the ALSA devices.

	adduser <username> audio

Load the ALSA modules:

	sudo modprobe snd_pcm_oss
	sudo modprobe snd_pcm_mixer
	sudo modprobe snd_hda_codec
	sudo modprobe snd_hda_intel

Open Sound: The older Open Sound System (OSS) supports the Intel High Definition Audio (P35) system, although it does not provide support for /dev/mixer, limiting your flexibility with volume adjustments. However, it is a viable alternative to the Rube Goldber contraption that is ALSA. Instructions for installation are available on the Ubuntu website.


6. Wireless

Neither the Linux driver from Realtek or the XP driver under NDISWrapper work under this 64-bit Ubuntuu version as of this writing. If you need the wireless chip to work, you will want to install the 32-bit version of Ubuntu and install NDISWrapper to use the XP driver provided by the manufacturer.

The following is provided as information for others who are curious about cryptic error messages such as the ones I uncovered trying to find a working driver.

Use lspci to get information about the PCI devices, including the wireless networking chip:

	lspci -v

	03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device 8172 (rev 10)
        	Subsystem: Realtek Semiconductor Co., Ltd. Device 8152
	        Flags: bus master, fast devsel, latency 0, IRQ 5
        	I/O ports at c800 [size=256]
	        Memory at fdffc000 (32-bit, non-prefetchable) [size=16K]
        	Capabilities: [40] Power Management version 3
	        Capabilities: [50] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
        	Capabilities: [70] Express Legacy Endpoint, MSI 00
	        Capabilities: [100] Advanced Error Reporting <?>
        	Capabilities: [140] Virtual Channel <?>
	        Capabilities: [160] Device Serial Number 00-e0-4c-ff-fe-22-55-88

Realtek provides a Linux driver on their website that will comopile and install, although it locked up my system when I tried to use it. The source is available in the download section of their website. ( Communications Network ICs -> Wireless LAN ICs -> IEEE 802.11 b/g/n Single Chip -> Software).

Even though this chip is the RTL 8172, the driver for the RTL 8192se should be the one.

The kernel headers are needed for compilation.

	sudo apt-get install build-essential
	tar -zxvf RTL*
	cd RTL*
	make

If you try to do a "make install", the Makefile will try to recompile your kernel, which is something you may not want to do. If you do want to recompile your kernel, you will need to install the linux source, otherwise you will get this message:

	make install will fail with make[3]: *** No rule to make target `kernel/bounds.c', 
	needed by `kernel/bounds.s'.  Stop.

If you install the source package, the source code is left as a tarball that must be decompressed:

	sudo apt-get install linux-source
	cd /usr/src 
	sudo tar -jxvf linux-source*.bz2

After compilation, install the firmware file and kernel module:

	sudo cp -va firmware/RTL8192SE /lib/firmware
	cd HAL/rtl8192
	install -p -m 644 r8192se_pci.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/
	sudo modprobe r8192se_pci

Create a /etc/modprobe.d/rtl8192se.conf file and add an alias to load the module on demand:

	alias wlan0 r8192se_pci

If you have a specific access point that you regularly connect to, you can add lines to the /etc/network/interfaces file so ifup wlan0 connects

	iface wlan0 inet dhcp
		wireless-essid <add-essid-here>

Another common technique for wireless cards is the use of NDISWrapper with the native XP drivers. However, NDISWrapper doesn't work with 64-bit Linux, or Vista/Win7 drivers, making it impossible to use with 64-bit Ubuntu. The following should work for you if you have 32-bit Ubuntu.

There is an NDISWrapper package for Ubuntu:

	sudo apt-get instll ndiswrapper-common
	sudo apt-get instll ndiswrapper-utils-1.9

Download the XP drivers from the Realtek download section of the Realtek website. These must be the XP drivers, not the Vista/Win7 drivers. Make a directory for them, unpack the tarball and install them in NDISWrapper.

	sudo mkdir /usr/local/share/ndiswrapper
	sudo mv 8191_8192_SE_WindowsDriver* /usr/local/share/ndiswrapper
	cd /usr/local/share/ndiswrapper
	sudo unzip *.zip
	sudo ndiswrapper -i net8192se.inf"

If you use 32-bit drivers with 64-bit linux, dmesg will show NDISWrapper issueing the following error messge:

	[16314.599263] ndiswrapper version 1.55 loaded (smp=yes, preempt=no)
	[16314.609770] ndiswrapper (check_nt_hdr:150): kernel is 64-bit, but 
		Windows driver is not 64-bit;bad magic: 010B
	[16314.609776] ndiswrapper (load_sys_files:206): couldn't prepare driver 'net8192se'
	[16314.610249] ndiswrapper (load_wrap_driver:108): couldn't load driver net8192se; 
		check system log for messages from 'loadndisdriver'
	[16314.610374] usbcore: registered new interface driver ndiswrapper

If you use the 64-bit drivers from your /windows partion, you will get error messages in dmesg for unsupported function calls:

	[16391.327238] ndiswrapper version 1.55 loaded (smp=yes, preempt=no)
	[16391.350993] ndiswrapper (import:242): unknown symbol: ntoskrnl.exe:'IoWMIQueryAllData'
	[16391.351000] ndiswrapper (import:242): unknown symbol: ntoskrnl.exe:'IoWMIOpenBlock'
	[16391.351089] ndiswrapper (load_sys_files:206): couldn't prepare driver 'net8192se'
	[16391.351899] ndiswrapper (load_wrap_driver:108): couldn't load driver net8192se; 
		check system log for messages from 'loadndisdriver'
	[16391.352015] usbcore: registered new interface driver ndiswrapper

Even though the driver doesn't work, NDISWrapper will list it as installed:

	sudo ndiswrapper -l

	net8192se : driver installed
        	device (10EC:8172) present

The driver module is loaded with these commands:

	sudo ndiswrapper -m
	sudo modprobe ndiswrapper
	sudo /etc/init.d/networking restart
	iwconfig

Attempting to load a Vista/Win7 driver will cause messages like these in dmesg:

	[ 8355.181337] ndiswrapper version 1.55 loaded (smp=yes, preempt=no)
	[ 8355.198822] ndiswrapper (import:242): unknown symbol: ntoskrnl.exe:'PoUnregisterPowerSettingCallback'
	[ 8355.198835] ndiswrapper (import:242): unknown symbol: ntoskrnl.exe:'PoRegisterPowerSettingCallback'
	[ 8355.198852] ndiswrapper (import:242): unknown symbol: ntoskrnl.exe:'IoWMIOpenBlock'
	[ 8355.198860] ndiswrapper (import:242): unknown symbol: ntoskrnl.exe:'IoWMIQueryAllData'
	[ 8355.198875] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMIndicateReceiveNetBufferLists'
	[ 8355.198885] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisAllocateNetBufferAndNetBufferList'
	[ 8355.198895] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisAllocateMdl'
	[ 8355.198904] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMDeregisterScatterGatherDma'
	[ 8355.198913] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMFreeNetBufferSGList'
	[ 8355.198926] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisFreeNetBufferList'
	[ 8355.198935] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisFreeMdl'
	[ 8355.198945] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMSendNetBufferListsComplete'
	[ 8355.198958] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisAllocateMemoryWithTagPriority'
	[ 8355.198998] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMSetMiniportAttributes'
	[ 8355.199007] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisOpenConfigurationEx'
	[ 8355.199029] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMIndicateStatusEx'
	[ 8355.199038] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMOidRequestComplete'
	[ 8355.199062] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisAllocateIoWorkItem'
	[ 8355.199080] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisQueueIoWorkItem'
	[ 8355.199090] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMAllocateNetBufferSGList'
	[ 8355.199105] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMAllocatePort'
	[ 8355.199114] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMNetPnPEvent'
	[ 8355.199123] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMFreePort'
	[ 8355.199139] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMSetBusData'
	[ 8355.199148] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMRegisterMiniportDriver'
	[ 8355.199158] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMDeregisterInterruptEx'
	[ 8355.199171] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMGetBusData'
	[ 8355.199188] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMRegisterScatterGatherDma'
	[ 8355.199197] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMSynchronizeWithInterruptEx'
	[ 8355.199207] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMRegisterInterruptEx'
	[ 8355.199216] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisAllocateNetBufferListPool'
	[ 8355.199225] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisFreeNetBufferListPool'
	[ 8355.199235] ndiswrapper (import:242): unknown symbol: NDIS.SYS:'NdisMDeregisterMiniportDriver'
	[ 8355.199239] ndiswrapper (load_sys_files:206): couldn't prepare driver 'net8192se'
	[ 8355.199945] ndiswrapper (load_wrap_driver:108): couldn't load driver net8192se; 
		check system log for messages from 'loadndisdriver'
	[ 8355.200098] usbcore: registered new interface driver ndiswrapper

7. Removing the Splash Screen

I prefer to see what's going on with my machine rather than have the boot messages hidden behind the splash bitmap just in case there's a boot problem (which used to happen alot). Unlike RedHat, which provides a runlevel 3 text login, Debian distribution runlevels always start the GUI. So the process is a bit more complicated than changing /etc/inittab (which doesn't exist in Debian).

Ubuntu used GRUB 2. The old /boot/grub/menu.lst is replaced by a generated file with options specified in /etc/default/grub configuration file. The splash screen can be removed and text mode (non-graphical) booting can be enabled by editing that file and changing these lines:

	GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
	GRUB_HIDDEN_TIMEOUT=true

To...

	GRUB_CMDLINE_LINUX_DEFAULT="text"
	GRUB_HIDDEN_TIMEOUT=0

Then run

	sudo update-grub

After these changes, on boot you will see the system startup messages and then be greeted with a console login prompt. After logging in, you can use the startx command to start the graphical desktop.

	startx

8. Removing the Desktop

If you're hard core command line and don't want the clutter and delay of the Ubuntu desktop, you might consider getting rid of the desktop altogether and just using a window manager to manage xterms and X applications started from the xterms. This will speed your boot time a bit and get rid of some annoying background daemons. I've used the venerable Motif Window Manager (MWM) for a number of years. It comes in the motif-clients package. Do not use the alternative lesstif package, which lacks some features.

	sudo apt-get install motif-clients

.xinitrc is a file that is executed when X is started. Create a .xinitrc in your home directory (/home/<username>) and type the following lines. This creates a single terminal window, puts a clock window at the bottom of the screen, sets the "desktop" color to blue and starts the window manager. When you type "startx", from the text login, it will start an xterm, in which you type commands to start other programs. You can create additional terminal windows from a popup menu when you right-click on the desktop.

	xterm -geometry 128x24+10+10&
	xterm -geometry 128x24+10+375&
	xclock -d -update 1 -geometry 254x32+819+710&
	xsetroot -solid navy
	exec mwm

9. TrueType Fonts

The X window server supports TrueType (tm) fonts, although installing them via the command line is a bit more cumbersome than with an installer program or package. If you've got some on a Windoze box, TrueType fonts tend to look quite a bit better than the fonts that come with the distributions. And if you're doing any web development, you need them to have at least a guess as to what your pages look like on a Windoze box.

Unfortunately, the FontPath configuration that specifies the directories where fonts are located is compiled into the X binary and is not configurable. While "xset +fp" can add a directory to the font path, that setting is not permanent and is lost when you reboot. xset cannot be added to a local configuration file like .xinitrc. This is not a problem for newer applications that use fontconfig, but this may represent an issue for older applications that only use the X font paths. The kludge is to copy the fonts you want to add into one of the configured truetype font directories.

Copy the fonts into a shared font directory: You can do an "xset -q" to find the configured Font Paths for your X configuration:

	xset -q

Chose one of the directories listed in "Font Path" and copy your .ttf font files into that directory. In my case, I chose to use /usr/share/fonts/X11/misc. While you could create a new directory under /usr/share/fonts, fonts installed there would not be visible to xlsfonts or older X applications.

	sudo cp your-fonts/*.ttf /usr/share/fonts/X11/misc

Then run mkfontscale to create the fonts.scale file and mkfontdir to create the fonts.dir files used by the X server. You should also change the owner of all the files to root to avoid permission problems. The mkfontscale and mkfontdir steps are critical if you want to be able to list your fonts with xlsfonts or other legacy X applications.

	cd /usr/share/fonts/X11/misc
	sudo mkfontscale
	sudo mkfontdir
	sudo chown root:root *

You can check to verify the fonts are loading by starting an X application (like gimp). The xlsfonts command lists fonts available directly from X and the fc-list command lists fonts available through fontconfig.

	xlsfonts | less
	fc-list | less

The listing will likely be long, but if the fonts are loading correctly, you will see X font names like these (for Arial and Garamond, respectively):

	-monotype-arial-medium-i-normal--0-0-0-0-p-0-iso8859-1
	-monotype-arial-medium-i-normal--0-0-0-0-p-0-iso8859-10
	-monotype-arial-medium-i-normal--0-0-0-0-p-0-iso8859-15
	-monotype-arial-medium-i-normal--0-0-0-0-p-0-iso8859-2

	-monotype-garamond-medium-i-normal--0-0-0-0-p-0-iso8859-1
	-monotype-garamond-medium-i-normal--0-0-0-0-p-0-iso8859-10
	-monotype-garamond-medium-i-normal--0-0-0-0-p-0-iso8859-15
	-monotype-garamond-medium-i-normal--0-0-0-0-p-0-iso8859-2

Children are all gasoline and no brakes, and whether it's cigarettes, alcohol or junk food, we need advocates to tell society to stop giving children so much gasoline. (Carl Bell)