Nov 9, 2009

Live upgrade from openSUSE 11.0 to 11.2

Article update: it turns out many people come here hoping to find a solution and are disappointed to find only problems that I encountered.. Sorry, that's too bad. Until someone figures out a way to do it online, your best option is to boot off the Network installation CD (100MB).

On Saturday I upgraded my wife's laptop from openSUSE 11.0 to 11.2 RC. I did it using zypper dup, and there were some problems so here I describe them for the benefit of others who might try the same.
  1. Edited /etc/zypp/repos.d/* to replace all 11.0 occurences with 11.2. It worked also for Packman and Videolan.
  2. zypper in zypper offered a suspiciously large update. It turned out it wanted to switch from x86_64 to i586, boo! The fix was zypper in zypper.x86_64\>1
  3. That did not go well. It installed the new rpm.rpm and then repo2solv failed, terminating the transaction. After that, I had the old libzypp and the new zypper, not working. So I manually downloaded the libraries and installed them using rpm, ignoring the broken dependencies for the yast2-* packages.
  4. Changed commit.downloadMode to DownloadInHeaps in /etc/zypp/zypp.conf, which exists primarily to avoid the previous problem. But Murphy does know when to strike.
  5. zypper dup
Note that from 11.1 to 11.2, I used the live upgrade method without such problems. But for 11.0, you may be better off booting from an installation disc.

Nov 2, 2009

The suse-ncc User

Got a question about the purpose of suse-ncc:x:106:110:Novell Customer Center User:/var/lib/YaST2/suse-ncc-fakehome:/bin/bash, and Google did not know, so I asked the usual suspects.

Answer: It comes from yast2-registration.rpm and is used to switch away from root when we spawn the web browser and let you register your SUSE Linux Enterprise product.

Thanks, mc.

Oct 15, 2009

resolv.conf empty, resolv.conf.netconfig ate the data

Problem: After a reboot, /etc/resolv.conf says just # Generated by NetworkManager and the real data went to /etc/resolv.conf.netconfig. I have both eth0 and wlan0 activated by NM. My setup does not involve dial-up like Seife's.

rcnetwork stop
rm /etc/resolv.conf.netconfig
: > /etc/resolv.conf
rcnetwork start
I wonder if this is a bug. Anyway, hopefully this will help someone. openSUSE 11.2 RC1.

Oct 9, 2009

WebYaST Beta 1

We have released Beta 1 of WebYaST. Just to prevent misunderstandings, it is intended for appliances (and Beta 1 is an appliance, a VMX for VirtualBox or VMWare), not for replacing YaST on the desktop.

Download links are in the 0.0.13 status mail, see also the module status and the replies.

Oct 2, 2009

I Will Write the Tests Later

I've read A New Look at Test-Driven Development, a 7 page article by Dave Astels. He explains that what matters is to think of specifications (@list.size.should_equal 1) instead of tests (assert_equal @list.size, 1). He wrote RSpec for this and calls it Behavior Driven Development (BDD).
I need to try this out in WebYaST (this, or Shoulda).

Sep 24, 2009

openSUSE Conference 2009 Notes: Thursday

Here are my notes from the first day of last week's openSUSE Cponference 2009. I am not happy with the form of the notes, but better now and imperfect than polished but 6 months later. Please notify me if you find errors.

Thanks to all who stood up to talk about their work! Not only code matters.

Thu 10:30 - Weekly News (Sascha 'saigkill' Manns)

slides: odp pdf

The slides have all the info.

how to contribute:
  • add a section, fill it with news
  • blog about stuff, to get picked up
  • translate or coordinate a translation
(there's a list of languages most wanting help)

A major part of slides shows how to help with translation.
There are tools to help with that:
- a script in home:dl9pf:newsletter
- Gobby, a collaborative editor

irc channel

About Sascha: he is geeky-quiet, reads the slides.
But he goes forward and is not put back by imperfections in his English.
(And you may remember his tireless packaging enterprises from

Thu 10:30 - Apport (did not attend)

Uploads crash reports to a database. Already in 11.1 but not by default.

Thu 11:30 - Ambassador Program (Zonker)

web (no slides)

To be an ambassador:
  • sign up
  • have a plan
  • membership is not required
  • organize a party, booth, launch party (11.2 on Nov 12)
  • participate in a Linux User Group
Where to spend $ on small events?
  • ambassadors will decide, wanting cost effective impact
What if you want a Novell speaker at your event?
  • it comes from their travel budget, not from the Ambassador budget
How to find a local ambassador?
Q: can ambassadors take feedback about barriers to oS adoption?
A: there is no process for that, give feedback directly to developers [ :-( ]

Thu 13:30 - libyui (Bubli)

Q (R Max): can its main loop integrate with a select on FDs?
A: no [ but not hard? ]

Thu 14:30 - openSUSE Infrastructure (Klaas Freitag)

[see slides]
Lists a cloud of existing services
Lists ideas for future services
Wants "more structure and integration" - for 3 target groups:
- newbies
- users
- geeks (developers)
Proposal for web navigation [photo of slide]. See it!
Demoes Tom's Dashboard: plugins for Studio, Bugzilla, RSS (-> OBS via Hermes)

Thu 15:30 - Software Portal (Benjamin benJIman Weber, Pascal yaloki Bleser)


Aug 31, 2009

Printing Out Ruby Code

Task: producing a paper copy of a Ruby program to scribble on.

Try 1: a2ps. openSUSE has 4.13 which does not support Ruby (although 4.14 was released on 28-Dec-2007).

Try 2: enscript. No support for Ruby even in upstream (but there exists a patch for that on the Net).

Try 3: emacs. I was not able to produce a highlighted printout from Emacs :-(

Try 4: vim. :hardcopy does it, but it printed the keywords in light yellow on white.

Try 5: kwrite. Success. Yay!

Aug 26, 2009

ruby-dbus 0.2.9

I have released a tarball of 0.2.9 and updated the home page.

From NEWS: Ruby D-Bus "I'm not dead" 0.2.9 - 2009-08-26

Thank you to Paul and Arnaud for starting the project. I, Martin Vidner, am continuing with it on GitHub.
  • Fixed passing an array through a variant (no ticket).
  • Fixed marshalling "av" (Ticket #30).
  • Fixed variant alignment (Ticket #27).
  • Added DBus::Main.quit.
  • Mention the DBus interface in a NameError for an unknown method.
  • Fixed ruby-1.9 "warning: default `to_a' will be obsolete".
  • Added Rakefile and gemspec.

Aug 24, 2009

Git Aliases for Subversion Users

git config --global commit
git config --global checkout
git config --global status
git config --global alias.di diff
git config --global alias.dic diff\ --cached

Aug 11, 2009

cnetworkmanager 0.21

As I advertised in a previous post, cnetworkmanager got a complete rewrite, and here is a summary of the changes:

v0.21, User visible changes
  • Added screenshots.html.
  • Output in a tabular form (like Tambet's nmcli); --terse/-t to disable.
  • Added --wireless-enabled/--we.
  • Added --con-info.
  • For unimplemented device types, return "unknown", crash not (Kevin Fenzi).
  • Ignore AlreadyAsleepOrAwake error (-o).
  • Flags with zero value now output its name (NONE) instead of nothing.
  • Major rewrite:
  • Created a library wrapping the NM DBus API.
  • Created a generic library wrapping python-dbus.
    (both libraries are still quite messy)
  • Dropped support for NM 0.6.
    (the last trace is in the 'breakup' branch)
  • Connection setting:
    --activate-connection for system settings or another applet
    --connect for exporting a transient connection
  • knetworkmanager (KDE3) config reading dropped
  • Added a (basic) testsuite.
  • Switched to distutils.
BTW, I also pushed the git repo to Github so that you can enjoy the fork graphs. ( stays)

Jul 21, 2009

HackWeek: NetworkManager Python library

It is Hack Week again, a time when we venture into unexplored territories. So why am I returning to cnetworkmanager?

It is because I am doing a complete rewrite, based on an easy-to-use library that hides some rough edges in dbus-python. If you ever thought NM needed some programmatic prodding but were put off by the tedious details, the library might be just the thing for you. For me, it is also an opportunity to learn more Python.

Compare how you get the interface names.
#! /usr/bin/python
import dbus
bus = dbus.SystemBus()
NM = 'org.freedesktop.NetworkManager'
nm = bus.get_object(NM, '/org/freedesktop/NetworkManager')
for dev_opath in nm.GetDevices(dbus_interface = NM):
dev = bus.get_object(NM, dev_opath)
print dev.Get(NM + '.Device', 'Interface',
#! /usr/bin/python
from networkmanager.networkmanager import NetworkManager
nm = NetworkManager()
for d in nm.GetDevices():
print d["Interface"]
It is in the librarize branch of the git repo. Beware, the code is still messy. Getting it:
git clone git:// cnetworkmanager.librarize
cd cnetworkmanager.librarize
git checkout -b librarize origin/librarize
./cnetworkmanager -h

Jul 8, 2009

D-Bus and Ruby

There isn't a canonical D-Bus library for Ruby. I found four projects, two of which are interesting.

First, the two losers:
* dbus-ruby: It wraps the C bindings. It is dead (last release in January 2005).
* pr-dbus: No releases, last SVN commit in April 2007, entirely in Ruby.

Now for the contenders. Both are packaged as RPMs in the OBS YaST:Web project.
The developers know about each other but in 2007 they did not want to merge the projects. The developers are not active but patches do appear.

* ruby-dbus
  • LGPL
  • no test suite (but I've started one together with bug fixes: Github clone)
  • can export services
  • cumbersome API (explicit introspection calls needed, explicit types for variants needed, return value must be an array)
BTW Klaus has two posts about writing a client and a server with ruby-dbus.

* rbus
  • GPL
  • test suite (RSpec, needs a patch)
  • cannot export services
WebYaST is using ruby-dbus so far, but I am looking at rbus too because of the tests and and the nicer API.

Jun 18, 2009

Perl DBus Library

If you want camels in your D-Bus, use perl-Net-DBus by Daniel Berrange. I have just fixed the original packaging done by Illuusio. Enjoy.

Jun 4, 2009

Cool Features in Automake 1.11

Automake is not dead, and version 1.11 will soon be in openSUSE Factory (thx puzel!) I see two new features to like: parallel execution and terse compilation.

The parallel execution is enabled by the environment variable AUTOMAKE_JOBS=n. It reduced the run time for yast2-core from 18s to 7s for me.

As for compilation, how's this (kernel people may yawn now):
make[4]: Entering directory `/home/mvidner/svn/yast/trunk/core/wfm/testsuite'                                                                         
CXX runwfm.o
CXX runc.o
CXXLD runwfm warning: unused parameter ‘name’
CXXLD runc
compared to:
g++ -DHAVE_CONFIG_H -I. -I../.. -I../../libycp/src/include -I../../liby2/src/include -I../../libscr/src/include -I./../src -I../../liby2util-r/src/include -DY2LOG=\"wfm\" -O0 -g3 -W -std=gnu++0x -DHAVE_CXX0X -Wall -Wformat=2 -MT runwfm.o -MD -MP -MF .deps/runwfm.Tpo -c -o runwfm.o
mv -f .deps/runwfm.Tpo .deps/runwfm.Po
/bin/sh ../../libtool --tag=CXX --mode=link g++ -DY2LOG=\"wfm\" -O0 -g3 -W -std=gnu++0x -DHAVE_CXX0X -Wall -Wformat=2 -o runwfm runwfm.o ../src/ ../../scr/src/ ../../libscr/src/ ../../libycp/src/ ../../libycp/src/ ../../liby2/src/ ../../liby2util-r/src/

It is enabled by putting this to
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
(The ifdef makes for graceful degradation with older automake.)

Use Webpin or the Software Portal to find a package built for your release.

Jun 2, 2009

A Minimal Build Service OSC Plugin

I am trying to make OBS cooperate with my old release scripts*. So far I have this minimal plugin for osc to share:
$ mkdir ~/.osc-plugins
$ cd $_
$ cat > <<EOF
def do_releasecheck(self, subcmd):
print "Release early, release often."
$ osc releasecheck
Release early, release often.
*) They are not released, bad me; but they rely on the internal directory layout anyway.

May 18, 2009

Bugzilla Fables: Serving Two Masters

You may know this: spending a few hard days, or even minutes, figuring out a bug and in the end the result is a one line change. What an injustice! So let's expand one such case for the amusement and education of the audience. Fable #501758:

For certain tasks, YaST uses external helpers (agents) communicating via pipes. One of them was causing YaST to hang when cleaning up. Actually no, it was two of them. Either one was not enough, but if two of them had been used, they would both keep on running and YaST would not exit.

It turns out the bug is in YaST not closing unnecessary file descriptors before spawning the agents. So the second child inherits a copy of the pipe that controls the first child. Then YaST closes the first child's commands pipe, expecting it to see EOF and exit. But the pipe is still open in the second child, uselessly. And they all wait. And wait...(*)

Moral: close unnecessary FDs before exec.

If you wonder why we did not see the problem earlier, it is because both agents contained another bug, a banal one of not responding to an explicit Exit message.

*) Actually, only YaST wait(2)s. The other two read(2) ;-)

Feb 26, 2009

Reducing Unprioritized Bugs

This Greasemonkey script, Check Priority, will check whether you are modifying a bug assigned to you and leaving its priority at "P5 - None". It will pop up a confirmation box to remind you to set a real priority.
Thanks to Milan VanĨura for showing us how b.n.c can be improved (check out also the local time script) and for even implementing this one as I stood behind his back!

Jan 17, 2009

Disabling the fetchmsttfonts update

I learned about a new icon of the update applet yesterday, the blue one for optional updates. I wanted to say "I don't want this particular optional update, thank you". But how?
Short: to disable the fetchmsttfonts update, remove pullin-msttf-fonts.
YES # zypper rm pullin-msttf-fonts
I tried to add a lock on the patch, but it did not seem to have any effect.
NO  # zypper addlock --type=patch fetchmsttfonts     # or al -t patch
After looking in the raw update metadata (updateinfo.xml.gz), I found the solution: remove the package pullin-msttf-fonts, with the first mentioned command.
Curiously enough, also other guesses at adding locks do not work, in a different way:
OK  # zypper al fetchmsttfonts
This adds a lock for the new package that fetches the fonts. The lock actually does what I want, in a different way: it installs the patch but omits the new package. It is also the most obvious command.
NO  # zypper al pullin-msttf-fonts
This is different in that pullin-msttf-fonts is already installed. List-updates still lists the patch as needed but halts on a solver conflict when trying to install it. The locks seem to take effect only when committing the transaction, not when checking for the updates.

But still, I would like to have a clickety way for this. Am I spoiled?

Jan 10, 2009

YaST UI table usability

I've just watched my wife delete a repository in the YaST Qt UI: She right-clicked the table item, nothing. She pressed Delete, nothing. Only then she noticed the Delete push-button below the table.
Obviously we can improve the usability: Delete should be handled the same way as a function key so that YCP receives the `delete event. That would be quite easy. Maybe the context menu is doable too.