Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7683164
  • 博文数量: 637
  • 博客积分: 10265
  • 博客等级: 上将
  • 技术积分: 6165
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-12 22:00
文章分类

全部博文(637)

文章存档

2011年(1)

2010年(1)

2009年(3)

2008年(12)

2007年(44)

2006年(156)

2005年(419)

2004年(1)

分类: LINUX

2005-08-10 08:50:56

or "A step-by-step guide to Fedora Core 4 including graphical Software Suspend2
and all necessary setup on a Samsung X10 series notebook"

         

I am a proud owner of a Samsung X10 series notebook. It's the slimmest 14" notebook of the world and weighs only 1.8 kilograms.
Even if it's designed for Windows XP and comes bundled with the home version, I decided to try out linux as an alternative
operating system. Google gives a couple of information about installing recent versions of linux but since I don't like SuSE Linux or
Mandrake I gave Fedora Core a try and made this documentation.

I installed and used Fedora Core 3 for a while and now I wanted to upgrade to Fedora Core 4 during a complete re-installation.

Since I don't want to quit playing games on my notebook at university (like GTA San Andreas, it roxx!) I installed Windoze XP Pro in
a 15 GiG partition of the 40 GiG harddrive. The remaining 25 GiG will host my new linux partitions.

Entirely seen the Samsung X10 is perfectly designed for using linux. The only problems are the ACPI functions because Samsung did
not use a standard implementation. So you have to use a fixed DSDT table to make ACPI (like monitor battery status etc.) work.
It isn't as complicated as it sounds - you'll see later..

To get the best out of your linux installation I suggest you to use Software Suspend2. It provides an excellent hibernate function also
called suspend-to-disk to quickly put the notebook into sleep state and wake it up again very fast. This installation guide provides
instructions for the setup of Software Suspend2 as well.



   These are the steps for a complete installation of Fedora Core 4:
  1. Compiling and installing your own custom kernel

   

 

 

Step 1: Out-of-the-box installation

Perform a standard out-of-the-box installation of Fedora Core 4. I prefer installing Gnome as your favourite window manager.

 

Step 2: Setting up hardware

Most of the hardware is detected automatically and configured correctly.

 
works out-of-the-box
after user interaction
CPU

  Pentium-M 1400 Mhz CELERON

UDMA

ACPI
Graphic Chip

  nVidia Corporation NV17 [GeForce4 420 Go 32/64M]
possible*
DVD-ROM/CD-RW

  SAMSUNG CDRW/DVD SU-324B

Sound

  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller

LAN

  3Com Corporation 3c905C-TX/TX-M [Tornado]

Wireless LAN

  Intel Corporation PRO/Wireless LAN 2100 3B Mini PCI Adapter
PCMCIA

  Ricoh Co Ltd RL5c476 II

USB 1.1 and 2.0

  Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller

  Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Host Controller

Firewire IEEE 1394

  Rico Co Ltd R5C552 IEEE 1394 Controller

Touchpad

  SynPS/2 Synaptics TouchPad

MemoryStick
external VGA port

* It is possible to install the original NVIDIA driver instead of the opensource driver for openGL support. But then Software Suspend2 won't work anymore.

 

Step 2.1: Using Intel Pro Wireless 2100 Mini PCI for WLAN

The usage of the Intel Pro Wireless 2100 Mini PCI for WLAN is quite easy. All new kernels include the ipw2100 module to
call the device. The only thing you have to do is to download the firmware for the card.
It can be found at [].

  1. Extract the firmware.
  2. Logged in as root copy it to /lib/firmware and then load the ipw2100 module.
    [root@tigga ~]# cp *.fw /lib/firmware/
    [root@tigga ~]# modprobe ipw2100
  3. /sbin/iwconfig should now list a new device named eth1 with wireless capabilities.
  4. Use Desktop -> System settings to add a new wireless connection with all values set to auto.
    Then you can easily switch between hotspots using bash-scripts.
    Here are some sample scripts for either an or a connection.

 

Step 2.2: Optimizing Synaptics Touchpad

After the out-of-the-box installation the touchpad should work pretty well but there are some hidden tweaks you can apply
to optimize the usage.

I prefer to disable the tapping feature and the scrolling in the edges, because the blue scrollwheel at the bottom works perfectly.

Just edit the /etc/X11/xorg.conf file as root to apply these settings. Find the paragraph where the identifier "Synaptics" is
configured and add the bold printed lines.

Section "InputDevice"
        Identifier "Synaptics"
        Driver "synaptics"
        Option "Device" "/dev/input/mice"
        Option "Protocol" "auto-dev"
        Option "Emulate3Buttons" "yes"
        Option "RightEdge" "6000"
        Option "BottomEdge" "5000"
        Option "MaxTapTime" "0"

EndSection

 

Step 2.3: The special keys

The only special keys I use are the ones for toggling the sound volume up and down. The combinations Fn+<- and Fn+->
are usually reserved for this function.
You can easily set up these shortcuts using Desktop -> Preferences -> Keyboard Shortcuts in the gnome menu.

 

Step 2.4: BIOS settings

For optimal LCD brightness I suggest you to disable the Smart Inverter Control setting in BIOS because otherwise the
LCD brightness will change while switching windows.

If the active window has more dark color in it, the LCD will lower its brightness and if it has more brightly color in it, it will raise
its brightness. This feature really sucks so disabling the Smart Inverter Control is a very good idea!

 

Step 3: Fixing the DSDT table for ACPI

The DSDT table provided by the BIOS is not recognized as a valid DSDT table and that's the matter that ACPI functions
like the battery status monitor do not work.

The only possible workaround is to override the DSDT table with a fixed version during boot-up.

First you have to download the Intel IASL compiler at the following location
[].
There's already a newer version out but in my case it didn't work so I suggest you to download exactly this version.

Extract the compiler.
[hype@tigga ~]# tar xzf acpica-unix-VERSION.tar.gz
Compile it.
[hype@tigga ~]# cd acpica-unix-VERSION/compiler
[hype@tigga ~]# make

Then download a fixed DSDT table for your memory size from the following location:
256 MB Ram []
512 MB Ram []
768 MB Ram []

Compile the new DSDT table with the Intel IASL compiler.
[hype@tigga ~]# ./iasl –tc dsdt.dsl

A file named dsdt.hex is generated. This file is important when you go on compiling your custom kernel.

 

Step 4: Compiling and installing your own custom kernel

The out-of-the-box kernel version is 2.6.11-1.1369_FC4 - a 2.6.11 kernel with the patches of 2.6.12-rc5. It works ok but
for the working ACPI and the very useful suspend-to-disk function you have to build a custom kernel.

After a long period of researching and testing kernels with Software Suspend2, I discovered pre-patched kernels from
Matthias Hensler which are based on the newest official Fedora Core 4 kernels and already include Software Suspend2
and fbsplash patches. So such a kernel can be easily set up to use the hibernation function including a sweet graphical
boot-up sequence ().

Matthias Hensler provides pre-built kernels as a compiled .RPM-package and the corresponding Source-RPM-packages.
Since we still need to compile the kernel with custom settings and because I prefer building my own kernel, the best choice
is to download a Source-RPM-package of the kernel.

  1. Download the userland tools at []
    You need to download and install the following .RPM-packages:

    - hibernate 1.10 or newer []

    - swsusp-userui 0.3.1 which consists of these three files:

    1. The userui-tools for text-mode
    [http://www.mhensler.de/swsusp/download/swsusp2-userui-0.3.1-0.cubbi3.i386.rpm]

    2. The userui-tools for fbsplash-mode
    [http://www.mhensler.de/swsusp/download/swsusp2-userui-fbsplash-0.3.1-0.cubbi3.i386.rpm]

    3. The userui-fbsplash-theme "Snowboard Tux"
    [http://www.mhensler.de/swsusp/download/swsusp2-userui-snowboardtux-0.3.1-0.cubbi3.i386.rpm]

  2. After installing the userland tools proceed in downloading the following kernel as a .SRPM-package.
    I gave the version 2.6.12.2 a try which is officially named 2.6.12-1.1387_FC4.
    This one includes Software Suspend2 version 2.1.9.5. Even if they are newer versions I decided to take this one because
    it includes the latest stable Software Suspend2 version.

    Download it here: [http://www.mhensler.de/swsusp/download/kernel-2.6.12-1.1387_FC4_cubbi1_swsusp2.src.rpm]

    After downloading, install the new kernel. Do not follow the instructions on Matthias Hensler's page but do it this way:

    Unpack and install the kernel as root! Unfortunately you should stay logged-in as root during all the next steps.
    [root@tigga ~]# rpm -ivh kernel-2.6.12-1.1387_FC4_cubbi1_swsusp2.src.rpm
    [root@tigga ~]# rpmbuild -bp --target=i686 /usr/src/redhat/SPECS/kernel-2.6.spec


    After these steps the new kernel sources are at /usr/src/redhat/BUILD/kernel-2.6.12/linux-2.6.12. Go on and copy
    them to the official location at /usr/src.

    [root@tigga ~]# cp -R /usr/src/redhat/BUILD/kernel-2.6.12/linux-2.6.12 /usr/src/


    Make a symbolic link /usr/src/linux to the new sources.

    [root@tigga ~]# ln -s /usr/src/linux /usr/src/linux-2.6.12


    You are now ready to compile your custom kernel!

  3. There are some things you need to set up before starting the real compile procedure.

    Copy the generated dsdt.hex-file to your new kernel sources (see Step 3).
    [root@tigga ~]# cp dsdt.hex /usr/src/linux/include

    That's the point where you can apply any other patches you want to. In my case everything is fine and I skip
    additionally patching.

    Put the kernel into a clean state.
    [root@tigga ~]# cd /usr/src/linux
    [root@tigga ~]# make mrproper


    Copy the bundled .config-file for i686 processors to the appropriate location.
    [root@tigga ~]# cp /usr/src/linux/configs/ kernel-2.6.12-i686.config /usr/src/linux/.config

    Now apply the .config file.
    [root@tigga ~]# cd /usr/src/linux
    [root@tigga ~]# make oldconfig

  4. You are now ready to configure your kernel. You can choose between several config methods. I prefer either
    the make menuconfig or the make xconfig method. For the second you need the QT libraries installed at your system.

    In the setup tool proceed with the following steps:

    Change the processor family to Pentium-M.
    Processor type and features -> Processor family -> Pentium-M

    Enable the compile-in of external firmwares. In order to do that you have to disable this option:
    Device Drivers -> Generic Driver Options
    -> [ ] Select only drivers that don't need compile-time external firmware


    Now a new important option is available: the possibility to include a custom DSDT-table in the kernel compiling
    process. Enable this option:
    Power managment options (ACPI, APM) -> ACPI (Advanced Configuration and Power Interface) Support
    -> [*] Include Custom DSDT


    After this step there's a new option called () Custom DSDT Table file to include.
    Just type dsdt.hex into this field. The path to this file is relative to /usr/src/linux/include where you already copied the
    compiled dsdt.hex-file (see Step 3).

    All in all that's everything what's needed to configure your new kernel. Just verify that Software Suspend2 and the
    File Writer is enabled at
    Power management options (ACPI, PM) -> Software Suspend 2

    I also disable Bluetooth, ISDN, Backlight & LCD Device support and iRDA support and enable NTFS read and write
    support built-in. You can carefully change everything to your needs.

    Save your configuration and exit the setup tool.

  5. Let's start compiling!

    Build the kernel and all modules. This step takes about ~40 minutes.
    [root@tigga ~]# cd /usr/src/linux
    [root@tigga ~]# make all


    Install the modules.
    [root@tigga ~]# make modules_install

    Install the new kernel.
    [root@tigga ~]# make install

  6. Setting up the bootloader and boot into the new kernel

    The new kernel-image is automatically inserted at the top of /etc/grub.conf. You only have to change Default=0 to
    automatically boot up your new kernel.

    Now reboot your system and let your new born kernel run! Hopefully it boots and runs correctly.

    You can test the new ACPI table by adding the battery charge monitor to the gnome panel: IT WORKS!

 

Step 5: Modifying the initrd for Software Suspend2 usage

To start using Software Suspend2 you have to make some changes to your initrd.

Login as root!

Prepare a temporary directory for expanding the initrd.
[root@tigga ~]# cd /boot
[root@tigga ~]# mkdir myinitrd
[root@tigga ~]# cd myinitrd


Now extract the image to the new directory.
[root@tigga ~]# gzip -dc /boot/initrd-2.6.12-prep.img|cpio -i

Edit the init-file
[root@tigga ~]# joe init

Between lvm vgchange -ay --ignorelockingfailure VolGroup00 and echo Creating root device add
the following bold printed lines:
...
lvm vgchange -ay --ignorelockingfailure VolGroup00
echo "Activating software suspend2.."
echo /bin/suspend2ui_fbsplash > /proc/software_suspend/userui_program
echo > /proc/software_suspend/do_resume

echo Creating root device
...

After this you have to copy some files into your new initrd.
[root@tigga ~]# cp -R /etc/splash/ etc/
[root@tigga ~]# cp /dev/fb* dev/
[root@tigga ~]# cp /sbin/suspend2ui_fbsplash bin/

Finally re-compress your initrd.
[root@tigga ~]# find . | cpio -o -c | gzip -9 > /boot/initrd-2.6.12-prep.img

All done! But Software Suspend2 isn't usable yet, first you have got to read Step 6.

 

Step 6: Setting up hibernate.conf and again the bootloader

The hibernation or suspend-to-disk process can be easily initiated by the hibernate-script which was already installed in Step 4.
You only have to configure the script by modifying the /etc/hibernate/hibernate.conf file.

As root perform the following:
[root@tigga ~]# joe /etc/hibernate/hibernate.conf

For instance I provide my hibernate.conf . It should work for you too.

During some experiments I found out that using the FileWriter function of Software Suspend2 is much more reliable than
the SwapWriter. My is optimized for FileWriter usage.

After making the changes to your hibernate.conf file, try to start a hibernation cycle as root:
[root@tigga ~]# /usr/sbin/hibernate

It will fail with the following important information:
ABORTING: resume2 is not setup correctly. Unless you have setup your bootloader correctly, resuming will most likely fail.
To correct this, add "resume2=file:/dev/dm-0:0x3e04b2" to your kernel command line in your LILO or GRUB configuration and reboot.

The bold information will differ if you set up another FileWriter location at your /etc/hibernate/hibernate.conf file.

To ensure that Software Suspend2 finds your image file and is able to resume at boot-up you have to modify again the bootloader config
at /etc/grub.conf.

As root open the config file with an editor:
[root@tigga ~]# joe /etc/grub.conf

Now first enable the framebuffer device. To do that you have to add vga=0x317 to your kernel command line - best choice is to
append it at the end.

Next insert the resume2 parameter, which was given by the aborted hibernation cycle (for example resume2=file:/dev/dm-0:0x3e04b2)
directly after the root parameter.

The boot entry should now look like this:

title Fedora Core (2.6.12-prep)
        root (hd0,5)
        kernel /vmlinuz-2.6.12 ro root=/dev/VolGroup00/LogVol00 resume2=file:/dev/dm-0:0x3e04b2 rhgb quiet vga=0x317
        initrd /initrd-2.6.12-prep.img

Now reboot!

After rebooting, open a terminal and login as root.

Now try to initiate a hibernation cycle by typing the following command:
[root@tigga ~]# /usr/sbin/hibernate

If everything goes fine you should see "Snowboard Tux" and a progress bar. When 100% are reached your system should power off.

Now at next boot-up the system should automatically start the resume process and after a few seconds your old desktop should
re-appear.

Congratulations! You finally made it..

Note:
At very very few times the resume process will fail. The "Copying kernel back.."-procedure hangs. That's no big problem - just power off
and on and at the BIG FAT WARNING press "c" to start another resume attempt. Sometimes you have to do this twice or more times
before it will actually succeed to resume. It's annoying but not a real problem since it does not happen often and no data or work is ever
lost
.

 

Step 7: Configuring ACPI events for easy hibernation

For the daily usage of the hibernate function I like to set up an ACPI event. Because the power button isn't recognized as an event,
I use the closing of the lid to initiate a suspend-to-disk cycle.

The first step is to ensure that your user account is able to start the hibernation process because you do not always want to log in as root
before running /usr/sbin/hibernate. And because ACPI events call a script running under the current logged-in user, this step is neccessary.

You can either allow the current user only the /usr/sbin/hibernate program or complete root access. I chose the complete root access
without any password because I need root access really often and don't worry about the security weakness. It may be a risk but
it is very comfortable to type just sudo as a normal user to run something as root.

To follow my way to complete insecurity of the user account management, just edit /etc/sudoers as root and add the following line:
username ALL=(ALL) NOPASSWD: ALL

Of course username has to be changed to your username. But I warned you! :)

Now when you set up /etc/sudoers you are ready to configure a script which determines the state of the lid and when it's closed
initiates the hibernate cycle.

As root create a file named /etc/acpi/actions/lid.sh.
[root@tigga ~]# joe /etc/acpi/actions/lid.sh

Type the following into the file:

#!/bin/sh
# lid.sh

die() {
echo "Unable to determine state of lid."
exit 1
}

STATE_FILE=/proc/acpi/button/lid/LID0/state
[ -f $STATE_FILE ] || die;

STATE=$(awk '{ print $2 }' < $STATE_FILE)

case "$STATE" in
"closed")
echo "Lid is closed."
sudo /usr/sbin/hibernate
;;
"open")
echo "Lid is open."
;;
*)
die
;;
esac

Exit the editor and add execute rights to this file.
[root@tigga ~]# chmod +x /etc/acpi/actions/lid.sh

After the script is ready you have to set it up by editing /etc/acpi/events/sample.conf as root.
[root@tigga ~]# joe /etc/acpi/events/sample.conf

Add the following at the end of the file:
event=button/lid
action=sudo /etc/acpi/actions/lid.sh

Now the lid event is attached with the /etc/acpi/actions/lid.sh script. Restart the acpid service
to enable the function:
[root@tigga ~]# /sbin/service acpid restart

You are now ready to test the easy hibernation by just closing the lid of your notebook for a second.
If everything went fine the computer will suspend and then power down!

 

Sources and helpful links

Here you'll find some interesting and helpful links on Fedora Core 4 or Samsung X10 notebooks.

The Unofficial Fedora FAQ
[]

Fedora Core 4 Installation Notes by Stanton Finley
[]

Fedora Core 4 Tips & Tricks
[]

Matthias Hensler: Software Suspend with Linux and Fedora Core
[]

TuxMobil: Linux With Laptops, Notebooks, PDAs and Mobile Cell Phones
[]

FC4 T42 Setup
[]

Linux auf Samsung X10 - Andreas Grau
[]

Linux mit dem Samsung X10 XTC1500 II
[]

- Computer - Linux auf dem Samsung X10 XTC 1500 III
[]

SuSE 9.3 on a SAMSUNG X10 XTC1400 notebook
[]

 

Feel free to submit questions, comments, bugs and improvements to hypehypepage.de!

This guide was written by Daniel Haehn alias hype - hypehypepage.de, last updated August the 9th, 2005.

阅读(1236) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~