Multiple Parallel Mono Environments

If you are a Mono developer, either you develop Mono or you use Mono for development, I’m sure you already have your Parallel Mono Environment set up and you are happy using it. Keeping a parallel environment is necessary because that way you don’t break your default Mono installation or an specific mono application, so you can keep using the latest version of whatever you need, however sometimes you need more than one parallel environment, usually because you are working on different versions, for example mono-2-6, mono-head and mono-package; in the Accessibility Team we are always working on different Mono versions jumping from one version to another, so we need to keep multiple parallel environments, and we don’t want to compile everything every time over and over. One way to accomplish multiple parallel environments is to keep n copies of mono-dev-env (something like mono-dev-env-2-6 or mono-dev-env-trunk); but since I like to keep everything in one place and use the same procedure to set up my environments, I updated the default environment file to something like this (you can always get an updated version from: here):

#!/bin/bash
#
# Based on http://www.mono-project.com/Parallel_Mono_Environments , with the
# following modifications:
#
# - Aliases for make:
#   - mk = make
#   - mki = make install
#   - mku = make uninstall
#   - mkuci = make uninstall, clean, autogen and install
#   - mkc = make clean
#   - mkdc = make dist-clean
#   - autogenmono = autogen.sh with prefix, you also add your arguments
#   - configuremono = configure with prefix, you also add your arguments
#   - bootstrapmono = bootstrap with prefix, you also add your arguments
# - Success/Failure messages raised depending on executed command.
#
# You will need to add the following alias into your .bashrc:
#
# function exportmono {
#   source ~/path/to/mono-dev $1
# }
#
# so you can use:
# - "exportmono trunk"
# - "exportmono 2.4"
# - "exportmono whatever"
# to use multiple parallel environments, when no argument is used "trunk"
# is set by default.
#
#
# You can also use "lcustom" to load custom scripts, for example
# if you need to define environment variables instead of adding those here
# you will write a custom-var.sh and will use:
#
# "lcustom ~/custom-var.sh"

# Use this variable to add local enviroment paths
# (i.e. to include a custom executable script)
EXTRA_PATH=$HOME/Documents/Repository/uia2atk/tools

# Colors, based on http://wiki.archlinux.org/index.php/Color_Bash_Prompt
NO_COLOR='\e[0m'
# regular colors
BLACK='\e[0;30m'
RED='\e[0;31m'
GREEN='\e[0;32m'
YELLOW='\e[0;33m'
BLUE='\e[0;34m'
MAGENTA='\e[0;35m'
CYAN='\e[0;36m'
WHITE='\e[0;37m'
# emphasized (bolded) colors
EBLACK='\e[1;30m'
ERED='\e[1;31m'
EGREEN='\e[1;32m'
EYELLOW='\e[1;33m'
EBLUE='\e[1;34m'
EMAGENTA='\e[1;35m'
ECYAN='\e[1;36m'
EWHITE='\e[1;37m'
# underlined colors
UBLACK='\e[4;30m'
URED='\e[4;31m'
UGREEN='\e[4;32m'
UYELLOW='\e[4;33m'
UBLUE='\e[4;34m'
UMAGENTA='\e[4;35m'
UCYAN='\e[4;36m'
UWHITE='\e[4;37m'
# background colors
BBLACK='\e[40m'
BRED='\e[41m'
BGREEN='\e[42m'
BYELLOW='\e[43m'
BBLUE='\e[44m'
BMAGENTA='\e[45m'
BCYAN='\e[46m'
BWHITE='\e[47m'

# We are going to load CUSTOM FILES
#
# Basically the idea is to split multiple development paths or variables
# into different files, that way we can keep this file as clean as possible.
# This magic function tries to load those files.

function lcustom {
  if test x"$1" = x; then
    echo -e "${RED}>>${NO_COLOR} Nothing to do, no arguments provided."
  else
    source $1 && echo -e "${RED}>>${NO_COLOR} Loaded: '$1'" || echo -e "${RED}>>${NO_COLOR} Not loaded"
  fi
}

MONO_REV=$1
if test x"$MONO_REV" = x; then
    MONO_REV="trunk"
fi

HOME_ROOT=$HOME/.root-dev/$MONO_REV
MONO_PREFIX=$HOME_ROOT
GNOME_PREFIX=$HOME_ROOT

if [ -d $HOME_ROOT ]; then
  echo -e "${RED}>>${NO_COLOR} Using environment: ${RED}$MONO_REV"
else
  mkdir -p $HOME_ROOT && echo -e "${RED}>>${NO_COLOR} Using environment (for the first time): ${RED}$MONO_REV" || echo -e "${RED}>>${NO_COLOR} Unable to create local path."
fi

# configure-related functions
function autogenmono {
  ./autogen.sh --prefix=$MONO_PREFIX $* && mynotify "autogenmono" || mynotify 1 "autogenmono"
}
function configuremono {
  ./configure --prefix=$MONO_PREFIX $* && mynotify "configuremono" || mynotify 1 "configuremono"
}
function bootstrapmono {
  if test x"$1" = x; then
    echo -e "${RED}>>${NO_COLOR} Use bootstrapmono bootstrap-file"
    echo -e "${RED}>>${NO_COLOR} For example: bootstrapmono bootstrap-2.12"
  else
    ./$1 --prefix=$MONO_PREFIX $2 && mynotify "bootstrapmono" || mynotify 1 "bootstrapmono"
  fi
}

# make-related functions
function mkuci {
  make uninstall && make clean && autogenmono $* && make install && mynotify "mkuci" || mynotify 1 "mkuci"
}
function mk {
  make $* && mynotify "mk" || mynotify 1 "mk"
}
function mki {
  make install $* && mynotify "mki" || mynotify 1 "mki"
}
function mku {
  make uninstall && mynotify "mku" || mynotify 1 "mku"
}
function mkc {
  make clean && mynotify "mkc" || mynotify 1 "mkc"
}
function mkdc {
  make dist-clean && mynotify "mkdc" || mynotify 1 "mkdc"
}

function mynotify {
  MSG_CONTENT=$1
  MSG_URGENCY="normal"
  MSG_RESULT="done"

  echo $1 | grep "[^0-9]" > /dev/null 2>&1
  # Is first argument a numeric value?
  if [ "$?" -ne "0" ]; then
    if [ "$1" -eq "1" ]; then
      MSG_CONTENT=$2
      MSG_URGENCY="critical"
      MSG_RESULT="failed"
    fi
  fi
 
  notify-send -t 2500 -u $MSG_URGENCY "$MSG_CONTENT $MSG_RESULT: '`basename $PWD`'"
}

export DYLD_LIBRARY_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=$MONO_PREFIX/include:$GNOME_PREFIX/include
export ACLOCAL_PATH=$MONO_PREFIX/share/aclocal
export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig:$GNOME_PREFIX/lib/pkgconfig
export MANPATH=$MONO_PREFIX/share/man:$MANPATH
# a11y support
export GTK_MODULES=gail:atk-bridge

PATH=$EXTRA_PATH:$PATH
PATH=$MONO_PREFIX/bin:$PATH
PS1="$WHITE@mono-dev$NO_COLOR:$RED$MONO_REV$NO_COLOR:\w-> "

To use this script you will need to define an alias in your .bashrc:

function exportmono {
   source ~/path/to/mono-dev $1
}

You can use this alias: exportmono 2.4 if you are planning to define a 2.4 environment, or exportmono trunk, or whatever; there are more aliases that I like to use, for example, autogenmono, mk or mki, the nice about these aliases is that they also use notify-send to send a message when the command is completed, so you can work on something else while compiling, installing, cleaning or configuring. Also the bash prompt is using colors to identify what is the current parallel environment, in this case I’m using mono-2-4 and the environment name is 2.4.

Mono    Screenshot

This environment should work on any recent bash version, if not let me know.

HP Pavilion TX2500z. Final.

I’ve been using this tablet for about 4 months with OpenSUSE 11.1, I’m happy: performance, design and hardware support are good for me, however there are few complaints about it:

Hardware

  • Keys are small. Are not small as keys in netbooks, but you get tired if you spent more that 6 hours hacking.
  • Temperature. This is really painful, the hard-disk gets really warm and you can’t touch the bottom if you are using doing hard work.
  • Noise. Same as temperature, using the DVD is somehow annoying, unless you are wearing headphones you don’t notice the noise. When using the hard-disk, for example, compiling or searching, happens the same.

Recently noticed that HP released HP TouchSmart tx2z, this is similar to TX2500z, however the big differences include more memory (up to 8gb) and multi-touch support. Hopefully my complains are already fixed in this newest hardware.

Software

Installing OpenSUSE 11.1 in super easy, so installing won’t let you down, however you will need extra tunning if you want to support all hardware, in particular sound, wireless and video:

radeonhd, open driver

1.2.3 is installed by default, this version doesn’t support Screen Rotation nor 3D Acceleration, according to 1.2.4 releasing notes Screen Rotation is now supported however xrandr doesn’t report any rotation information. If you want to upgrade add the following repository and upgrade:

http://download.opensuse.org/repositories/X11:/Drivers:/Video/openSUSE_11.1/

.

fglrx, proprietary driver

I recommend to generate the rpm and use zypper to install the generated file, if you are running 64bit you will need to recreate the symbolic link because seems the fglrx driver is using 32 paths instead of 64, according to documentation Screen Rotation is also supported, but not enabled by default, so execute as root:

aticonfig --set-pcs-str="DDX,EnableRandr12,TRUE"

to enable it, notice this command doesn’t change /etc/X11/xorg.conf, it works however sometimes rotating the screen will lead to a black screen.

Verdict

I like it, is smaller and lighter that my previous laptop, however the temperature is really really annoying.

Last day of the year

Another year is almost gone. I can’t say 2008 year was “another year“, actually I think 2008 is the most exciting and interesting year I ever lived. I joined a great company and I’ve been working with a great group. I’m looking forward next year.

Huevudo

Smolt

If you install OpenSUSE 11.1 don’t forget to send your hardware profile using smolt, it should run by default when logging in the first time, however if isn’t run then you can execute smoltGui to send your profile, my tablet is here: HP Pavilion tx2500 Notebook PC Rev 1.

HP Pavilion TX2500z. Part IV

If you haven’t updated to OpenSUSE 11.1 RC1 you should do it, GNOME Keyring bug was fixed and this release includes kernel 2.6.27.7-4 that fixes the weird SSH-unable-to-connect bug.

Mario's point of view by @damog

Thanks to Raquel&David for the great week in NYC.

HP Pavilion TX2500z. Part III

There a lot of improvements and fixes in OpenSUSE 11.1 B5, for example you don’t need to add the RadeonHD repository because B5 already includes the fix, however there are some new bugs to be fixed:

  • Bug 441764 – GNOME: gnome-keyring support partially broken.
  • Bug 445724 – gdm: problems with xvkbd on TabletPCs
  • Bug 445923 – File Selecion Dialog changes its size and position
  • Bug 438071 – root owned icons on the desktop

GNOME 2.24.1 is awesome in OpenSUSE 11.1 B5, everything is supported by default and you don’t need anything but some clicks to fully configure your tablet, however by default the current kernel (2.6.27.5-2) doesn’t include the BCM4322 wireless module (wl), and making the current tarball will return building errors, however, I’ve found the solution, apply the patch, follow the instructions and enjoy.

BTW. I love my new Canon Rebel XSi, replaces my old camera, I’m looking forward to take a lot of photographies! My official first photography:

Monkey

Podcast about UML

Do you like Podcasts and UML?, then you must listen the podcast:
Bran Selic on UML.

HP Pavilion TX2500z. Part II

OpenSUSE 11.1 release is getting closer and I just couldn’t wait until December, so I started to test it. I recommend you to install B4, fixes a lot of bugs.

Video configuration

I didn’t install the propietary ATI driver (fglrx), instead I’m using the open driver: radeonhd Notice however that after installing you will need to reboot in failsafe and add the X11 repository, otherwise your computer will freeze after login in. (Bug 437938)

Wireless

You just can’t build the package, yet.

Sound

Is not detected by default, however adding the dell in the model in Yast fixes it. (Bug 430734)

Tablet PC

Everything works out of the box, however you will need to set it up when Sax detects your card. (Bug 430527)

Fingerprint Reader

Fingerprint Reader is fully integrated. (Bug 432199) After log in first time, open Yast and configure your fingerprint.

Remote Control

No idea.

HP Pavilion TX2500z. Part I

I have no complains about my Dell Inspiron 1420, (I love it, indeed), is lighter than my older Dell Inspiron 1150, however I decided to get a new one for several reasons, the most import is that I really want to spend more time playing with Moonlight and Drawing Recognition, so getting a Tablet PC was the next step. The ugly about Tablet PCs is the price, most of them are really expensive, I spent a lot time reviewing the Lenovo X61, Dell XT and Toshiba Portege, however I found one with great hardware and good price: HP Pavilion TX2500z.

I’m aware that supporting Tablet PCs in Linux is not the most common thing, is not like people buying Tablet PCs to install Linux, you don’t see that, actually, I haven’t seen (live) someone using a Tablet PC with Linux; and, being honest with you, I don’t trust HP because of a previous hardware experience, but, that was long time ago (6 years I think), so this time I decided to give it a try and being brave (really brave!), and, actually I have no complains about the hardware.

Running OpenSUSE 11 in HP Pavilion TX2500z is somehow hard, will take you time but, I think is worth it. I installed it using OpenSUSE 11 DVD, so here we go!.

My HP Pavilion TX2500z hardware is the following:

  • AMD Turion(TM) X2 Ultra Dual-Core Mobile Processor ZM-86 (2.4 GHz)
  • 12.1″ diagonal WXGA High-Definition HP BrightView Widescreen (1280 x 800) w/Integrated Touch-screen
  • 4GB DDR2 System Memory
  • ATI Radeon HD 3200 Graphics
  • 320GB 5400RPM SATA Hard Drive
  • Webcam and Fingerprint Reader
  • 802.11a/b/g/n WLAN and Bluetooth
  • SuperMulti 8X DVD+/-R/RW with Double Layer Support

lspci:

00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge
00:01.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (int gfx)
00:04.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 0)
00:05.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 1)
00:06.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 2)
00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode]
00:12.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller
00:12.1 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI1 Controller
00:12.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller
00:13.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller
00:13.1 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI1 Controller
00:13.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller
00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 3a)
00:14.1 IDE interface: ATI Technologies Inc SB700/SB800 IDE Controller
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia
00:14.3 ISA bridge: ATI Technologies Inc SB700/SB800 LPC host controller
00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge
00:14.5 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI2 Controller
00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 11h HyperTransport Configuration (rev 40)
00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 11h Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 11h DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 11h Miscellaneous Control
00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 11h Link Control
01:05.0 VGA compatible controller: ATI Technologies Inc RS780M/RS780MN [Radeon HD 3200 Graphics]
08:00.0 Network controller: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01)
09:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)

Forget about everything you find in Google (if you find something!), or forums, and so on. Seems that this hardware is an upgraded version, so, any NVidia-based guide won’t work, but you can use it as reference.

Installation

Start as usual, booting the DVD, and using the following kernel arguments:

acpi=off

otherwise you’ll get a black screen after the “OpenSUSE Loading” progress bar, and of course, this means that you won’t be able to install it. Bug #430453. Remember to remove “acpi=off” from your kernel arguments after installing: open YaST and edit it, in “Boot Loader”. Don’t forget to update your OpenSUSE before continuing.

Video configuration

By default you will use vesa in your Video card, so, you’ll need ATI drivers ( fglrx), just follow the 1-click installer. After installation don’t forget to logout. Then use a terminal: CTRL+ALT+F1 and:

  • Stop gdm:
    sudo gdm-stop
  • Update Xorg file:
    sudo aticonfig --initial
  • Run:
    sudo sax2 -r
  • Sax2 will detect your card, however, you will have to explicitly indicate your first mouse device, select “Synaptics” and save your settings, otherwise using your mousepad will be really annoying.
  • Start GDM:
    gdm-start

Compiz works, but I recommend you to disable “mimap” in “Application Switcher” Compiz Plugin, otherwise you will see a blank screen in each application preview when doing ALT+TAB.

Sound

The Sound Card is detected, but doesn’t work, you can use YaST to set the model in your Sound Card, however due to a bug the value isn’t saved (Bug #430734), so you have to edit: /etc/modprobe.d/alsa-base and add the following line:

options snd-hda-intel model=dell

Wireless

I found in several forums that enabling ndiswrapper and installing the MS Windows driver will allow you to use your wireless card, however, it didn’t work for me. I installed official Broadcom module instead. You will need to download the x64 version (of course!) and follow the README. I copied the tar.gz to /opt/bcm4322 because I wanted to install the module automatically into the kernel every time the computer starts up, so editing: /etc/init.d/boot.local and adding the following lines make it happen:

  • /sbin/modprobe -k ieee80211_crypt_tkip
  • /sbin/insmod /opt/bcm4322/wl.ko

Tablet PC

Don’t forget to read the OpenSuSE Tablet PC Page. First, you will have to add a new repository that includes support for this Tablet PC

http://download.opensuse.org/repositories/home:/dkukawka/

and install the following packages:

  • wacom-kmp-default
  • x11-input-wacom
  • x11-input-wacom-tools

Next, to load your wacom module automatically you have to edit your /etc/init.d/boot.local:

/sbin/modprobe -k wacom

You will have to log out and log in before setting up your Tablet support. Open YaST to configure your X11, in “Graphics Card and Monitor”, your screen will be black, don’t get scared, this is expected. In YaST you will have to modify your screen resolution to 12.2, because by default is detected as something else, otherwise the Pen won’t work as expected because of the screen resolution. (Bug #430527)

Screen Rotation

Seems that Screen Rotation isn’t yet supported, (according to this), there’s an open bug in ATI Drivers that you can follow, is 3 years old :) . However seems that some brave people had managed to get it, I haven’t tested it:

  • http://ubuntuforums.org/showthread.php?p=4680284
  • http://ubuntuforums.org/showthread.php?t=703806

Memory Card Reader

Nothing to configure here. Plug your card and it should mount it automatically.

Bluetooth

Nothing to configure here.

Webcam

Nothing to configure here, run cheese and have fun.

Fingerprint Reader

You need to add the following repository to YaST. (Bug 432199)

http://download.opensuse.org/repositories/home:/dgege:/fprint/openSUSE_11.0/

and install the following packages: pam_fprint libfprint fprint_demo. Notice that even the device is supported I don’t see a real use for it, IMO, I mean, the integration is not yet tight so, you can’t do too much. To configure your fingerprint you have to do execute:

fprint_demo

Your user must be in the fprint group. Scan your fingerprints. BTW, there’s a bug in the x86_64 package, you can fix it doing the following:

ln -s /lib/security/pam_fprint.so /lib64/security/

This is needed if you want to test your fingerprint with PAM: /etc/pam.d/common-auth

auth   sufficient      pam_fprint.so

Remote Controls

I haven’t set up this completely, however seems that the device is somehow supported. You will need the following package: lirc-kmp-default lirc-32bit. I’ve followed Gentoo’s LIRC Page, but nothing. If you find the way to set the Remote Control, let me know.

Planet a11y

And the Planet Accessibility is up and running!