November 23, 2011

placing your local source under svn

http://maverick.inria.fr/~Xavier.Decoret/resources/svn/index.html

October 16, 2011

ftpfs to your website!?!

I always hated updating my website ;( Don't like the Hosting's website tool as it only works on the platform I don't use. And ftp'ing is just not 2100 century. Then I stumbeled on curlftpfs, it's old but good news.


#sudo apt-get install curlftpfs
#sudo nano /etc/fuse.conf

uncomment user_allow_other

#mkdir mountpoint
#curlftpfs -o allow_other ftp://user:pass@ftp.somewhere.org mountpoint/

Now you can do normal file commands in the mountpoint, Like editing in emacs and storing the files directly.

July 06, 2011

find command revisited

Finding empty directories and deleting them:
# find /path -depth -type d -empty -exec rm -r {} \;

Finding all gcc coverage files and removing them
find . -name '*gcno' -o -name '*.gcda' -exec rm -f {} \;

Great find command page.

Configuring Ubuntu 11.04 to run with the highest VGA resolution on i915

After the i915 configuration my screens did not use the 1920x1080 resolution that my monitor is capable of. Neither did it select VGA1 as input :(

# xrandr
reports LVDS1 at 1280x1024 as default display, editing my xorg.conf didn't seem ti fix the issue? Guess I edited it wrong!

There's two tweaks that need to be created, firstly I disabled LVDS1 and forced VGA1 as the default video device at boot Append:
video=LVDS-1:d video=VGA-1:e
to your kernel boot parameters in /etc/default/grub


Mine looks like this now:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=LVDS-1:d video=VGA-1:e acpi=force elevator=noop i8042.noloop=1 usbhid.quirks=0xeef:0x1:0x40"

Next, force gdm to use the resolution at login, by adding:

xrandr --output VGA1 --mode1920x1080 --rate 60

to  /etc/gdm/Init/Default

The xrandr command does ofcource depend on your monitor and graphics device. You cn alwasy type xrandr to see it's capabilities. See man xrandr for details.

July 04, 2011

Configuring Ubuntu 11.04 with kernel 2.6.38 for intel 945 & egalax Touch screen

Got a small customized PC at work that needs to have both the eGalax touch screen and the intel i915 (i945GM) driver enabled. From out of the box the screen is booting with the vesa driver, quirkint it to use the intle driver just gave a plain blank screen. The eGalax touchpad didn't send any signals so that was a pretty sucky start.

There's a lot of discussion about what's wrong etc, how to configure both the kernel and the system. I googled the web for answers and there was a lot of noise, in all this noice i found the following posts quite helpfull. They're good backgound information if your're interested.

Bug report - Kernel Mode Setting - debian - Kernel Mode Setting - ubuntu - Xorg-edgers - Intel drivers - i915 Kernel configuration database

This is how I configured the box to work with both.

Fetching the Xorg-Edgers PPA:
You need to get the Xorg-edgers added to your ubuntu package list, the link has instrunctions on how to set up this ppa.

Then you'll have to update your system

#sudo apt-get update
#sudo apt-get upgrade

Should do the trick, you can add the xserver-xorg packages needed by hand if there'ssomething missing.

Configuring the kernel:

The eGalax touch screen is build into the kernel this is se by selecting: CONFIG_HID_EGALAX=y

The i915 driver is a bit more tricky, as there are some things that, apparently, depend on acpi. There are some things like kms, which for never kernels (2.6.36 i believe??) automatically enable kms for the intle, radeon and ati gfx cards.

I tried a number of different approaches, using the trial and error method, before i found a reasnoable configuration. As for the graphics configuration you'll have to add the following flags:

CONFIG_ACPI_VIDEO=y
CONFIG_VIDEO_CAPTURE_DRIVERS=y
CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
CONFIG_VIDEO_SAA7134_RC=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
CONFIG_VIDEO_CX231XX_RC=y
CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
CONFIG_VGASTATE=y
CONFIG_VIDEO_OUTPUT_CONTROL=y
CONFIG_FB=y
CONFIG_FB_BOOT_VESA_SUPPORT=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y
CONFIG_VGA_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_DRM=y


For some reason, i don't know why, the i915 is not selected but the menuconfig or makeoldconfig option will generate new configuration for the experimental intel drivers that over look the i915 stuff.  So you'll have to append the .config file with these three options to get the correct intel driver build into the kernel.

CONFIG_DRM_KMS_HELPER=y
CONFIG_DRM_I915=y
CONFIG_DRM_I915_KMS=y


I removed CONFIG_FB_VESA and CONFIG_FB_VGA16 to avoid issues with conflicting framebuffers in Xorg. See  Kernel Mode Setting - debian for details. You can check all the dependency flags from CONFIG_DRM_I915 in the kernel configuration database if you're interested.

Building the kernel & installing the kernel:
kernel building help


#sudo fakeroot make-kpkg --append-to-version= kernel_image
#sudo dpkd -i ../linux-image..deb

Configurating the boot options:

Once kernel is ready you'll have to setup the system, to use it correctly. You'll have to add the i915 kms selection option to /etc/modprobe.d simply add a file called i915-kms.conf containing:

options i915 modeset=1

Then edit the grub configuration to get both eGalax and i915 to work, if you have other options to the GRUB_CMDLINE_LINUX_DEFAULT flag append these:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force elevator=noop i8042.noloop=1 usbhid.quirks=0xeef:0x1:0x40"

i915 kms depend on acpi, that why it is forced. The elavator=noop and i8042.noloop=1 and usnhid.quirks=0xeef:0x1:0x40 are all options for the eGalax touch screen. The quiet and splash are options to get a linux splash logo at boot and quiet boot.

dont forget to update grup with these new settings

#sudo update-grub

Adding policy file for the eGalax touch screen:

I added an evtouch.fdi file to the hal layer, this file contains thesetup for the touch screen. It is placed in:
/etc/hal/fdi/policy/evtouch.fdi

And it's contents are: evtouch.fdi
<?xml version="1.0" encoding="UTF-8" ?>
<deviceinfo version="0.2">
<device>
<match key="info.product" contains="eGalax Inc. USB TouchController">
<merge key="input.x11_driver" type="string">evtouch</merge>
<merge key="input.x11_options.ReportingMode" type="string">Raw</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">false</merge>
<merge key="input.x11_options.Emulate3Timeout" type="string">1</merge>
<merge key="input.x11_options.SendCoreEvents" type="string">On</merge>
<merge key="input.x11_options.MinX" type="string">0</merge>
<merge key="input.x11_options.MinY" type="string">2</merge>
<merge key="input.x11_options.MaxX" type="string">4096</merge>
<merge key="input.x11_options.MaxY" type="string">4096</merge>
</match>
</device>


Configuring Xorg:
Finally you'll need to modify the Xorg.conf file. As ubuntu doesent have one pr default you'll have to generate it.Go to a non graphical login and use Xorg to generate the config file.

#sudo service gdm stop
#sudo Xorg -configure

will create a xorg.conf.new file in your current directory. it may be a good idea to wait with the file generation until you have booted your system with the new kernel. There may be a risk that the generation will fail because Xorg cant load the i915 driver.

Once you have the configuration ready you'll need to copy it to the /etc/X11/ directory and name it xorg.conf

#sudo cp xorg.conf.new /etc/X11/xorg.conf
#sudo service gdm start

Calibrating the touch screen:
Then you should calibrate the eGalax touch pad, you can install the touchscreen calibration application with apt-get. There's a lot of very good information here.

#sudo apt-get install xinput_calibrator

You'll get a menu item in System | Administration | calibrate touch screen
Simply run it and follow the instructions.

I copied my calibration to a file called: 99-calibration.conf it contains:

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "eGalax Inc. USB TouchController"
        Option  "Calibration"   "192 3874 476 3636"
        Option  "SwapAxes"      "1"
EndSection

You may not need the SwapAxes flag, but mine where defenately swapped. I still cant the get the compiz_check script to run on my machine but Unity and the compiz window manager are both running with a resolution of 1280x1024.

My configuration files are available here: xorg.conf 99-calibration.conf i915-kms.conf grub evtouch.fdi