Archive for the ‘work’ Category

If you don’t want to fight package maintainers…

Friday, December 23rd, 2011

…then work around the bug.

One example is bug 699400: hwclock is never set correctly when NTP is used (unless it was almost correct before…).

I reported the bug, I argued with the maintainer, it did lead to nothing, the bug was “RESOLVED INVALID” (interesting notion: either it is resolved or it is invalid, then there is nothing to resolve…)

What’s my workaround? I exploit the fact that old SysV init uses bash scripts. The init script which sets the clock does source /etc/sysconfig/clock. Internally, it uses a variable ELEVENMIN_MODE.
So what did I do? Simply add

readonly ELEVENMIN_MODE=no

at the end of /etc/sysconfig/clock.
The script will throw some errors on boot and shutdown due to its inability to change a readonly shell variable, but I can live much better with a harmless warning than with a totally wrong system time at each reboot :-)

Update: Werner has pointed out in the bug that this is totally wrong and will make a mess of your time settings, so use this at your own risk. OTOH I have more than 2000 productive systems here running with this. We had lots of problems before and have no problems anymore after doing it like described here. So at least for me the wrong solution works good.

openSUSE 32bit to 64bit live conversion

Friday, February 25th, 2011

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.

Making Windows Usable

Saturday, February 5th, 2011

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.

OpenStack “bexar” packages for openSUSE and SLES11SP1 are ready

Thursday, February 3rd, 2011

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.

Load average

Friday, January 28th, 2011

No comment:

  2:05pm  up 79 days  6:40,  5 users,  load average: 2948.98, 2948.04, 2945.49

(Later we found out that the load was actually “fake”, the kernel had somehow died and everything accessing /proc/$pid/* was hanging in state D)

Don’t Ask

Wednesday, January 26th, 2011

(No, it was not me who made this necessary. Yes, we did reinstall the machine anyway.)

#!/bin/bash
while read p; do
  rpm -V $p > /dev/null && continue
  echo "fixing $p's file ownership..."
  while read x x u g x x x x n x; do
    chown -h $u:$g $n
  done < <(rpm -qlv $p)
done < <(rpm -qa)

Nifty dnsmasq Trick: Reverse Lookup using a specific Server

Tuesday, June 22nd, 2010

With dnsmasq, it’s easy to look up a whole domain using a special dns server. The option is

   --server=/foo.corp/10.11.12.13

This will look up everything “*.foo.corp” using nameserver 10.11.12.13. So far, so good. But today I also needed the reverse lookup for a specific IP adress zone to be done via a specific nameserver. Reading the manpage, I found no option for that, but then I remembered stuff that I had learnt in a distant past: that reverse lookups are actually a name lookup of the in-addr.arpa zone, with the “reversed” IP address. So I tried

  --server=/10.in-addr.arpa/10.11.12.13

and that one works fine, looking up everything 10.x.x.x using 10.11.12.13.

And it still was much easier than using ugly bind. That’s why I prefer dnsmasq in daily use over bind, dhcpd and all the other crap. It just works ;)

Rebuilding a single kernel module

Wednesday, April 28th, 2010

Due to Bug 596844, I had to rebuild the i915 module with a patch. I have done things like that quite often over the last years, and every time I have to dig through the documentation, so I’ll put it up here in the hope that I’ll find it easier in the future and that it might be useful for somebody else ;)

There are only a few steps, following the README.SUSE in the kernel-source package:

  • install the kernel-syms and kernel-source packages
  • copy the kernel sources to some other place where you have write access as a normal user (this is not in the README, but I hate doing stuff like that as root, so I’m doing it anyway)
  • patch the source
  • build the module

Or, as an almost-copy’n'pasteable list of commands:

cd /tmp
cp -a /usr/src/linux/ . # do not only copy the symlink ;)
cd linux/drivers/gpu/drm/i915/
patch < /tmp/i915-nofbc.diff # your diff
make -C /usr/src/linux-obj/x86_64/desktop M=$(pwd)
ls -l i915.ko

You need to adjust the directory given to “make -C” to your desired kernel flavour, of course, but that’s it. Copy the module over to /lib/modules and reboot (I usually save the old module somewhere else, in case something goes wrong, but you probably figured that out already).

Followup: Accounts in Claws-Mail

Wednesday, April 14th, 2010

Just to let everyone know that it was me being blind and not Claws-Mail lacking the function to rearrange the Folder list. As Paul pointed out in his comment on my post, there is “File -> Change Folder Order”, pretty much on top of all other options. So no need to pull out your favourite editor and mess around with XML files ;)

(Sometimes I’m wondering why I am not finding easy stuff like that anymore. My wife or children would probably have found it immediately. Maybe I’m not looking hard enough, because I’m not expecting it to be there? Maybe I’m just spoiled by 10 Years of using console tools for almost everything? I know that I tried to drag and drop the accounts, even though I do not really like drag-n-drop for such configuration changes, because it could happen accidentally. Or, in other words, the “Change Folder Order” menu entry is pretty well matching my personal taste of how such things should be implemented, but I did not find it anyway. Am I the usability designers nightmare after all? Who knows ;) )

Rearranging Accounts in Claws-Mail

Sunday, April 11th, 2010

I recently added a new account to my Claws-Mail configuration. That account will soon become one of my main accounts, so I was not happy about it being shown on the bottom of the folder list, below all my less important accounts.
Using the GUI, I could not find a way to move it around. I already thought about manually changing the configuration, editing all the references for all accounts.
Fortunately, when looking around the ~/.claws-mail directory that contains everything, I found folderlist.xml which is an easy to understand (and edit) XML file that describes how the folders are displayed. I did no fancy stuff, just moved the <folder type=”imap”…> … </folder> block, that corresponds to the new account up to the first place and voilá — it works.
BTW: Claws-Mail is still my favourite email client after using it for over a year - that clearly is a new record ;)