When it came time to configure the X Windows System, I had to select a driver. Since the P2120 has an ATI Radeon Mobility M6 video card, I selected ATI, but this was a mistake. When I rebooted the computer, the X Server could not start up, and the X configuration tool which was automatically started exited immediately without doing anything, in particular, without letting me configure anything.
I then tried editing /etc/X11/XF86Config-4 manually, which did not help. I did not find any information on Debian's website on how to install the correct driver. Most of the P2120 web pages were by RedHat users, and one site which had installed Debian said merely, and somewhat unhelpfully, that they got it to work "after a little tweaking".
I gave up and decided to install RedHat 9 instead.
The only thing which I did get to work was the DSL connection. Here's what I had to put in /etc/ppp/pap-secrets:
"USERNAME" * "PASSWORD"And here's what I had to type to start the connection:
pppd pty 'pppoe' user USERNAME noauth(replace USERNAME and PASSWORD by your actual username and password from your DSL provider. In my case, Sympatico is the provider, and the username is 8 letters starting with "b1"). /sbin/ifconfig and /sbin/route helped me determine when I actually had a connection.
Update (October 29, 2003): I just saw the following hint on http://www.greenfly.org/fujitsu/. It looks like it might have solved my problem, but I overlooked it last night, and now it is too late for me to try it again.
"I received a tip from Aaron Enright, a P2120 user, on getting a
working version of X for the P2120 with Debian Woody "the Debian way."
deb http://people.debian.org/~blade/woody/i386/ ./to your sources.list and run apt-get update && apt-get upgrade to get a version of X that works on woody, without having to resort to installing the X binaries from their site."
I booted from the first CD-Rom. I selected "Manual" instead of "Workstation" or "Server" installation (I like to select which packages I install, even though I end up installing almost all of them anyway). I was suspicious of RedHat's automatic partitioning tool, so I selected manual partitioning using Disk Druid.
I found Disk Druid to be an entirely useless program - it would not allow me to take space from a logical partition and add it to a primary partition - even if enough space was available and there were no partitions that would have had to be moved as a result of the change. Since I already had created several partitions during my unsuccessful debian installation, and since I wanted to change the size of these partitions (erasing their previous contents), I was not very happy with Disk Druid. I rebooted from a rescue disk and used "cfdisk" to create precisely the partitions that I wanted. Here is what I created:
Partition Size (ca.) Mountpoint Type /dev/hda1 8000MB none 07 (NTFS) /dev/hda3 75MB /boot 83 (Linux) /dev/hda4 400MB none a0 (hibernation) /dev/hda5 700MB none 82 (Linux swap) /dev/hda6 8000MB / 83 (Linux) /dev/hda7 10.6MB /home 83 (Linux) /dev/hda8 1.5MB /win_d 0b (Win95 FAT32)The NTFS and Win95 partitions were preexisting. I created the /dev/hda4 (hibernation) partition because of something I read on http://www.greenfly.org/fujitsu/ (see Power Management, search for suspend-to-disk).
I then rebooted from the RedHat CD-Rom, and this time I just used DiskDruid to define the mountpoints and to format the Linux partitions.
The graphics card was automatically (and correctly) detected. The monitor was not detected, but I selected Generic 1024x768 LCD Display (1280x768 was not among the choices offered).
Auto-detection of the soundcard failed.
Everything else worked without any surprises. Problems:
November 5, 2003: To get DSL to work, I ran adsl-setup. To start the connection, first shut down eth0: /sbin/ifdown eth0 (otherwise routing might get messed up). Then do /sbin/ifup ppp0. If this does not work, check in /var/log/messages for errors.
There's one problem remaining: my DSL connection times out after approximately 30 seconds of inactivity. This is very annoying if one is logged into another machine via ssh. I don't yet know how to fix this. It does not happen with my other laptop (and the same DSL connection).
Update (March 16, 2004): The DSL timeout problem is due to a bug in Redhat's adaption of the adsl-setup utility. The problem is that adsl-setup ignores the user's answer to the question "Do you want the link to come up on demand", and always sets a timeout of 20 seconds. This means that your link will time out after 20 seconds of inactivity. To fix it, change the value of PPPOE_TIMEOUT in the file /etc/sysconfig/network-scripts/ifcfg-ppp0 to 0:
As you can see in the picture, the original location of the right shift key is to the right of the "up" key. The shift key should actually be approximately where the "/" and "up" keys are. I solved this problem by exchanging the "shift" and "/" keys (as marked in blue in the picture). It is much easier for me to get used to the "/" key being in a non-standard location than the "shift" key. (Oh, and by the way: I did not write on my keyboard. I applied a layer of Scotch tape, wrote on that, and then I topped it off with a second layer of Scotch tape to keep the ink from smearing).
A user can simply re-program the keyboard (in X) by running the command
xmodmap keymapfilewhere keymapfile is a file (you could give it any name you want, typically .xmodmaprc in the user's home directory) which contains the following:
keycode 61 = Shift_R question keycode 62 = slash question clear shift add shift = Shift_L Shift_RVoila, this does the trick. If you want to restore the default configuration, just run xmodmap on the following file:
keycode 61 = slash question keycode 62 = Shift_R clear shift add shift = Shift_L Shift_RTo see your current keyboard layout, do
The "A" and "B" buttons
The "mail" button
Update (January 21, 2004): Greenfly pointed out to me that his web page contains a description of how to get the "A", "B", and "mail" buttons to work.
keycode 98 = Up Shift_RHowever, this has the undesirable side-effect of preventing the up-key from auto-repeating.
loadkeys filewhere file contains the following:
keycode 53 = Shift keycode 54 = slash question control keycode 54 = Delete shift control keycode 54 = Delete alt keycode 54 = Meta_slashTo reset the default, do
loadkeys -dTo see your current keyboard layout in full detail, do
I thought about making the Caps Lock key into an additional Ctrl key, but I decided to first wait if I wouldn't get used to the Ctrl key as it is.
Modes "1024x768" "800x600" "640x480"by
Modes "1280x768" "1024x768" "800x600" "640x480"in /etc/X11/XF86Config, and restarting the X Server.
cd /usr/local/src # compile and install core sound drivers tar jxf alsa-driver-0.9.8.tar.bz2 cd alsa-driver-0.9.8/ ./configure make make install modprobe snd-ali5451 # (/var/log/messages: kernel: PCI: Found IRQ 9 for device 00:04.0) cd .. # compile and install sound libraries, needed to compile alsa-aware programs tar jxf alsa-lib-0.9.8.tar.bz2 cd alsa-lib-0.9.8/ ./configure make make install cd .. # compile and install OSS compatibility stuff - many programs need this tar jxf alsa-oss-0.9.8.tar.bz2 cd alsa-oss-0.9.8/ ./configure make make install modprobe snd-pcm-oss modprobe snd-mixer-oss modprobe snd-seq-ossAt this point, all the correct modules are installed and running, but you will not hear anything, because the speaker volume is initially set to 0! To set the volume, use aumix:
aumix -v 100 -w 100At this point, your sound should be working. However, you still need to edit /etc/modules.conf to make the settings permanent. Here are the relevant lines in my /etc/modules.conf:
alias sound-slot-0 snd-ali5451 post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || : pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 || : above snd-ali5451 snd-mixer-oss snd-pcm-oss snd-seq-ossNote that there was an old "alias sound-slot-0 trident" line, which I deleted.
Update (August 18, 2004): Regarding the "disappearing" ethernet device: there is a BIOS setting which allows the ethernet device to be always up, even when booting while on battery. This is very handy, because the default behavior is annoying. In the Setup Menu, under Advanced -> Internal Device Configurations -> LAN Controller, choose "Enabled".
The P2120 does not support APM, so the user has no choice but to install ACPI support. Otherwise, the fan behaves very badly (it goes on all the time), and when the laptop runs out of batteries, it just shuts off without warning.
Here's what I did to install it. First, I upgraded the kernel to version 2.4.22 (latest stable version) with ACPI support. To do so, I downloaded the following files from ftp://ftp.kernel.org/pub/linux/kernel/v2.4:
linux-2.4.22.tar.bz2 linux-2.4.22.tar.bz2.signand the following from http://acpi.sourceforge.net/download.html:
acpi-20031002-2.4.22.diff.bz2 acpi-20031002-2.4.22.diff.bz2.signI checked their signatures with the following sequence of commands:
gpg --keyserver wwwkeys.pgp.net --recv-keys 0x517D0F0E gpg --verify linux-2.4.22.tar.bz2.sign linux-2.4.22.tar.bz2 gpg --verify acpi-20031002-2.4.22.diff.bz2.sign acpi-20031002-2.4.22.diff.bz2(The primary key fingerprint was: C75D C40A 11D7 AF88 9981 ED5B C86B A06A 517D 0F0E). Then I unpacked the kernel:
cd /usr/src tar jxf /usr/local/src/linux-2.4.22.tar.bz2 rm linux-2.4 ln -s linux-2.4.22 linux-2.4Patched the kernel:
cd /usr/src/linux-2.4.22 bzcat /usr/local/src/acpi-20031002-2.4.22.diff.bz2 | patch -p1Then I configured the kernel. In order not to have to configure it from scratch, I copied RedHat's configuration from the old 2.4.20-8 kernel:
cp ../linux-2.4.20-8/configs/kernel-2.4.20-i686.config .config make menuconfigNow we are in a menu to configure what is going to go into this kernel. Most of the stuff is enabled by default. I enabled all the ACPI stuff: under "General setup ... ACPI Support" I enabled everything (as modules where possible):
[*] ACPI Support (NEW)Also, under "Processor type and features", I set the Processor family to "Crusoe", and I enabled "Local APIC support on uniprocessors" and "IO-APIC support on uniprocessors", since the help message said this could not hurt (I have no idea what this does). Then I exited the menuconfig program (and saved a copy of .config just in case).
AC Adapter (NEW) Battery (NEW) Fan (NEW) Processor (NEW) Thermal Zone ASUS Laptop Extras (NEW) Toshiba Laptop Extras (NEW) [*] Debug Statements (NEW) [*] Relaxed AML Checking (NEW)
Now I built the kernel:
make dep make bzImageI did not make a boot floppy, since I didn't have my floppy drive handy, and in any case, I was going to keep the old kernel in addition to the new one, so booting should be no problem. However, a boot floppy can be made at this point by doing this:
dd bs=8192 if=arch/i386/boot/bzImage of=/dev/fd0One can even transfer the file arch/i386/boot/bzImage to another machine, and make the boot floppy later in case it is needed.
Now make and install the modules.
make modules make modules_installThere were some errors from depmod about unresolved symbols:
depmod: *** Unresolved symbols in /lib/modules/2.4.22/kernel/crypto/autoload.o depmod: crypto_alg_lookup depmod: *** Unresolved symbols in /lib/modules/2.4.22/kernel/crypto/proc.o depmod: crypto_alg_sem depmod: crypto_alg_listI ignored these at first, but later removed the offending modules (which I didn't need anyway), by moving them out of the way; this prevents depmod from printing warnings during booting.
mv /lib/modules/2.4.22/kernel/crypto/proc.o /root mv /lib/modules/2.4.22/kernel/crypto/autoload.o /root mv /lib/modules/2.4.22/kernel/crypto/api.o /rootNow I put the new kernel into place, alongside the old kernel, which I kept:
cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.22 cp System.map /boot/System.map-2.4.22 mkinitrd /boot/initrd-2.4.22.img 2.4.22The last of these commands generates an "initial RAM disk", which the kernel needs, because otherwise it doesn't understand the ext3 file system during boot. Now I configured GRUB by adding (NOT replacing) the following section in /etc/grub.conf:
title Red Hat Linux (2.4.22) root (hd0,2) kernel /vmlinuz-2.4.22 ro root=LABEL=/ hdc=ide-scsi initrd /initrd-2.4.22.imgIt is not necessary to do anything for the changes to take effect. By keeping the entry for the old kernel in /etc/grub.conf, we ensure that we can boot from that kernel, as well as the new one.
OK, the new kernel is in place, I rebooted, selected the new kernel from the boot menu, and voila, it worked.
Next, a few things needed to be done. First, the sound support needed to be recompiled and reinstalled for the new kernel, following the steps outlined in Setting up sound above.
We also need to try to get ACPI to do something useful. I am now following instructions from the website http://www.tldp.org/HOWTO/ACPI-HOWTO/loadmodules.html. To enable ACPI the first time, we need to load the respective modules:
modprobe ac modprobe asus_acpi modprobe battery modprobe button modprobe fan modprobe processor modprobe thermalYou can now do "lsmod" to verify that these modules have indeed been loaded; further, you can look at the files in /proc/acpi to verify that something is indeed there. By the way, don't execute this command: "echo 5 > /proc/acpi/sleep", because it will immediately and uncleanly turn off the laptop. I did this by mistake.
Also, I turned off the energy star features, whatever they are:
xset q xset -dpmsand commented out the following line from /etc/X11/XF86Config:
The kernel now understands ACPI, and the fan now behaves more normally than before. However, to be more useful, one should install acpid and acpi: I did this by installing the RPMs acpid-1.0.2-1.i386.rpm and acpi-0.0.6-1.i386.rpm, which were available from http://sourceforge.net/projects/acpid and http://grahame.angrygoats.net/acpi.shtml, respectively. Then I started the acpid daemon for the first time by hand (next time it is started automatically during system boot):
acpidTo get information about the battery status:
acpi -VFinally, we need to make sure that the ACPI kernel modules are inserted automatically when the system boots. To this end, I inserted the following commands in the file /etc/rc.d/init.d/acpid:
# load acpi modules echo -n "Inserting ACPI modules" modprobe ac modprobe asus_acpi modprobe battery modprobe button modprobe fan modprobe processor > /dev/null modprobe thermal success "Inserting ACPI modules" echoI inserted these lines in the section "start", just before acpid is called.
Note: When the battery runs out, the laptop still shuts off without warning. We need to put something into /etc/acpi/events/* to do something meaningful when the battery is low. See How to configure acpid to give battery warnings.
Note: I also had to reinstall PCMCIA (i.e., PC-card) support, because it had somehow gotten lost in the new kernel.
In order to react to such events, one must explicitly configure acpid to do so. I assume that acpi and acpid are already installed as described in Enabling ACPI support. Then here is what I did to configure acpid: I created the following three files:
chmod u+x /etc/acpi/actions/handler.sh /etc/acpi/actions/beeper.shand we need to send a SIGHUP signal to acpid for the changes to take effect:
killall -HUP acpidIn detail: The file acpid.conf sets up a rule which tells acpid to call the script handler.sh every time an acpi event occurs (such as a change in battery level, or a change in AC adapter status). The shell script handler.sh takes care of everything needed to handle the event: it checks the event type, and if it's a battery or AC power event, it checks for a critical condition (AC power offline and battery level low). If the battery level is 5% or lower, we send a warning to all users, and let the computer start beeping. If the battery level is 2% or lower, we initiate a system shutdown. The script beeper.sh is used to turn a permanent beeper on or off.
See the manpage of acpid(8) for a description of the format of the acpid.conf file. See /var/log/acpid for any output from the event handling scripts, and also for some sample events.
<!-- Turn off sub-pixel rendering --> <match target="font"> <edit name="rgba" mode="assign"><const>unknown</const></edit> </match>
# Turn off sub-pixel rendering match edit rgba=unknown;