Polishing Your Linux Laptop Setup

 in
In the final installment of this Linux on the laptop series, learn how to go wireless, use ALSA and install ACPI.

In my past laptop oriented articles, I talked about procedures for installing a base Linux system and setting up GNOME 2.2. This time around, I discuss a few odds and ends that did not quite fit those other two articles but definitely deserve further attention.

Wire No More

Wireless networking is an integral advantage to laptop computing. In my situation, I never would have gotten involved with Linux on laptops if wireless networking had not become available. There's nothing quite like browsing the Web from your favorite chair with a cold beverage nearby, the way all computing should be done. For this example, I'm going to set up a Lucent Orinoco 802.11b PCMCIA card. There are many new and old standards in the wireless world, but from what I have seen 802.11b is by far the most popular. Also, you may find it necessary to implement different layers of security if you live in a populated area. Plenty of articles already are written that discuss the complicated world of WiFi security, so I'm not going to dabble in that arena. If you'd like to learn more about WiFi security, check out the Resources at the end of this article, and your questions will be answered.

As with most network device installs, the first thing you need to do is make sure the kernel module or modules are installed for the hardware in question. In the case of the Orinoco, you should have set the following options in your kernel configuration under Network device support. If you have not set these options, you now need to recompile and reinstall the kernel.

  • Selected - Wireless LAN (non-hamradio)

  • Module - Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)

  • Module - Hermes PCMCIA card support

In my case, I also had to enable ISA Bus support for the 16 bit PCMCIA card. This is done under General setup, and the option is [*] ISA bus support. As far as I can tell, this option is new to the 2.4.20 kernel. After reading through many newsgroups and Web searches, it looks like a lot of people have problems with Orinoco cards after upgrading to the 2.4.20 kernel. So make sure that you enable ISA Bus support.

With the kernel modifications complete, the next task is to install the Debian packages needed to access a PCMCIA card. A quick apt-get install wireless-tools and apt-get install pcmcia-cs should grab everything you require. All of the configuration files for PCMCIA can be found in the /etc/pcmcia directory. The three files that need to be manipulated are config, network.opts and wireless.opts.

Let's start by editing the config file. Scroll down to the device orinoco_cs section, and make sure it looks like the following. If any other lines are present in the device "orinoco_cs" section, comment them out.

device "orinoco_cs"
  class "network" module "hermes", "orinoco", "orinoco_cs"

Next, open up network.opts and alter the TCP/IP values beneath the line # Host's IP address, netmask, network address, broadcast address. These values are the same as if you were configuring a traditional TCP/IP network card. Some may be left null or filled in as needed. As an example, here are the values I used to configure to my local LAN:

IPADDR="192.168.1.4"
NETWORK="192.168.1.0"
BROADCAST="192.168.1.255"
GATEWAY="192.168.1.1"
DNS_1="192.168.9.47"
DNS_2="192.168.9.48"

Then, open wireless.opts, which contains many options specific to the wireless connection. To simplify my example, I am not going to use any security options. This is not recommended if you live in an urban area, but if you're out in the boonies, I don't think there is anything wrong with letting the local raccoon population get some free Internet access. The only things that need to be changed are two ESSID settings. One of them is under the section commented by Lucent Wavelan IEEE and the other is under Generic example. Under both of these sections, change the ESSID value to any, so it looks like ESSID="any".

If you haven't rebooted yet, now would be a good time to do so, to make sure the PCMCIA services are brought up correctly. During boot you should see something like the following output. If the boot messages scroll too fast, you can check in /var/log/syslog.

cardmgr[260]: watching 1 sockets
cardmgr[261]: starting, version is 3.2.2

Once the machine is booted, use tail -f /var/log/syslog to watch the syslog and insert the Orinoco card. If things are set up correctly, you should see something in the log like the following:

cardmgr[279]: socket 0: Lucent Technologies WaveLAN/IEEE Adapter
kernel: cs: memory probe 0xa0000000-0xa0ffffff: clean.
cardmgr[279]: executing: 'modprobe hermes'
kernel: hermes.c: 5 Apr 2002 David Gibson <hermes@gibson.dropbear.id.au>
cardmgr[279]: executing: 'modprobe orinoco'
kernel: orinoco.c 0.11b (David Gibson <hermes@gibson.dropbear.id.au> and others)
cardmgr[279]: executing: 'modprobe orinoco_cs'
kernel: orinoco_cs.c 0.11b (David Gibson <hermes@gibson.dropbear.id.au> and others)
kernel: eth1: Station identity 001f:0001:0008:0048
kernel: eth1: Looks like a Lucent/Agere firmware version 8.72
kernel: eth1: Ad-hoc demo mode supported
kernel: eth1: IEEE standard IBSS ad-hoc mode supported
kernel: eth1: WEP supported, 104-bit key
kernel: eth1: MAC address 00:02:2D:3A:35:08
kernel: eth1: Station name "HERMES I"
kernel: eth1: ready
kernel: eth1: index 0x01: Vcc 5.0, irq 3, io 0x0100-0x013f
cardmgr[279]: executing: './network start eth1'

When you remove the card you should see

cardmgr[279]: executing: './network stop eth1'
cardmgr[279]: executing: 'modprobe -r orinoco_cs'
cardmgr[279]: executing: 'modprobe -r orinoco'
cardmgr[279]: executing: 'modprobe -r hermes'

At this point you should have a fully functional wireless laptop. The Orinoco card can be removed and inserted as required without a need to reboot or to configure any further. If you have problems, one useful command for troubleshooting PCMCIA issues is cardctl. Using cardctl, you can verify that your card is what you think it is. You also can gather information on the state of the PC card slot in your laptop.

Here's one little trick I'm using. In my case I use my laptop at two primary locations, work and home. When I'm home I use the WiFi card and when I'm at work I use the integrated NIC. At work I have no issues, because I keep the WiFi unplugged so the device is never brought up. But at home, I had a problem: when I used WiFi I had to manually down the integrated NIC, because some applications did not like eth0 being up but not connected to anything. It was not a major issue, but it got to be an annoyance to have to manually ifconfig down eth0 every time I booted the laptop at home. What I did to correct this problem was add the following line to the end of /etc/pcmcia/wireless:

ifconfig eth0 down

This script is executed only when the wireless device is brought up, so it works perfectly. Whenever I insert the Orinoco card, the integrated NIC is disabled.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Correct way to compile kernel...

Anonymous's picture

... is in your home development subdirectory, logged in as a normal user. It is ONLY when you install the kernel and modules that you need to be root.
There are some good reasons for doing it this way, outlined at http://www.linuxfocus.org/common/src/article240/erratum.html among other places. If you find the reasoning too esoteric, at least acknowledge that this is Linus Torvalds' recommendation. Also, the less you do as root, the less likely you are to have a bad computer day.

root access

damon's picture

However the interested reader may keep in mind that the wholesale demands of separate user level access is an idiosyncrasy of 20th century computing. In this case the article is trying to be simple, contrast technocratic edicts against usability.

Re: Polishing Your Linux Laptop Setup

Anonymous's picture

Regarding the issue with manually bringing the built-in NIC down, one might try ifplugd. Ifplugd is a daemon that detects whether there is a cable connected to the wired NIC or not, and brings up the interface when the cable is inserted, and brings it back down when the cable is removed.

On Debian testing, at least, one can simply do an "apt-get install ifplugd" to get the daemon installed, otherwise go to the web page for more information.

Title indicating this is Debian-specific?

Anonymous's picture

The article does not mention anywhere that it is Debian specific, we have to assume that from the use of apt and the names of the initscripts, and the fact that you actually had to patch your kernel for ACPI.

Maybe in future the author could at least point this out, and also indicate that on other distributions, a lot of these issues are not relevant (many distros default to ALSA on all supported cards and have working ACPI out-the-box if you choose to enable ACPI during installation).

Re: Title indicating this is Debian-specific?

Anonymous's picture

Regarding ACPI in other distros, they don't have better support for buggy ACPI-implementations than debian. This is a hardware/kernel issue, that applies equally well to any distribution.

Although many distributions ships with distributionspecific patches applied, I don't think they have a patch for every buggy ACPI implementation in a laptop out there. And there are _many_, check out the mailing lists on http://acpi.sf.net to see the magnitude of it.

The problem most often is not in the kernel but in buggy ACPI code in bios, as others have pointed out.

ibook/powerbook

Anonymous's picture

Just get a mac laptop. Much better hardware, much better linux support.

Re: ibook/powerbook

Anonymous's picture

Agreed to both and I did, once.

I had to sell & get an x86 only because s/w support sucks. Most commercial vendors port to only x86 linux, not PPC.

Re: Polishing Your Linux Laptop Setup

Anonymous's picture

This is what makes me stay away from Linux on my laptop. It's Compaq 17XL and all flavors of Win have had no problem. The latest RH or SuSE are powerless with ACPI. The author is quick to blame manufacturers, but if OS from '98 can handle it how come ones from 2003 based on Linux stumble - and it's not Compaq's fault.

Re: Polishing Your Linux Laptop Setup

Anonymous's picture

Prolly cause Microsucks convinced them to implement this into the bios so that it could "Again" get an advantage over any and all competition.
Microsoft designed ACPI to work with "Their" software.
And to say that "it's not Compaq's fault" is entirely FALSE. Each manufacturer was given a general guidline as to implementing ACPI into their bios' and "NONE" of them follow these guidlines. ACPI is far from being "standardized" and untill it is Linux users will continue to have to "deal with it".

Re: Polishing Your Linux Laptop Setup

Anonymous's picture

Yeah, the ACPI option is borked for my laptop running SUSE 8.1. However, it is VERY easy to disable acpi. My boot using LILO is:

image = /boot/vmlinuz
label = linux
root = /dev/system/root
initrd = /boot/initrd
append = "acpi=off"

Works just fine!!

Re: Polishing Your Linux Laptop Setup

Anonymous's picture

Why the h**l are you claiming that the OS (calling w32 an OS is an
exaggeration but anyway) is handling this ?
I would suggest that they (w32) have got nothing whatsoever to
do with this matter at all. I also would suggest that you stick with
your beloved w32 and stop wasting your and our energy by posting.

Re: Polishing Your Linux Laptop Setup

Anonymous's picture

well, not having to do anything due to hw people at
different companies licking your ass helps a lot.

Re: Polishing Your Linux Laptop Setup

Anonymous's picture

The author is quick to blame manufacturers, but if OS from '98 can handle it how come ones from 2003 based on Linux stumble - and it's not Compaq's fault.

Hmm... let's see -- it was DESIGNED to work with Windows, the manufacturer explicitly planned Windows support and has probably not cooperated at all with the Linux folks trying to support it by providing docs, much less by actually writing the appropriate software that would allow Linux to use it. So, yes, it IS Compaq's fault.

I get so sick of people complaining "Linux doesn't support XXX" -- you've got it wrong. Vendor XXX doesn't support Linux. It isn't a technical limitation on behalf of Linux -- it's a decision by the manufacturer to support only one choice in the market.

Re: Polishing Your Linux Laptop Setup

Anonymous's picture

Because the manufacturer provides special drivers for Win9x, Win2k, WinXP to work with their non-standards-compliant hardware? (But the manufacturer doesn't do the same for Linux.)

That's what the author says at least... And that makes sense to me...
Then, of course, there's most likely a whole bunch of other problems that can arise.

Myself, I'm running Linux on my HP Omnibook 6100... flawlessly...

isn't intel itself coding ACPI for linux ?

Anonymous's picture

Or are they just pretending to, appearing to be close to GPL zealots but at the same time stroking m$ by sabotaging linux at every opportunity.

I see no reason for intel to help linux - if windows becomes irrelevant then so does intel - linux runs on many platforms.

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix