Debian Sid with Kernel 2.6.27

From A110 Wiki
Jump to: navigation, search

Contents

Introduction

This is a very detailed HOWTO based on the other Debian installation HOWTO with some major modifications to enable most of the hardware features of the A110.

What works (tested):

  • LCD with support for native 800x480 resolution, higher resolutions scaled and XV Video support
  • Wireless LAN although WPA still has issues (very slow)
  • Audio
  • Wired LAN
  • Touchpad

What might work (untested):

What does not work:

  • 3D support - Applications which try to use 3D will crash the X server (might work in the future as VIA now contributes to OpenChrome project)
  • The 56k modem
  • The MMC/SD reader (To do)

Goals

  • Slim and extensible Debian Sid system with desktop apps suitable for netbooks
    • XFCE4 desktop
    • Abiword word processor
    • Gnumeric spreadsheet
    • Audacious audio player
    • mplayer for video playback

Requirements

  • One A110 (of course)
  • Fast enough PC either running Debian GNU/Linux or capable of running it inside a virtual machine (recommended) to build a kernel from source (You could build the kernel on the A110 itself but this is a very tedious thing to do)
  • Fast Internet connection
  • Big-enough USB thumb drive (Absolute minimum: 512MB; 2GB recommended)

Prerequisites

Before you begin

  1. Backup your SSD so it can be restored if you mess up everything
  2. Download the Debian installation media we will be using
    1. The minimal boot image for hard disks and USB thumb drives boot.img.gz [from here]
    2. A Debian testing (lenny) businesscard ISO image, daily build recommended [from here] (If it doesn't work, try a standard lenny businesscard image)

Prepare your fast PC for building the kernel and preparing the USB drive

If your fast PC is already running Debian GNU/Linux (didn't test it with stable) you can skip this subsection.

  1. Download and install virtualization software with USB support. When running Windows or Linux, you can get the free [VMWare Server]. On Intel Mac, if you don't already own Parallels or VMWare Fusion, download the closed-source edition of [VirtualBox]. (The open-source edition doesn't have USB support)
  2. Prepare the VM
    1. Create a new VM with the following data:
      1. 512 MB RAM
      2. Video mem can be low as we'll be using text mode only
      3. One network card, connected to either bridged or NAT (With VirtualBox, use the PCNet Fast III network adapter)
      4. Hard disk size of 6-8GB, recommended: Allocate all disk space at the beginning, this will speed up writes
      5. Activate USB controller, plug in your USB thumb drive, wait for it to be detected and add an USB filter for it, then unplug it (when using vbox, USB handling might be different on other VM software)
    2. If you use VirtualBox, make a SSH forwarding rule, as especially on mac, working with SSH is more comfortable (no hassle with keyboard settings):
      1. Quit VirtualBox.
      2. On a command line, enter the following to forward everything on localhost:8022 to the VM Port 22:
        VBoxManage setextradata "name of the VM goes here" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
        VBoxManage setextradata "name of the VM goes here" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
        VBoxManage setextradata "name of the VM goes here" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 8022
  3. Prepare the "preparation environment" in the VM
    1. Start your VM
    2. Install a bare-bones Debian from the businesscard ISO downloaded above with the following settings:
      1. 512MB or 1GB Swap partition
      2. Rest of the disk as / (no separate /boot etc...)
      3. Don't install any packages for the first-time install
    3. After installation, disconnect the virtual CD drive and reboot the VM.

Building the kernel

  1. Log in to your prep environment as root (Either directly or via SSH)
  2. Install at least the following packages:
    ssh, kernel-package, build-essential, zlib1g-dev, module-assistant, cvs, curl, libncurses5-dev, dosfstools (Dependent packages will be installed automatically)
  3. Change directory to /usr/src
  4. Download the latest 2.6.27 Vanilla Kernel from [the Kernel website]
  5. Unpack it to /usr/src, a directory named linux-2.6.27.minor will be created (as of writing this HOWTO, it's 2.6.27.7)
  6. Make a symbolic link called "linux" which links to this new dir
  7. cd to the "linux" link
  8. Copy your current kernel config here: cp /boot/config-`uname -r` .config
  9. Open the kernel configurator by doing make menuconfig
  10. Import the old configuration by "Load an alternative configuration" and then entering ".config"
  11. If you want to optimize your kernel to disable everything you don't need, be sure to leave at least the following in:
    • ext2, ext3, reiser, fat and vfat
    • Realtek 8139B LAN chipsets
    • Realtek 8187 wireless chipsets
    • VIA powersaving features (e_powersaver)
    • VIA and Intel HD Audio (snd_hda_intel) and everything which depends on it
    • ACPI and APM
    • USB support for at least UHCI, EHCI, and USB storage (recommended: Include all USB support)
    • Generic IDE and SCSI support
    • initrd support
    • loadable module support
    • Processor Type: Either Via C7 or Pentium III
    • As well as everything you need for your prep environment (VM or PC) - We are going to boot the new kernel on it later to verify it's working
  12. Now, compile the kernel for the first time:
    1. make-kpkg clean
    2. make-kpkg --initrd --revision=one.1.0 kernel_image kernel_headers
    This will take a long time, go get a coffee or go out for a walk ;) - After building has finished, you will find two .deb files in /usr/src.
  13. Install the linux-image .deb and reboot your VM or PC with it to see if it works. If it hangs on "Loading, please wait", the new kernel treats IDE as SCSI. Then, boot your old kernel, open /boot/grub/menu.lst and change every /dev/hdX to /dev/sdX in the lines for the new kernel.

Preparing the USB thumb drive for installation

WARNING: This will destroy all data previously on the drive!!!

  1. Log in to your prep environment as root
  2. Copy the previously downloaded boot.img.gz into your VM/to your prep environment
  3. Connect the thumb drive to your PC/VM (if necessary, activate it in the VM) and wait for about 10 seconds to let it settle. Then, determine its name by giving dmesg |tail or fdisk -l
  4. Dump the boot.img.gz to the drive with zcat boot.img.gz >/dev/sdX (where sdX is the name given in the previous step)

Installing a minimal Debian/Sid on the A110

WARNING: Be sure to backup your SSD as you'll format it

  1. Connect a network cable to your A110
  2. Boot your A110 from the prepared stick
  3. Install a minimal Debian Lenny system without any extra options (disable all flavors to install later on, even don't install the "Standard system")
  4. When this is done, boot into your new system, login as root and prepare for updating to sid:
    1. Edit /etc/apt/sources.list
      • Comment out the lenny/updates lines
      • replace "lenny" by "sid" in the other lines, and add contrib and non-free if you like
    2. Do "aptitude update" and "aptitude dist-upgrade" and reboot

Installing the previously built kernel

  1. Boot your prep environment from step 4 again, login as root
  2. Plug in your USB drive there, wait for it to settle
  3. Wipe the partition table:
    dd if=/dev/zero of=/dev/sdX bs=512 count=1
  4. Use cfdisk or fdisk to create one new partition of type "Win95" (FAT16 or FAT32)
  5. Format this partition as vfat with mkfs.vfat (from the dosfstools package)
  6. Mount your USB drive somewhere (e.g. /mnt) and copy at least the linux-image .deb from /usr/src there
  7. Unmount and unplug your USB drive
  8. Boot your A110, login as root and plugin your USB drive
  9. Mount it somewhere
  10. Install the linux-image .deb and optionally, the linux-headers.deb afterwards
  11. Unmount and unplug
  12. Edit /etc/modules and add the modules e_powersaver and rtl8187 (write every name in a new line)
  13. Reboot

You should now have a 2.6.27 kernel with Wi-Fi support.

Installing X11 with via support

  1. Install the packages xserver-xorg-driver-vesa, xserver-xorg-driver-fbdev, xserver-xorg, xbase-clients, xfonts-base and xterm
  2. run startx once, it will most likely bail out with an error. This doesn't matter here. If it works, quit it by pressing Ctrl-Alt-Backspace.
  3. Get the Ubuntu 8.04 beta unichrome driver [Direct Link] (start at this point if you installed sidux lite from usb-stick)
  4. Unpack it (it's a .tar.gz archive), go to the newly-created directory
  5. Make the directory where parts of the driver will go:
    mkdir -p /lib/modules/` uname -r`/kernel/drivers/char/drm
  6. Execute ./vinstall
  7. Add a file named /etc/modprobe.d/via with the content:
    install viaagp modprobe -f via_agp (via-agp with a dash instead of an underscore might work, too)
  8. Add to /etc/modules:
    viaagp
  9. Use following /etc/X11/xorg.conf (it's a slight modification of the one the via driver installs, adapt your keyboard layout if necessary, this one is for a German keyboard):
# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by failsafeDexconf, using
# values from the debconf database and some overrides to use vesa mode.
#
# You should use dexconf or another such tool for creating a "real" xorg.conf
# For example:
#   sudo dpkg-reconfigure -phigh xserver-xorg
Section "InputDevice"
  Identifier           "Generic Keyboard"
  Driver               "kbd"
  Option               "XkbRules"              "xorg"
  Option               "XkbModel"              "pc105"
  Option               "XkbLayout"             "de"
  Option               "XkbVariant"            "nodeadkeys"
  Option               "XkbOptions"            "lv3:ralt_switch"
EndSection

Section "InputDevice"
  Identifier           "Configured Mouse"
  Driver               "mouse"
EndSection

Section "InputDevice"
  Identifier           "Synaptics Touchpad"
  Driver               "synaptics"
  Option               "SendCoreEvents"        "true"
  Option               "Device"                "/dev/psaux"
  Option               "Protocol"              "auto-dev"
  Option               "HorizEdgeScroll"       "0"
EndSection

Section "Device"
	Driver "via"
	VendorName  "VIA Tech"
	BoardName   "via"
  #Identifier          "Configured Video Device"
  Identifier           "device1"
  Option "SWCursor"
  #Option              "DPMS"
  #Option              "ActiveDevice"          "DFP,CRT"
  #Option              "PanelID"               "8"
  #Option              "LCDPort"               "DFP_HIGHLOW"
  #Option              "NoDDCValue"
  #The Option we were searching for:
  Option               "DisplayHardwareLayout" "TTLLCD"
  #Option               "FnHotkey"              "LCD, CRT"
  Option               "FnHotkey"
  #Option              "DisplayHardwareDevice" "LCD"
  Option               "ActiveDevice"          "LCD"
  #Option              "ForceLCD"
EndSection

Section "Monitor"
	Identifier "Monitor"
	ModeLine "720x480" 26.7 720 736 808 896 480 481 484 497
	ModeLine "720x576" 32.7 720 744 816 912 576 577 580 597
	ModeLine "800x480" 29.58 800 816 896 992 480 481 484 497
	ModeLine "848x480" 31.5 848 864 952 1056 480 481 484 497
	ModeLine "856x480" 31.7 856 872 960 1064 480 481 484 497
	ModeLine "960x600" 45.98 960 1000 1096 1232  600 601 604 622 -HSync +Vsync
	ModeLine "1000x600" 48.07 1000 1040 1144 1288 600 601 604 622 -HSync +Vsync
	ModeLine "1024x512" 41.3 1024 1056 1160 1296 512 513 516 531
	ModeLine "1088x612" 52.95 1088 1128 1240 1392 612 613 616 634 -HSync +Vsync
	ModeLine "1152x720" 67.32 1152 1208 1328 1504 720 721 724 746 -HSync +Vsync
	ModeLine "1200x720" 70.18 1200 1256 1384 1568 720 721 724 746 -HSync +Vsync
	ModeLine "1280x600" 61.50 1280 1336 1464 1648 600 601 604 622 -HSync +Vsync
	ModeLine "1280x720" 74.6 1280 1341 1474 1688 720 721 724 746
	ModeLine "1280x768" 80.1 1280 1344 1480 1680 768 769 772 795
	ModeLine "1360x768" 85.50 1360 1392 1712 1744 768 783 791 807 +HSync +Vsync
	ModeLine "1366x768" 85.86 1366 1440 1584 1800 768 769 772 795 -HSync +Vsync
	ModeLine "1440x900" 106.47 1440 1520 1672 1904 900 901 904 932 -HSync +Vsync
	ModeLine "1440x1050" 126.2 1440 1536 1688 1936 1050 1051 1054 1087
	ModeLine "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -HSync +Vsync
	ModeLine "1600x1024" 136.36 1600 1704 1872 2144 1024 1025 1028 1060 -HSync +Vsync
	ModeLine "1792x1344" 202.97 1792 1920 2112 2432 1344 1345 1348 1391 -HSync +Vsync
	ModeLine "1856x1392" 218.57 1856 1992 2192 2528 1392 1393 1396 1441 -HSync +Vsync
	ModeLine "1920x1080" 172.9 1920 2043 2249 2578 1080 1081 1084 1118
	ModeLine "2048x1536" 266.95 2048 2200 2424 2800 1536 1537 1540 1589 -HSync +Vsync
	ModeLine "720x480" 34.9 720 752 824 928 480 481 484 502
	ModeLine "720x576" 42.6 720 760 832 944 576 577 580 602
	ModeLine "848x480" 41.0 848 880 968 1088 480 481 484 502
	ModeLine "856x480" 41.3 856 888 976 1096 480 481 484 502
	ModeLine "1024x512" 53.3 1024 1072 1176 1328 512 513 516 535
	ModeLine "1280x768" 103.0 1280 1360 1496 1712 768 769 772 802
	ModeLine "1440x1050" 160.0 1440 1536 1696 1952 1050 1051 1054 1096
	ModeLine "1280x768" 118.5 1280 1368 1504 1728 768 769 772 807
	ModeLine "1440x1050" 184.5 1440 1544 1704 1968 1050 1051 1054 1103
	ModeLine "848x480" 47.4 848 888 976 1104 480 481 484 505
   VendorName           "Generic"
  ModelName            "640x480 @ 60 Hz"
  HorizSync            30.0 - 72.0
  VertRefresh          50.0 - 75.0
  
  Modeline "800x480" 29.58  800 816 896 992  480 481 484 497

  # 800x480 @ 60.002 Hz (GTF) hsync: 29.82 kHz; pclk: 29.58 MHz
  Modeline "800x480@60gtf" 29.58  800 816 896 992  480 481 484 497  -HSync +Vsync

  # 800x480 59.48 Hz (CVT) hsync: 29.74 kHz; pclk: 29.50 MHz
  Modeline "800x480@60cvt" 29.50  800 824 896 992  480 483 493 500 -hsync +vsync

  # TV fullscreen mode or DVD fullscreen output.
  # 768x576 @ 79 Hz, 50 kHz hsync
  ModeLine "768x576"     50.00  768  832  846 1000   576  590  595  630

  # 768x576 @ 100 Hz, 61.6 kHz hsync
  ModeLine "768x576"     63.07  768  800  960 1024   576  578  590  616
EndSection

Section "Screen"
	Monitor  "Monitor"
  Identifier           "Default Screen"
  Device               "Configured Video Device"
  DefaultDepth 24
  SubSection "Display"
		Modes  "800x480" 
		Virtual 800 480
  EndSubSection
EndSection

Section "ServerLayout"
  Identifier           "Default Layout"
  Screen               "Default Screen"
  InputDevice          "Synaptics Touchpad"
EndSection


Section "Module"
	Load  "glx"
	Load  "dri"
	Load  "extmod"
EndSection

Section "DRI"
	Group 0
	Mode 0666
EndSection

Now, reboot and try a "startx". You should then get a graphical screen with 800x480 resolution.

Installing the XFCE environment

  1. Install the packages
    xfce4, xfce4-appfinder, xfce4-battery-plugin, xfce4-cpufreq-plugin, xfce4-utils, xfce4-goodies, gdm, synaptic
  2. After installation, if you don't get a graphical login, give as root /etc/init.d/gdm restart;exit
  3. As your normal user, log in graphically

Enabling WLAN

  1. Log in with your normal user account and start synaptic. This will ask you for the root password.
  2. Install network-manager-gnome, wireless-tools and wpasupplicant. After installation, the network manager will be started. This will freeze your A110 for about one minute or two. It is not fatal.
  3. Open the XFCE menu, Settings, and there the item for Autostart applications. Click "Add" there, for "name" add something different from "nm-applet" (if you call it nm-applet, it will not work), and in the command field, enter: nm-applet --sm-disable
    sm-disable tells XFCE to not save the status of nm-applet when saving the session. If you omit it, you will get multiple nm-applet instances when you log out and in.
  4. Log out and back in. In the upper-right corner of the screen, there will be a network status icon. Try to disconnect your network cable and connect to your WLAN by clicking on the icon.

Note: If your WLAN uses WPA, it will be very slow (about modem speed) and stall very often. This is a known issue with the RTL8187b chip in the One A110. You might as well try ndiswrapper and the Win98 driver

Installing the applications, tweaking

You should now install abiword-gnome, abiword-plugins-gnome, gnumeric, audacious mplayer, iceweasel and you are done.

Screen, Fonts etc

  • Set your screen to 75dpi and font sizes of 8-9. Turn hinting and maybe RGB subpixel hinting on. This will give you a very clear and readable screen despite the small font sizes.
  • Install the msttcorefonts for most websites to look correct.

Iceweasel

  • Get the "Littlefox" skin and the "Page zoom" extension. The Littlefox skin is a very small skin for small screens.
  • In the "Page Zoom" extension settings, set the default zoom level to 80%. It zooms the whole page including all images to 80% of its size. Pages designed for a 1024 width screen will now mostly fit without horizontal scrolling.
  • Get "Adblock plus" and subscribe to the "DrEvil" filterset. It will filter most ads in webpages (especially the JavaScript-laden LayerAds which would slow your pretty little A110 down like hell) and result in a more compact look of the page this way.

Saving SSD space

  • Don't save too many files on the SSD, rather use USB thumb drives for it.
  • After every run of the package manager (synaptic, aptitude etc.), do an "aptitude clean", this will remove the downloaded .deb packages and some caches
  • Use "deborphan" to find orphaned, unused packages. Use this with caution, it could sometimes point out false positives, especially when an "orphaned" library is needed by a program you didn't install via the APT system

What you still can do: Further ways of tweaking

Saving even more SSD space at the cost of file access speed

Build aufs and squashfs modules for the kernel, then put /usr and /var (except /var/cache/apt) in squashfs images. Mount unified filesystems with the squashfs images and a read/write overlay as /usr and /var. This slows down file access but frees some SSD space. However it will take much space when updating the system.

A solution could be to format a USB thumb drive as ext2, copy /usr and /var to it, mount these as /usr and /var, do the update and create new squashfs images from the updated directories.

Increase security, have multiple configurations and save SSD space by putting some files onto an external USB thumb drive

With the following steps you would have a self-contained running A110 system which you can take with you on vacation etc., and you'd have things not for everyone (e.g. business documents) on a USB thumb drive. You could even have different system configurations this way.

  1. Boot your A110 normally, choose a very secure password for root and create some sort of "guest" account.
  2. Log in as root, plug in an USB thumb drive and format it as ext3
  3. Mount the drive e.g. to /mnt/stick (I will use this mount point here)
  4. Copy /var, /home and /etc to the drive, use "preserve" option to keep owner's rights:
    cp -Rpf /home /mnt/stick
    Do the same for /var and /etc
  5. Unmount and unplug the stick
  6. Create the directory /external
  7. Add the following lines to the end of your /etc/fstab:
    /dev/sda1 /external ext3 defaults 0 0
    /external/home /home none bind 0 0
    /external/etc /etc none bind 0 0
    /external/var /var none bind 0 0
  8. Reboot either with plugged or unplugged USB drive.

Now, you can add user accounts with your USB drive plugged, or reconfigure your system. When booting without the drive, the added fstab entries will fail to mount, leaving you with your system on SSD.

You could even mirror the whole SSD to a USB drive to test other configurations or have well-configured application setups on several USB drives, e.g. you could have one for programming, one for office and one for games. Only note that you exclude /tmp, /dev, /sys, /boot and /proc, this always has to be on the internal SSD.

Personal tools