Index ¦ Archives ¦ RSS > Tag: en

Splashy vs. systemd

Estimated read time: 2 minutes

So we have this systemd wip repo and one of the remaining todo items was to fix up splashy to work with systemd.

First, why doesn’t it out of the box of systemd is a drop-in replacement? Because splashy is not a simple init script, it hooks itself to rc.sysvinit, so it was specific to sysvinit.

Now given that plymouth was already ported to systemd, it served as a good example. You may also ask: why don’t we just switch to plymouth? Because:

  • we don’t want to introduce multiple changes at the same time

  • it requires kms, while Splashy did not require it - so as long as it’s not true that most video cards support kms (think of via or anything else which supports vesafb, but not kms), such a switch would be a regression

Okay, enough anti-Plymouth rant. As you can see, right now the task is to fix Splashy.

The steps I did were:

  • updated the Splashy theme to remove the progressbar: given that now we start services parallel and on-demand, it does not really make too much sense

  • introduced unit files: to start on boot, to stop before getty/xorg, to start before kexec/reboot/halt/poweroff

  • added the usual compatibility symlinks to avoid starting the old rc.splash (which would happen anyway)

  • added a simple wrapper that fires up splashy and once it’s ready it sends the Booting…/Rebooting…/etc text to it

The last problem is a bit more complex: now that xorg startup wants to stop splashy, a dependency has to be declared. xorg startup is handled by prefdm.service, but in case it depends on splashy-quit.service, what will happen if you don’t have or don’t want a splash?

The solution for now is to declare an After= relation: that means xorg startup will happen after the quit of splashy, if it happens at all.

This way:

  • you can disable the splash, it won’t cause any dependency errors

  • if you don’t have prefdm.service enabled, you can even have splashy uninstalled

  • (this one is a bit ugly) you can disable the splash, but if you uninstall it and have prefdm.service enabled, you’ll get a dependency error, as systemd will have no idea what splashy-quit.service is.

To test the above:

  • you need to enable the systemd wip repo (see the link above)

  • run pacman-g2 -Sy systemd

  • boot with init=/bin/systemd

Stay tuned, we still have a few blocker issues before merging the (disabled by default, as you need that kernel parameter) systemd support to current.


amtterm

Estimated read time: 3 minutes

So we have two machines next to each other: genesis and helicon. The original idea years ago was to put a serial cable between the two so that it’s possible to manage the machines even in case ssh dies for some reason. Of course we never did that, because we were lazy - but in the meantime both machines were replaced by a newer mainboard, supporting Intel AMT.

In short, this is a poor man’s IP console, it supports serial-over-lan, so with a bit of configuration and a special client tool you can control grub, watch the bootup process (will you miss the risky few minutes after a reboot till it turned out if a remote machine boots up after a kernel upgrade or not?) and finally can even log in when ssh is not running.

First you need to set up grub to listen on the serial port as well. To do this, you need to know the device name and I/O port of your serial-over-lan port. The boxes mentioned above have one physical and one virtual serial port, so we need the later - that will be /dev/ttyS1. Now let’s grep in dmesg to get the port:

$ dmesg|grep 'ttyS1 at'
0000:00:03.3: ttyS1 at I/O 0xf1c0 (irq = 17) is a 16550A

Now we know everything to set up grub. Just prepend the following lines to your /boot/grub/menu.lst:

serial --port=0xf1c0 --speed=115200
terminal --timeout=30 console serial

The speed is AFAIK the same for each SoL port, so you can just copy&paste it.

It’s also recommended to change the timeout line to 30 as well, this way you will have half minute to press any key to tell grub you want to control is on the serial port and you’ll again have half minute to hit any key to edit the kernel parameters, etc. (The whole grub part is useful because this way in case you upgraded the machine and it fails to boot up, you can still boot using init=/bin/sh and fix the system.)

Second, you want to see the boot process, this way you can fix the system remotely, even if fsck fails and asks for root password, etc.

For this, you need to change your kernel parameters, so that messages sent to /dev/console will end up on the serial port.

I changed

root=/dev/md0 ro quiet vga=791

to

root=/dev/md0 ro vga=normal nomodeset console=ttyS1,115200

and that achieved this.

Third, you want to start a getty on ttyS1 once the machine booted up, in case ssh fails to start up. If you don’t use systemd yet, add the following line to /etc/inittab:

s1:12345:respawn:/sbin/agetty ttyS1 115200 vt100-nav

(Don’t forget to run init q to reload the config!)

Finally, you need amtterm on the client side - I plan to package it for Frugalware once 1.4pre2 is out. Till then you can just download, unpack and build the source tarball using make - no installation is necessary, you can run amtterm in-place. In my case I can’t connect directly to the machine as (for obvious reasons) the AMT is reachable from the local subnet only. So I build an ssh tunnel to the other machine and use socksify to pretend I run amtterm on the local subnet. The commandline I use is:

$ socksify ./amtterm -p <pass> <ip>

And that’s it - enjoy editing your kernel parameters, watching your boot process and login to the box even if ssh is not running and you don’t have IP console. :)

If you can’t try it out right now but you want to see it in action: grub in amtterm and boot in amtterm - without any virtualization! ;)


How to get rid of Wikipedia spam header

Estimated read time: 1 minutes

You probably already noticed it. I have no major problems with Jimmy Wales, but given that this spam header will not be hidden even after you donate (since I browse Wikipedia without logging in), this is really just spam. Here is a nice greasemonkey script to get rid of it.


TDF Interview

Estimated read time: 1 minutes

The Document Foundation guys made an interview with me. In case you find out there something new about me, happy reading!


BitlBee-Skype 0.8.4

Estimated read time: 1 minutes

I just released 0.8.4. The happy thing about it is that basically the only fix I added to this release is to make it work when python is python3k (so we need to use python2.7 to get python2 support), but the rest is just merge from:

  • email

  • github

  • Debian

Now the total number of contributors increased to 7. :)


LibreOffice comment finder

Estimated read time: 1 minutes

So I wrote a short script to find undocumented classes in the LibreOffice source code - I don’t mean when some of the public methods are not documented, but the case when the class itself doesn’t even have a one-liner mission statement.

Of course it should be used with care - if someone starts adding bullshit or misleading documentation using this script, that just makes the situation even worse.

The patch generated a nice thread where basically they argue if it makes sense to have a KDE-like API documentation for LibreOffice or it’s just better to refactor code to have self-documenting function names, etc.

At the end of the they, looks like there are people who find it great. :) (In the meantime that patch has been pushed, of course.)


Poor man's PDF duplex printing

Estimated read time: 2 minutes

Yesterday I wanted to print a PDF document: two pages per sheet, and of course I wanted duplex printing as well (on the short side).

Given that the hardware (the printer) was not capable of duplex printing, I needed some software workaround. If you want one page per sheet, this is trivial, as the print dialog of any PDF reader will let you select "odd pages", then you re-feed the printer with the output paper and you select "even pages" and that’s it.

OTOH, if you want 2 pages per sheet, then first you need some trick first to create two PDF from the original: the first containing the pages 1, 2, 5, 6, etc. - and the other containing 3, 4, 7, 8, etc.

After all this isn’t really hard using pdftk. First, the input PDF was around 150 pages, so I wanted to split the input to one file / page:

pdftk in.pdf burst output out/%03d.pdf

Then let’s move the pages to the subdirs a or b, based on the above pattern:

cd out
mkdir a b
for i in *.pdf
do
        base=$(basename $i .pdf)
        if [ $base -lt 100 ]; then
                rem=$(($(echo $i|sed 's/^0\+\(.*\)\.pdf/\1/')%4))
        else
                rem=$(($base%4))
        fi
        if [ "$rem" = 1 -o "$rem" = 2 ]; then
                mv $i a
        else
                mv $i b
        fi
done

Finally concat the files from the a and the b dir to a single file:

cd a
pdftk *.pdf cat output ../a.pdf
cd ../b
pdftk *.pdf cat output ../b.pdf

That’s it!


libwpd-bindings-0.1.0

Estimated read time: 1 minutes

I tried to search back when did I create Java bindings for libwpd - it seems this was the first commit.

First I kept back the source code to get some money for it (there were a customer who seemed to be willing to pay, but then disappeared), then I just abandoned the idea and pushed it to SourceForge.net to some CVS repo, (I even mentioned it in a blog post), which is finally now converted to git.

Long story short, a week ago finally Fridrich released the first version of the code, after about 2.75 years. :)


OSL_TRACE()

Estimated read time: 1 minutes

Background: OSL_TRACE() is an internal LibreOffice macro that is like printf(), but it’s only enabled in debug mode. Without it, you would add a debug printf during development:

printf("debug, foo\n");

then you would comment it out when the code started working,:

//printf("debug, foo\n");

then remove the comment when it breaks again, etc.

In the past, if you built a LibreOffice module, then you executed:

build

inside a module, and in case you wanted debug symbols and such messages you built using:

build debug=t

which increased the debug level to 2 (from 0), where 1 is required for debug symbols, 2 for debug messages. (See the OOo wiki page.)

The recent update, why I’m writing this post: Now this has been changed, and debug=t gives you debug symbols only, but no extra debug output. While this is great in most cases, sometimes you still want the old behaviour to get the debug messages. In that case the solution (as pointed out in the mailing list post) is to use:

build debug=t dbglevel=2

(Hopefully this post will be handy for who missed that post, like I did the first time.)


Rejourn: Using an unpatched version

Estimated read time: 1 minutes

One may have noticed that right now my rejourn tree is empty. That’s not an accident, after Ram accepted my 15th patch, finally the site runs an unpatched version of rejourn - of course with a custom config and design.

Of course I still have a few ideas on what to improve, so this is not the end of the story, but still - I’m happy he was so open for changes and new features that we reached this post. :)

© Miklos Vajna. Built using Pelican. Theme by Giulio Fidente on github.