October 23rd, 2012
Yesterday I finally figured out how to use the virtio console on KVM, which is very easy once you know what to do.
A short explanation of what a “virtio console” is:
On paravirtualized environments like Xen the VM (guest) has no direct hardware access, but also no emulated hardware but instead needs special drivers that know it is running on a hypervisor. The advantage of this approach is that you don’t need to emulate hardware and that the driver for the guest is often much simpler (it does not need to probe hardware, for example, as it talks to the hypervisor via a special interface). This makes for a very convenient default Xen setup where you can just do “xm console ” on the hypervisor and get a functional console without any fiddling.
On fully virtualized environments, usually an emulated serial port is used for that, which is harder to set up. It is not impossible, but definitely not that easy and there is quite some stuff to configure to get it working.
Nowadays even fully virtualized systems often have some paravirtualized drivers available, mostly for performance reasons. One of those paravirtualized drivers available with KVM is the virtio console driver.
So back on topic: how to set up the virtio console driver for a KVM guest
First, edit the configuration of your guest, in my case with “virsh edit factorytest” (factorytest is the name of my guest). Add the following snippet of configuration before the closing “</devices>” tag:
<target type='virtio' port='0'/>
Then a few things need to be done on the KVM guest. In my case of an openSUSE 12.2 guest, the virtio_console module was loaded automatically. However, it surely won’t hurt to put it into INITRD_MODULES in /etc/sysconfig/kernel.
The second thing is “console=hvc0″ needs to go onto the Kernel command line.
The easiest way to accomplish this is to use the YaST bootloader module and add it in the “Boot Loader Options” tab. You need to actually make sure there is “console=tty console=hvc0″ there, because without the “console=tty” the system did not boot up cleanly for me. I guess that the kernel is not happy with only a console that gets added later via a module, but I need to investigate that.
All the rest was handled by systemd and friends just fine, after rebooting the VM guest, I was immedately able to do “virsh console factorytest”, hit “Enter”, get the login prompt and log in.
September 10th, 2012
Now who would have guessed the guys that are good at trademark trolling (they withdrew their trademark application after other users of the name “Neutrino” complained, too, now they are trying to get new variations of the neutrino brand) are apparently not very good when it comes to hardware engineering?
The power supply of my coolstream neo box died of blown out capacitors after only 18 months — which tells you about the hardware quality IMHO. I own a lot of electronics but have never seen this happening after such a short time.
My advice to the coolstream guys: spend a little less effort on trademark trolling and violating the GPL, instead spend a little more effort on quality assurance. I cannot say that I’d recommend this hardware to anyone.
I could probably just replace the capacitors, but that box has been just annoying lately and I have enough other well-working boxes so I’ll probably just leave it dead so I don’t need to get upset whenever I try to use it for something serious.
May 24th, 2012
This time in english
Tomorrow I’m holding the kdump talk at LinuxTag in Berlin, and since I had submitted it in english, I had to translate my short paper anyway, so here it is. It is a rather short “beginner’s guide” but it should get you started. And it’s much better than the slides as there is almost no technical details in them due to the short timeslot (30 minutes) I got.
April 28th, 2012
While investigating inferior LIRC performance today, I checked the timings used by IRMP and found that using those instead of the “measured” ones of LIRC in the config file made LIRC perform much better. See the patch for details.
Looking at the lircd.conf more thoroughly for the first time, I finally found the similarities between the lircd remote control codes and the IRMP codes (at least for the NEC protocol used with this handset):
- IRMP “address”:
- IRMP “command”:
- lircd “pre_data”:
- lircd “code”:
The IRMP Documentation (sorry, german only) describes the NEC protocol as follows:
32 bits of data: 8 address bits + 8 inverted address bits + 8 command bits + 8 inverted command bits
The IRMP “address” is really 8 bit only:
0xBA inverted is
0x45, leading to an “effective address” of
The IRMP “command” is already 8 bit only.
Now double-check with the lirc codes: address
0xA2 inverted =
0x58 inverted =
0xA7, so the scheme seems to apply to both.
Using only the relevant 8 bits:
- IRMP address:
- IRMP command:
- lircd address:
- lircd command:
Looking closely, I found that the difference is actually the LSB / MSB order: IRMP is shifting the bits in reverse order compared to lircd.
So if needed, it should now be pretty easy to extract codes for IRMP from lircd.conf files using a simple perl script or the other way round, at least for NEC codes. Lircd has the advantage that you can easily “learn” your new remote control handset with an interactive program (if you disregard the suboptimal timing data it creates).
March 18th, 2012
(German only, the paper is also only available in german right now).
Zur Zeit halte ich Vorträge über kdump, unter anderem auf dem GUUG Frühjahrsfachgespräch 2012 und den Chemnitzer Linuxtagen 2012.
Da die Dauer der Vorträge meist auf ca. 45 Minuten begrenzt ist, enthalten die Vortragsfolien nur wenig technische Details. Für den Tagungsband des FFG 2012 habe ich jedoch einen Artikel geschrieben, der als Einstieg in das Thema besser geeignet ist. Diesen Artikel gibt es hier.
February 9th, 2012
Imagine there is a GPL’d open source project, going strong for more than 10 years, with more than 50 contributors. Now a company comes along and registers the name of the project as a trademark with the clear intention of suing people using this name to sell equipment with the software preloaded.
They are not contributing to the project.
Is there anything the project can do about that?
The opposition deadline (german: “Widerspruchsfrist”) is not over yet.
Oh - and of course they are blatant GPL violators, linking the project’s GPL’d software against closed source libraries which in turn use closed source kernel drivers, ship a U-Boot version of which nobody has ever seen the sources and so on, but that’s a different story.
January 28th, 2012
I needed to implement an infrared remote control decoder, so certainly I took out my Arduino and hooked up an IR sensor chip to pin 2. Then the interesting thing started. Looking around, I found ladyada’s tutorial on IR sensors. However, the method used there is pretty limited (you basically record a sample of each key signal and then compare the received signal to your samples) and unreliable for many protocols.
Then I found IRMP (german only link, sorry) which is a very versatile IR decoder for many protocols. However, IRMP is made to be used with plain avr-gcc, not from within Arduino’s IDE.
But fixing that was really not very hard.
The results are available on gitorious, project arduino-addons/irmp-arduino, including a simple example sketch to test the decoder.
Note that I’ll probably rebase the git tree whenever something happens in the IRMP SVN repository, so be aware of that in case you make local changes to the code and want to update from my tree.
December 29th, 2011
GNOME3 has actually become quite usable, but I was really annoiyed by the inability to disable actions on “critical low battery” (Additionally, there is no way to define what “critical low battery” is and with a big battery I assume this might well mean that you cannot use the machine anymore even though there is half an hour of juice left). Add to that bnc#738782 which leaves my screen unlocked after suspend and I decided it was time to use someting sane — like xfce4-power-manager — instead.
However, it’s not that easy, as everything power related is hard-coded into the gnome-settings-daemon — and even in different places.
So here is a package with a patch that simply disables the handling of all the power-related keys in the media-keys (!) plugin and additionally prevents the build of the power plugin completely.
Now just start xfce4-power-manager (and maybe use the Evil Status Icon Forever shell extension to make it show up in a visible place).
The patch is here, it is clearly not upstreamable but I’d rather have an ugly hack than an unusable “good solution”
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
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.
November 22nd, 2011
In a VirtualBox guest, VBoxService (which is for example responsible for setting the time after a host suspend/resume) is not started on boot. I thought about writing a simple init script to doit (editing the vboxadd init script seemed like a bad idea, since it might get overwritten on updates).
Then I decided to try the “native systemd” way.
Executive summary: it is much easier than with old style SysV init:
# cat /etc/systemd/system/vboxservice.service
Description=VirtualBox guest services
systemctl enable vboxservice.service.