Saturday, August 27, 2011

New toy: Arduino (packages fixed)

So I finally got an arduino or more precisely, a nice starter kit from fritzing.org.

Unboxing pictures are here.

I followed the instructions on installing the software from OBS, but checked the repositories first and found that there were some problems with FACTORY builds in Klaus' repo.
Additionally, the packages are, even if made to build, not working with the arduino uno thats in the starterkit.

The reasons are

  • arduino uno has a different USB controller and appears as ACM device, not usbserial

  • apparently, the avrdude included in CrossToolchain:avr is newer than what the arduino software expects and thus does need another protocol specification

  • the arduino package sports its own avrdude.conf which does not work with the uno



Of course I fixed all those problems (and submitrequested the fixes back to the "upstream" projects) in the temporary project home:seife:arduino :-)
So now all you should need to do to get the first program uploaded to the uno is:

  • add the home:seife:arduino repository

  • add the CrossToolchain:avr repository

  • zypper install arduino

  • add your user to the dialout group (we could create some special udev rule case that discovers the arduino and makes the device accessible for group "users", but that would not help for the other arduinos that come with FT232 usb-serial interfaces)

  • relogin to activate your dialout group membership

  • start "arduino" from a terminal (the package is missing a desktop file, I will try to fix that later)



You can also install the fritzing package, but probably better use the package from the Education project than that from Contrib since Education seems to contain a much more recent package.
But for now, everything I did was done using arduino.

Now looking at what is needed to get this to work, I'm wondering if the arduino related packages should just be put into CrossToolchain:avr, or if we should create some project for this Arduino stuff, containing the arduino and fritzing packages and everything needed to support them.
An argument against the "stand alone Arduino project" would be that it duplicates significant build efforts (the cross-avr packages are probably pretty expensive to build).
The pro agument is, that interested users need to add only one repository. If even fritzing is there, they need not add the "Education" repo. This would be good, because adding such big repos which also contain lots of updated "standard" packages (there's SDL etc. in Education) is certainly not recommended for novice users because of the unpredictable side effects. Note that the CrossToolchain:avr repo is pretty small and does not contain anything that updates system tools or similar, so adding this one should be "mostly harmless".

I'll need to think about this and maybe talk with other involved parties at the openSUSE conference in two weeks...

Thursday, March 17, 2011

(e)glibc cross compiling issue...

While building a brand new powerpc cross-compiler with crosstool-ng (which is great), I came about a simple issue which was unexpectedly hard to fix:

../misc/syslog.c: In function '__vsyslog_chk':
../misc/syslog.c:123: sorry, unimplemented: inlining
failed in call to 'syslog': function body not available
../misc/syslog.c:155: sorry, unimplemented: called from here


Using different combinations of build helper tools, eglibc, gcc, whatever did not really help. Even the search engine results were full of the same questions but with very little answers, and most of the answers were clearly in the league of cargo cult programming, nothing you'd want to rely on for a toolchain to be used by others.
But finally I came across this mail from Mike Frysinger which finally showed that it can be as easy as
CT_LIBC_GLIBC_EXTRA_CFLAGS="-U_FORTIFY_SOURCE"
:-)
Of course the question remains why compiling glibc has to be always a major PITA, but that's something I'd rather not discuss in public...

Tuesday, March 08, 2011

Friday, February 25, 2011

openSUSE 32bit to 64bit live conversion

Kids, don't try this at home.
Anyway, here is what worked for me:

  • add arch = x86_64 to /etc/zypp/zypp.conf

  • zypper ref -f

  • rpm -qa kernel*

  • zypper in -f kernel-default kernel-default-base (the kernel packages found by the step above)

  • mkinitrd

  • reboot

  • zypper in -f glibc

  • zypper in -f rpm Attention: don't install, just resolve everything and get the list of -32bit packages that would get installed

  • zypper in -f file-32bit libbz2-1-32bit... Install all the -32bit packages that were selected in the previous step

  • zypper in -f rpm

  • zypper dup --no-recommends --download-in-advance

  • mkinitrd

  • reboot



Whenever zypper asks you for conflict resolution (which will be every single case), select the option that involves "change architecture", never select "break ..." or "do not install ...". There should be no "uninstall..." proposal in the summary before confirming, only architecture changes and newly installed -32bit packgages.

There were some failing postinstalls for glib and other libraries, which could probably have been avoided by more carefully updating in intermediate steps, or by installing some -32bit library packages before the "dup" step, but the resulting system seems to work just fine.

Saturday, February 05, 2011

Making GNOME more Usable

And while I am at it, some hints on getting GNOME a small little bit more usable. The problem is mostly the default window manager, and the gripes I'm having with it are basically the same that Linus Torvalds had some years ago. I want my window buttons to be configurable. To be more precise, I want the "maximize" button to behave like in almost every other window manager: 3 different mouse buttons, 3 different button actions: "maximize", "maximize horizontally", "maximize vertically".
Linus' problems have been addressed, and I'm explaining a lame workaround for my wishes to get something slightly similar to what I want. My workaround does only work because of the fixes for Linus' problems.

After looking into the code I understood that the window buttons are only used with left-click, right and middle click are handled by the "window titlebar action" instead.

So I redefined the window titlebar mouse actions to do maximize horizontally / vertically on right click and double click. (I am pretty accustomed to having middle button on title bar put the window into the background, but I might change that).

So here's what you have to do.

  • open regedit.exe gconf-editor

  • browse to /apps/metacity/general

  • change action_double_click_titlebar to toggle_maximize_vertically

  • change action_right_click_titlebar to toggle_maximize_horizontally


While you are at it, you might also enable resize_with_right_button, which restores even some more sanity.

For all those asking why I'm not using a different window manager with GNOME: been there, tried that, but the integration of them all was pretty horrible (keyboard shortcuts no longer easily configurable, ...) and I want somehting that just works and does not always get in my way. If I wanted that, I could have kept KDE.

Making Windows Usable

If you ever have to use Windows, and are accustomed to "focus follows mouse" as I am, you might find this description useful.

I'm citing the important part here, to let me find it more easily:
Believe it or not, Windows does support focus-follows-mouse, though there is no GUI configuration exposing it. Instead you must edit a registry key and then log out and back in for the change to become effective. You can use regedit to edit the key.
[...]
you need to change a binary-valued registry key:
HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferencesMask
This is a little-endian bitmask. For focus-follows-mouse, add the flag 0x1.
For example, my XP SP2 laptop originally had a value of 9E 3E 05 80, which is 0x80053E9E. To activate focus-follows-mouse I changed to 0x80053E9F, or 9F 3E 05 80 in regedit.

Helped me a lot on a Vista machine yesterday. Don't forget to log out and back in again after the change.

Thursday, February 03, 2011

OpenStack "bexar" packages for openSUSE and SLES11SP1 are ready

Shortly after the OpenStack "bexar" (spoken "bear") release was ready, my packages finished building and are available at the isv:B1-Systems:OpenStack Build Service repo.

Grab them, while they are still hot!

The ride might still be a bit bumpy as the whole OpenStack development is very Ubuntu centric, and thus some of the dependencies, especially to old versions of python stuff are tricky to find. However, first results look promising.

I'll update here soon with some short hints on how to configure and use the whole lot.

Thanks go to my colleagues Christian Berendt and Andre Nähring at B1 Systems GmbH who have been tireless in testing packages and reporting packaging bugs and other problems. Thanks also to Gregory Haskins with whom I started the packaging effort early in december.