23 Agustus 2010

Challenge of amd64

Last update: 22 Sept 2010, 1 Oct 2010, 2,4,17 Jan 2011, 1 Feb 2011, 25 March 2011




Succeed with installing 64 bit lenny on my computer, now I have many problem with this 64 bit. At first it was fun, that I had to compile or configure many things, which were not available as is. Now I'm deeply considering of moving back to 32 bit, even on the first day I've asked myself how long I will stand with this 64 bit stuffs. Today I get a bitter experience that I cannot compile a software platform on which I'm working on. The compiler run for hours, but a lot of trailing errors afterward.
The amount of time needed for compilation has discouraged me for doing further observation. I'd like to make it works actually. [Hi this platform uncompiled was not amd64 fault!]
Since the platform only compatible to 32 bit OS, I have to provide all the libraries
needed in 32 bit. Therefore instead of using synaptic debian package manager(which provides 64 bit libraries only by default), I have
to grab the library source code and then recompile it into 32 bit. Details are provided below under installing 32 bit library matter.
Note: many resources in internet about the trouble of linux 64 bit mostly a bit out of date. Lenny has fixed a lot of thing. One useful tips when we cannot find 64bit version of debian is just taking the 64 bit version of ubuntu, it works for me for skype.


Now let me list my footprints until I arrive here:

  1. Wireless, using iwlagn. Note that you must have access to the backport of lenny. If you don't have wired access you can also download the files one by one, and run dpkg -i packageName.deb
    Somehow you need to call ifconfig wlan0 up before calling iwconfig
  2. flash plugin was taking a very long way, until I found Debian Lenny 64 bit installation. It is really good. It points to How to get flash working in 64 bit. Follow the instruction! Just remember to download the keyring manually before touch the repository.
    Update: Adobe has just provided native 64 bit flash player plugin. Just untar and put the library on place
    cp libflashplayer.so  /usr/lib/mozilla/plugins/

  3. Screen off just using vbetool from official repository
  4. skype, just grab ubuntu64 deb package from skype's website
  5. pidgin, need to compile the newest distribution from scratch. The binary from repository doesn't provide client for yahoo and msn messenger.
  6. Speaker. My speaker is mono (written as monaural to be cooler). It didn't output sound, even though the headphone jack is work perfectly. Following ubuntuforum about "Headphones work-no internal speaker sound?", I found that debian has a bit different configuration. Debian doesn't have /etc/modprobe.d/alsa-base.conf, instead it split it into /etc/modprobe.d/alsa-base and another file /etc/modprobe.d/sound. I change the options on /etc/modprobe.d/sound from
    alias snd-card-0 snd-hda-intel
    options snd-hda-intel index=0
    into
    alias snd-card-0 snd-hda-intel
    options snd-hda-intel model=laptop


  7. Compile latest kernel. It's supposed to fix backlight problem but gain nothing.
    Other thing I get is it "How easy it is to compile kernel". In newer kernel Intel wireless driver is given out of the box. Here the step for kernel compilation, an experience version of this instruction with a fix for lenny:

      Download the latest stable kernel from here
      Extract it
      Prepare/clean everything there. It will delete everything you put there

      make clean && make mrproper

      copy configuration file from /boot/. Its name is config-your-kernel-name. It is the most convenient way instead of create configuration from scratch.
      Name the new file as ".config"
      REFINE ".config"
      make menuconfig

      there should be ....coutinued...sorry I forgot some steps. There is a mandatory step to copy some generated code to the kernel source include folder. please look for it on internet.


  8. network manager. I got no luck with gnome network manager with lenny, unlike when I installed ubuntu. Fortunately there is wicd package that work out of the box. Give it a try if you have the same experience :^).

  9. Installing 32 bit library on it. It was a desperate effort, that finally turn into a hack. First install the 64 bit version as usual using synaptic. Then delete the 64 bit library. Afterwards put the 32 bit library on the same place as the location of deleted 64 bit, no need to copy the symlink, ldconfig will do it for you. Run ldconfig. voila! Here is the illustration. RESULT: program is compiled, but not run!
    kompie# ls /usr/lib|grep gsl
    libgsl.a
    libgslcblas.a
    libgslcblas.so
    libgslcblas.so.0
    libgslcblas.so.0.0.0
    libgsl.so
    libgsl.so.0
    libgsl.so.0.12.0
    kompie# rm /usr/lib/libgsl*
    kompie# ls /usr/lib|grep gsl

    All 64 bit libs have been deleted. Now put the 32 bit ones.

    kompie# cd gsl-1.0/
    kompie/gsl-1.0# cp .libs/libgsl.a /usr/lib
    kompie/gsl-1.0# cp .libs/libgsl.so.0.0.0 /usr/lib
    kompie/gsl-1.0# cp cblas/.libs/libgslcblas.
    libgslcblas.a libgslcblas.lai libgslcblas.so.0
    libgslcblas.la libgslcblas.so libgslcblas.so.0.0.0
    kompie/gsl-1.0# cp cblas/.libs/libgslcblas.a /usr/lib
    kompie/gsl-1.0# cp cblas/.libs/libgslcblas.so.0.0.0 /usr/lib/
    kompie/gsl-1.0# ls /usr/lib|grep gsl
    libgsl.a
    libgslcblas.a
    libgslcblas.so.0.0.0
    libgsl.so.0.0.0
    kompie/gsl-1.0# ldconfig
    kompie/gsl-1.0# ls /usr/lib|grep gsl
    libgsl.a
    libgslcblas.a
    libgslcblas.so.0
    libgslcblas.so.0.0.0
    libgsl.so.0
    libgsl.so.0.0.0
    kompie/gsl-1.0#
    Warning!!! All this hacking trick DID NOT work! Finally I do this following to compile my GSL library into 32 bit
    $ CFLAGS="-m32 -g -O2" LDFLAGS="-m32" ./configure i386

  10. Backlight control....again. Didn't get any luck from recompiling kernel, again a retried my with other driver module, now it is from Regis Prevot, watchout, the ssl configuration in your browser might be nasty. Just take panasonic_acpi.c and the Makefile. This driver was intended to be used with W7 and W7, that have DVD drive. Since mine is T-series I have to remove all DVD related code. I don't know if it was caused by my highly abusive kernel recompilation so the compilation related to DVD device was failed.

    Before loading the new driver, first I have to remove panasonic_laptop module, I dont know how to do it. So I do it brutally, remove the file from the kernel ;^(, then reboot. Run "depmod -a" to remove its entry as well. Finally run "modprobe panasonic_acpi" to load the new driver, this command will not succeed unless you remove the panasonic_laptop module.
    Result: The driver is succesfully loaded, but the screen back light is still inaccessible.

  11. Fullscreen problem with mplayer. It's only simple fix on xorg.conf, just add driver to the device.
    Section "Device"
    Identifier "Configured Video Device"
    Driver "intel"
    EndSection


  12. Touchscreen that haunted me from the beginning finally works pretty well. I use evtouch. Instead of using the installation from debian repository, I used the latest version (0.8.8) and compile it. A simple trick about the installation directory; by default it installs on /usr/local/lib/ but my X cannot find it, and I cannot find how to make it works. So I change the prefix entry on the Makefile, instead of /usr/local, I change it into /usr.

    The main issue with the driver from debian repository is its ability to act like mouse. It can only draw horizontal or vertical line.

    Here is my xorg.conf entry as the result of try and error calibration process:
        
    Option "MinX" "50"
    Option "MaxX" "3900"
    Option "MinY" "150"
    Option "MaxY" "4050"
    Note that the log from /var/log/Xorg.0.log has an entry "Setting screen physical size to 270 x 203"

  13. Screen rotation is pretty simple using xrandr. From shell just type:
     xrandr -o left


  14. Brightness, a success story :D. Just make sure you have "panasonic_laptop" module in your kernel. Run "depmod -a" to make sure everything properly listed, check using "lsmod -a", if not listed run "modprobe panasonic-laptop". Yup that's the preliminary.
    This is the most important thing, set the grub! Look for this similar line code on /boot/grub/menu.lst
    kernel /boot/vmlinuz-2.6.35.3-intel-amd64 root=UUID-...-xxxx ro
    then change into [the "=" sign is not a cosmetic]
    kernel /boot/vmlinuz-2.6.35.3-intel-amd64 root=UUID-...-xxxx ro acpi_osi=

    Voila brightness accessible trough:
    root# echo BRIGHTNESS > /sys/class/backlight/panasonic/brightness
    Note root access is mandatory, therefore we need to fix the acpi script ... where BRIGHTNESS value between 0 to 21
  15. I upgrade to Squeeze

  16. Still many things to go ...

07 Agustus 2010

Installing debian 64 bit on intel laptop from USB flash disk


First of all, in debian, 64 bit for ordinary intel processor is denoted as AMD64
instead of IA64, which is totally different architecture that is die casted
on unpopular intel Itanium processor only.

The procedure is quite simple.

  1. Use unetbootin to create a bootable usb disk debian linux installer. I personally
    suggest using [Distribution], then I choose "Debian" and "Stable_HdMedia_x64".
    After the process done, check whether /dev/sdX1 mountable. If not try to plug the stick off
    and plug it in again, hopefully it will be automounted. From this point forward
    I assume we can mount and write into /deb/sdX1, e.g. mount into /mnt/usb/

  2. Download debian-505-amd64-CD-1.iso from debian.org and copy the file into mount point
    of /dev/sdX1 (eg. /mnt/usb/). The installer is supposed to fetch this file from
    the network. But when we cannot configure our laptop to have internet connection
    this should help. Moreover the inetbootin can be configured in Windows!

Voila...
We have a USB installer with full support from CD1 of debian lenny.

warning: this procedure is proven doesn't work for squeeze