eXtreme uPdating

November 28th, 2009

I had that machine sitting in my living room which was once a media player, but is now (after I implemented VDR recording playback on my satellite STB :-) ) only used for playing back the recordings of my i4l-vbox answering machine. It was still running 10.3.
Now, having read that 10.3 was out of service, I decided to finally kill it.
So how to do that with style? Well, update it!

I removed the 10.3 repos and added the 11.0 repos. (Does anybody still remember how slow package management actually was back then? It was horrible!) I did not trust the old zypper to already having implemented a proper “zypper dup”, so I updated with the YaST FACTORY module.
At first, YaST FACTORY updater refused to do a 10.3=>11.0 update. Well, edit the SuSE-release file and voila - it thinks it’s a 11.0=>11.0 update.
Only a few Package conflicts (I had lots of stuff installed, including self-built RPMs and Packman packages) and thus half an hour waiting for the resolver, then I found out, that the packaging had switched from bzip2 to lzma at that time, so yast could not really install anything, but updating rpm manually behind YaST’s back solved that. About four hours later (this is a lowly Toshiba Tecra with P3-1000 and 256MB RAM), I had 11.0 on the machine.

To my big disappointment, everything was still working!
Ok, so remove the 11.0 repos, add the 11.1… and zypper dup you go. Now I did not even have to patch SuSE-release…
Again, a few hours later (zypper was faster on 11.0, but not as fast as today), I had an 11.1 on the machine. And still, everything was working well, there even was still KDE3 on it.

I had intended to kill the machine, so I was not satisfied.
Remove 11.1 repos, add 11.2, zypper dup….
Yes! Finally, the X server did not produce a picture on my LCD TV (which is pretty picky about the VGA input signal, but did work before) anymore. Strike! But it was easily fixed: I just removed xorg.conf and at least had a 800×600 KDE4 Desktop. Installing sax2 (it had become lost in some conflicts, which I generally solved by “remove everything”) and calling it fixed that up also.

What was actually a pity is, that no attempt had been made to import the KDE3 config (I had a few custom mime types etc, and now will have to reconfigure everything from scratch), but apart from that, the only thing I had to do was remove the kdm from KDE3 which was still installed and use the KDE4 kdm, so that logout and shutdown etc. properly work.

All in all it was pretty impressive, and I thought by myself “that’s like the stories the debian users always tell about upgrades”.

…and even though I wanted to, I will probably not get to do a fresh installation of 11.2, since all my updates went so well ;)

But what I found out in the end was, that KDE4 is really no longer usable on such a machine. Everything was very slow and sluggish, even with eye candy turned off as much as possible. But for the projected use of this box, XFCE will do just fine.

USB Boot Enabler

November 24th, 2009

Since a few(?) releases, you can simply “dd” your openSUSE ISO-file onto an USB stick and boot from that, which is pretty cool and which I use a lot.
But recently, I came across a machine that simply does not boot from the USB stick. No matter what settings I tried in the BIOS - no boot. I believe it will only boot from internal hdd, internal CDROM or internal floppy and via PXE.
Instead of just burning the ISO onto a CD and using that (that would have been too easy, wouldn’t it?), i booted an old rescue system I had still lying around on CD and found out, that the BIOS actually does enumerate the USB stick on boot, at least it shows up in /sys/firmware/edd and /dev/disk/by-id/edd-int13_dev81, so I wondered how to boot from it.

The answer was easy: Just copy what the openSUSE CD does for “boot from local harddrive”. It’s actually very easy (/tmp/x is the root directory for the ISO)

mkdir -p /tmp/x/isolinux
cp /usr/share/syslinux/isolinux.bin /tmp/x/isolinux/

Then create a /tmp/x/isolinux/isolinux.cfg file, with the following content:

say ***********************************************
say seife's USB boot enabler
say enter 0,1,2,3 for disk 0-3
say disk 0 is usually your local built-in harddrive
say disk 1 is probably your USB stick
say ***********************************************
label 0
        localboot 0x80
label 1
        localboot 0x81
label 2
        localboot 0x82
label 3
        localboot 0x83
default 0
prompt   1
timeout  0

That’s it!
Create an ISO from it with:

genisoimage -o /tmp/sys.iso \
    -b isolinux/isolinux.bin -c isolinux/boot.cat \
    -no-emul-boot -boot-load-size 4 \
    -boot-info-table \
    /tmp/x

And burn onto a CD. Voila, your USB boot enabler is ready!

Now I only need to find a small credit-card size CD-R blank somewhere ;)

And maybe Steffen Winterfeldt puts something like that as a hidden option into the default openSUSE ISOs. It would be quite useful IMHO.

Morons

October 10th, 2009

Holy cow.
After seeing how those boycottnovell *peep*s interpreted my last post, I’m pretty sure that they are also fans of those “the moon landing was staged in hollywood” conspiracy theories…

Boys, if you want to get your facts right:
It’s pretty normal for someone to get a new job after almost 9 years. Especially if the old job was 400km away from home and family and the new one is 9km away.
Of course I had already written that, but obviosly you are not good at reading.

New Challenges

October 4th, 2009

Some of you might have already noticed it: I’m no longer working for SUSE.
To avoid any misunderstanding: It was my very own decision to leave, and it was not an easy one.
I was almost 9 years at SUSE in Nürnberg, which is 400km away from home and my family. Now I moved to a job closer to home: less than 10km.
I’ll still be doing linux development, in the embedded area, which is a pretty exciting and interesting opportunity for me. My machines will of course still run openSUSE, and so there’s no doubt that I will have to fix the occasional bug from time to time…

Now I only need to find out how to change that @opensuse email address so that it points to a valid mailbox again… ;)

Using PAN/NAP instead of rfcomm/ppd

August 10th, 2009

I finally got a new mobile phone - one that not only supports rfcomm (”serial port” via bluetooth) but also the “PAN Network Access Point” profile - which allows a computer to connect to the internet easily, without many extra layers like PPP etc.

It’s actually quite easy to use. (Note: I’m doing all that on recent openSUSE Factory, but I am pretty sure that it would work just as good on plain 11.1)

It is very handy to have the bluez-test package installed, many of the tools I am using are in that package.
First, we need to create a connection to the phone, exchange PIN numbers etc. I use bluetooth-applet from the gnome-bluetooth package (or the one from bluez-gnome) for that, it’s just the best maintained tool for the task, even if you are a KDE guy like I am, I’d highly recommend it.

Now we need to find out the phones Bluetooth-Address (bdaddr):

seife@stoetzler:~> test-discovery
[ 00:24:EF:xx:xx:xx ]
    Name = seife C510
    Paired = 1
    LegacyPairing = 1
    Alias = seife C510
    Address = 00:24:EF:xx:xx:xx
    RSSI = -54
    Class = 0x5a0204
    Icon = phone

The hex number after “Address” is the bdaddr of your device.

Now we can create a network device:

seife@stoetzler:~> test-network 00:24:EF:xx:xx:xx nap
Connected /org/bluez/16833/hci0/dev_00_24_EF_XX_XX_XX to 00:24:EF:xx:xx:xx
Press CTRL-C to disconnect

Now you should have a bnep0 network interface and can (as root) either run dhcpcd directly on it, or create a config file “ifcfg-bnep0″ in /etc/sysconfig/network like this:

BOOTPROTO='dhcp'
NAME='pand network device'
STARTMODE='auto'
USERCONTROL='no'

and then call “ifup-dhcp bnep0″.

Two things to consider:
First, if your system is using NetworkManager, you don’t get DNS addresses into resolv.conv. See this post for details. I now have

NETCONFIG_DNS_POLICY="STATIC_FALLBACK ppp0 bnep0 NetworkManager"

in my /etc/sysconfig/network/config

Second, test-network will terminate the connection after 1000 seconds (it is only a test tool), but it is easy to fix, just copy it to ~/bin/my-test-network (or whatever name you like) and apply the following trivial diff:

--- /usr/bin/test-network
+++ ~/bin/my-test-network
@@ -35,9 +35,10 @@
 print "Press CTRL-C to disconnect"

 try:
-       time.sleep(1000)
-       print "Terminating connection"
+       while 1:
+               time.sleep(1000)
 except:
        pass

+print "Terminating connection"
 network.Disconnect()

I’m not a python wizard, so I’m pretty sure you can do better, but it works well for me.

U-Boot hacking -or- The dbox2 can boot from disk!

July 6th, 2009

Thanks to a kind donator, I now own a Nokia dbox2 with IDE interface. (For those that don’t know - the dbox2 is a settop box designed for german paytv 10 years ago in a way that its bootloader would only run signed software. A limitation that was put aside by some cool hackers early in this century. Nowadays it usually runs Linux on its 66MHz powerpc CPU, 32MB RAM and 8MB FLASH ROM. Later some cool guys designed an IDE interface that plugs into the memory expansion slot)

The main use of such an IDE interface for most people is to use the box as a video recorder. However, I am already doing this via the ethernet port, wich is more practical for me than a built in disk.

I would have deemed it much more useful if I was able to boot from the IDE drive, since that would make it much easier to try out new experimental code without needing to upgrade the FLASH image all the time (having the known working version in FLASH as a fallback is mandatory for good WAF).

So I pondered the problem and found out, that people had already implemented basic support for the IDE interface in U-Boot (which is used as a “second stage” bootloader), and it could already access and read the disk.

Unfortunately, U-Boot needs to be in FLASH, and this U-Boot would then only boot from disk.

So I have been hacking on making U-Boot actually read multiple boot command lines (and and option which one to boot as default) from a config file in the /var/ partition of the FLASH which makes it pretty easy to switch the device we boot from. It is now actually similar to the boot process of the Tripledragon.

The only thing that’s missing now is a driver for the front panel keys, so that you can change the selection on the fly without using a serial console. That’s coming next, after the summer vacation ;)

Back from Linuxtag 2009

July 1st, 2009

I finally managed to upload my slides to the openSUSE Wiki’s Linuxtag 2009 page (I actually had nothing to do with openSUSE this year, but somebody had already listed me on that page and it’s actually pretty handy to host the slides there). I also uploaded it to the Linuxtag site, but after experiencing really abysmal organisation this year, I doubt that it will appear anywhere there.

The talk was not that exciting in my point of view - “Netbooks” are, in the end, a pretty boring topic to talk about - but the attending crowd seemed to like it, so apparently it was at least entertaining ;)

The event itself was better than what I had expected from the organisation flaws, I did talk to some embedded people and made many interesting contacts, e.g. with beagleboard guys, peple from the openembedded project and of course the cool hackers from coreboot.

So after a disappointing start, Linuxtag 2009 finally ended pretty successfully for me.

Caroline Keating

June 11th, 2009

She describes herself as

I’m just a girl who likes to tinker on her piano at 2 am and make up stories…

And that’s what she did (not at 2 am, though) yesterday in Nürnberg’s Musikzentrale in a really great concert.

I’ll keep it short, it is hard to put into words anyway, but that really was a touching experience. Maybe even more than last year’s Leonard Cohen concert in Berlin.

…maybe it is no coincidence that both are from Montreal?

Now only Christian needs to get the Photos posted on his sitewhich he finally did. Thanks!

BTW: if you wan to see more great concert photo’s, Christian Deckelmann’s website is a must. (You’d never guess that he is a (really cool btw) network administrator in real life ;-) )

Improving XFS unlink() performance

May 28th, 2009

I knew for quite some time that XFS has an abysmal performance on huge deletes - e.g. deleting a Linux kernel source tree can take several minutes. But when I had to do multiple images with kiwi yesterday on my relatively new server machine at home, it started to really annoy me, so I invested some time to find out if there is a way to improve the situation.
This is what I started from (numbers are from bonnie++):

/dev/sda1 /space3 xfs rw,noatime,nodiratime,noquota 0 0

Version 1.01d       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
server           4G 69024  31 71616  10 32732   6 75462  39 77511   6 120.9   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16   341   1 +++++ +++   311   1   340   2 +++++ +++   249   1

The first hint I got from a colleague was to use “logbufs=8″ mount option. This increases the number of buffers that XFS uses for its log. Whatever that means. At the first try, it did not change anything until I realized that a “mount -o remount,…” was not enough, I had to unmount and newly mount the filesystem with the option to make it work.
This is the result, still not too impressive with regard to delete performance, the difference might be purely statistical noise:

/dev/sda1 /space3 xfs rw,noatime,nodiratime,logbufs=8,noquota 0 0

bonnie++:
Version 1.01d       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
server           4G 66413  31 68420  10 32467   5 76001  40 77143   6 107.2   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16   338   2 +++++ +++   313   1   332   2 +++++ +++   269   1

But the really good results came only after also increasing the logbuffer size with the “logbsize=262144″ option:

/dev/sda1 /space3 xfs rw,noatime,nodiratime,logbufs=8,logbsize=256k,noquota 0 0

Version 1.01d       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
server           4G 77932  33 85196  10 32134   6 59205  32 76792   6 184.5   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  1495   5 +++++ +++   848   2  1468   7 +++++ +++   916   3

Now that’s a real improvement and I’ll keep it like that.

But beware, there are some caveats:

  • The file system has to support the larger buffer sizes, which means you need a sufficiently new kernel. As I am running openSUSE 11.1 on this machine, this is not really a problem, but I had to enable the “version 2 log format” with “xfs_admin -j /dev/sda1″ because this partition was created using SLES10 and I am not sure if I still would be able to mount it on an old machine.
  • It will use more memory. I guess that it needs at least 2 MB (256kB * 8 buffers) per filesystem, probably more. But on a box with 2GB of RAM, I’ll gladly spare that for better performance.

One note: those “measurements” were taken on a Core2 Duo machine using an abit IP35-E mainboard. The used disk drive was my old Maxtor STM3500630A 500GB IDE drive. I did not do any statistical corrections etc., so your mileage may vary.

Cross compilers for openSUSE

April 30th, 2009

Based on Torsten Duwe’s great work (currently in the Buildservice in home:duwe:crosstools), which is building but not working 100% correctly, I fixed the powerpc version up (I have no other architecture to test on) and put them into the openSUSE Buildservice in home:seife:cross for now.
Get them from here: http://download.opensuse.org/repositories/home://seife://cross/SLE_11
(don’t get put off by that SLE_11, the cross compilers should be pretty system agnostic. For testing I ran them on a SLES10 which is probably older than anything you want to use, and they worked just fine)

Edit: I just found out that this only works because I have a patched rpm on my SLES10 which understands lzma compression. I have added SLES10SP2 to the repository so that pre-LZMA-rpm distributions still can use it.

So if you need a powerpc crosscompiler, just add that repository, install packages “cross-powerpc-embed-linux-gnueabi-binutils”, “cross-powerpc-embed-linux-gnueabi-gcc”, “cross-powerpc-embed-linux-gnueabi-glibc” and “cross-powerpc-embed-linux-gnueabi-kernel-headers” and you are ready to go.
Make sure that /opt/cross/bin is in your $PATH and configure your project for target “powerpc-embed-linux-gnueabi”.

Still TODO: get them into a proper semi-official project.

Oh - and of course I already changed my favourite embedded projects so that they are now able to build with an “external” toolchain ;)