2013年6月7日 星期五

Compile Raspberry Pi Linux Kernel

This article record how I compile a usable Linux kernel with Emdebian cross-compiler.

Platform: Debian Wheezy
Cross Compiler: arm-linux-gnueabihf-gcc-4.7

  1. Set Emdebian apt repo.
    vi /etc/apt/sources.list

    deb http://www.emdebian.org/debian sid main
  2. Update apt repo. and then add Emdebian keyring. Last, install the cross compiler.

    >> sudo apt-get update
    >> sudo apt-get install emdebian-archive-keyring
    >> sudo apt-get install gcc-4.7-arm-linux-gnueabihf
  3. Set symbolic link of arm-linux-gnueabihf-gcc

    >> sudo ln -s /usr/bin/arm-linux-gnueabihf-gcc-4.7 /usr/bin/arm-linux-gnueabihf-gcc
  4. Download Raspberry Pi Linux kernel source code from github

    >> git clone https://github.com/raspberrypi/linux.git
  5. Clean the build directory

    >>ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make mrproper
  6. Copy Raspberry Pi kernel config file

    >> cp arch/arm/configs/bcmrpi_defconfig .config
  7. Check or Modify kernel features (need libncurses5-dev)

    >>ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make menuconfig
  8. Build kernel Image

    >>ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make Image
  9. If already has a bootable SD card, copy file to replace kernel.img in the SD card.

    >> cp arch/arm/boot/Image /media/SD_CARD/kernel.img
  10. Finish. 
The other kernel config can use and build OK: bcmrpi_cutdown_defconfig

2013年5月11日 星期六

Thinkpad Trackpoint on Debian Wheezy

After install Debian Wheezy, Thinkpad X61 trackpoint can not scroll well.
Add a device configuration about trackpoint in X.org.

Step:
1. Create a directory under /etc/X11
    >> mkdir /etc/X11/xorg.conf.d
2. Create configuration
    >> touch /etc/X11/xorg.conf.d/20-thinkpad.conf
3. Add description for Trackpoint device
    /etc/X11/xorg.conf.d/20-thinkpad.conf
    
    Section "InputClass"
      Identifier "Trackpoint Wheel Emulation"
      MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device"
      MatchDevicePath "/dev/input/event*"
      Option "EmulateWheel" "true"
      Option "EmulateWheelButton" "2"
      Option "Emulate3Buttons" "false"
      Option "XAxisMapping" "6 7"
      Option "YAxisMapping" "4 5"
     EndSection

Reference:

Change GNOME default Chinese directory name

After I install Debian by select Chinese, the default directory will like 下載,公用 ,音樂, 桌面,文件, 範本.
But it's not easy to use under console.
I want directory look like: Downloads, Public, Music, Desktop, Documents, Templates.

We can use "xdg-user-dirs-gtk-update" to modify it.

Step:
1. >> export LANG=en_US
2. >> xdg-user-dirs-gtk-update
    Then press YES
3. >> export LANG=zh_TW.UTF-8