Fedora development and yum-utils

On my system at home, I run the latest Fedora development packages, which has both pros and cons. For instance, I'm pretty always up to date with all the tools I use, all automatically. However, it can be a pain sometimes to get yum to update properly, and a few times major breakage happens :-).

A while ago, I realized that there's a package availabe, called yum-utils, which provides quite a few useful tools, in particular, there's now a new repoquery tool. This can be used similar to the old rpm --fedoraprovides syntax, as well as many other uses. For instance

root@thor 426/0 # repoquery --whatprovides python
python-0:2.4.2-2.i386
root@thor 427/0 # repoquery --whatrequires python
plone-0:2.1.1-1.fc5.i386
mach-0:0.4.8-1.fc5.i386
system-config-lvm-0:1.0.8-1.0.noarch
rhn-applet-0:2.1.17-4.i386
plone-0:2.0.5-3.noarch
.
.
.

To install yum-utils (if not already installed, and you have yum properly configured for the development repo), all you do is

root@thor 428/0 # yum install yum-utils

Oh, and while I remember it, the old rpmdb-fedora DB package shouldn't be needed any more, I simply uninstalled it with

root@thor 329/0 # rpm -e rpmdb-fedora

g++ and member initialization

Recently I've been working on porting a very large (and obsolete) system to a modern Linux platform. This has been rather painful, particularly since the code has a million and one compiler warnings (when compiled with g++ -Wall). In particular, one class of warnings was annoying the hell out of me:

foo.cc: In constructor ‘Foo::Foo()’:
foo.cc:34: warning: ‘Foo::loki’ will be initialized after
foo.cc:33: warning:   ‘int Foo::leif’
foo.cc:41: warning:   when initialized here

This might not seem like a big deal, but when we're talking about 30 or more members that needs to be initialized, and they are completely out of order, it quickly becomes annoying to figure out the correct order. So, I hacked up gcc a bit, to introduce a more helpful warning. With this patch, I now get something like this instead:

foo.cc: In constructor ‘Foo::Foo()’:
foo.cc:34: warning: ‘Foo::loki’ will be initialized after
foo.cc:33: warning:   ‘int Foo::leif’
foo.cc:41: warning:   when initialized here
foo.cc:41: warning: Correct initialization order is:
foo.cc:44: warning:   Foo::leif
foo.cc:44: warning:   Foo::loki
foo.cc:44: warning:   Foo::odin

I've tested this with gcc v3.4.4 and gcc v4.0.2, and it seems to work fine on both. Since I'm not a gcc hacker, my implementation might not be the optimal one, but it works for me. Isn't open source great sometimes?

Ripping for PSP/iPhone from DVD

These tips make great PSP movies from DVDs

Install and Rip your DVD using dvddecrypter


  1. Use IFO mode
  2. Set it to select main movie only, and File Splitting to "none".
  3. Set it to make 1 VOB.
  4. Set it to ignore hardware read errors.

Install AutoGK. Some options you'll have to go to the advanced tab for


  1. use AutoGK to create an AVI from the VOB.
  2. set width to 400
  3. Use Xvid
  4. set quality to 75 to 80 (don't go over 80, it doesn't give you much).
  5. There are not alot of options.

Convert to MP4 from AVI using PSP Video 9


  1. Use the 400x192 resolution
  2. Use the following ffmpeg options -g 300 -sameq
  3. set for 2 pass
  4. set audio to 80k to 96k (IMO), Stereo.
  5. I use a Framerate of 14.985 FPS, and a bitrate of 512kbps (400kbps is also decent).
  6. If you have a PSP with 2.50 (or later) firmware, maybe consider the AVC video codec, but it takes a lot more space.
  7. Tweaking the sound volume over 100% might help on the PSP, but I've had little luck with it. I bought a Bostaroo instead, works great.480

More on UnionFS and AutoFS

I did some quick hacking around the autofs mount point, and came up with this quick (and very dirty) "fix" for my problems:

#!/bin/sh

key="$1"

opts="-fstype=unionfs,ro,dirs="
ls /share/unix > /dev/null

egrep "^$key" /etc/auto.misc | sort | awk -v key="$key" -v opts="$opts" -- '
        BEGIN           { ORS=""; OFS=""; first=1 }
        first == 0      { print "\\:/misc/" $1 }
        first == 1      { print opts "/misc/" $1; first=0 }
                        { system("ls /misc/" $1 ">/dev/null") }
        END             { if (!first) print " :none\n"; else exit 1 }
        '

It's still not perfect, but certainly a lot better. Notice I moved the Unionized mount points to it's own automount map (/union). I just put the script above in /etc/auto.union, make it executable, and add the map into /etc/auto.master, e.g.

/union          /etc/auto.union         --timeout=600

Update 1


On my FC3/4 system, I kept getting warnings from the diskcheck utility. This was easily avoided by modifying /etc/diskcheck.conf, and add something like:
ignore = "-x nfs -x unionfs"

Unionfs, autofs and ISOs

I use many different Linux distributions, and versions of those, and like to keep them available on my various boxes. I setup a very simple autofs map for this, which I mount as /misc:

FC3-1   -fstype=iso9660,ro,loop :/share/unix/Fedora/FC3-i386-disc1.iso
FC3-2   -fstype=iso9660,ro,loop :/share/unix/Fedora/FC3-i386-disc2.iso
FC3-3   -fstype=iso9660,ro,loop :/share/unix/Fedora/FC3-i386-disc3.iso
FC3-4   -fstype=iso9660,ro,loop :/share/unix/Fedora/FC3-i386-disc4.iso

This is incredibly useful, but somewhat annoying when I'm looking for a particular RPM for instance. I have to manually look at up to four different directories to find it. So, I decided to give UnionFS a spin. I downloaded the latest tar-ball, and built it following the easy instructions (basically just make and ''make install').

I decided to just add another entry in my automounter map

FC3 -fstype=unionfs,ro,dirs=/misc/FC3-1\:/misc/FC3-2\:/misc/FC3-3\:/misc/FC3-4 :none

Notice how the ':' separators in the dirs option are escaped with a backslash, without it I could not get it to work it all. To make things worse, the automounter is not able to handle all this automatically, so unless /misc/FC3-* are all already mounted, I can't see /misc/FC3 at all. This is rather annoying, but I haven't found a way around it.

However, besides those problems with the autofs interaction, UnionFS is pretty damn cool. Now I can see all the FC3 RPMs in one directory, /misc/FC3/Fedora/RPMS.

RHEL4 and Sound Blaster Live! 24-bit

My workstation at work (yeah, I do work ...) crapped out big time on my old sound card (an old Vortex2 card) after I upgraded to RHEL4. So, I went to the local Fry's store, and picked up the cheapest Sound Blaster card I could find, the SB Live! 24-bit for a mere $29.99. Well, as it turns out, this card is not supported by the ALSA drivers provided with RHEL4...

Fortunately, it was pretty damn straight forward to upgrade the ALSA drivers on this box, these are the steps I had to take:

{CODE()}

RedHat released DS!

Finally we have an alternative to OpenLDAP: Fedora Directory Server! This is great news for everyone who's used the old Netscape or iPlaner Directory server. Not only do we get the software "for free", the source is also available!

I've just started playing with this release, and so far it's looking pretty good. I expect to have more news once I've moved more data from my old OpenLDAP directories over to FDS (Fedora Directory Server, I have no idea if that's an appropriate acronym). Head over to the Fedora Directory Server Wiki site for more information, and Downloads.

Also, I decided to "revive" an old site of mine, slapi.com, which I hope will be a dedicated resource for writing new extensions for the Directory Server. There's not much there yet, but I've re-posted an old article of mine I wrote 5-6 years ago.

Serial ATA and ABIT IS7 (ICH5-R)

Last week I built a new file server based on the ABIT IS7 mobo. I bought 2 large SATA drives, and planned to use simple mirroring of the two disks (RAID-5 just sucks too much :-). I installed Fedora Core 3 on this system, and that worked seemingly without problems. But, upon further examination, I started getting an error like this in my syslog:

Mar 31 20:33:34 server kernel: Losing too many ticks!
Mar 31 20:33:34 server kernel: TSC cannot be used as a timesource.
Mar 31 20:33:34 server kernel: Possible reasons for this are:
Mar 31 20:33:34 server kernel:   You're running with Speedstep,
Mar 31 20:33:34 server kernel:   You don't have DMA enabled for your hard disk (see hdparm),
Mar 31 20:33:34 server kernel:   Incorrect TSC synchronization on an SMP system (see dmesg).
Mar 31 20:33:34 server kernel: Falling back to a sane timesource now.

This obviously couldn't be good... Running "hdparm-t" on the disks showed me abysmal read performance from the SATA disks (like, in the 2-3MB/sec range, when I'd expect at least 60MB/sec). I spent quite a while trying to figure this, trying newer kernels (2.6.11), trying without RAID mirroring etc. I also checked the obvious BIOS settings, but the either all seemed right, or didn't make any difference. Until I tried the setting for the actual IDE controller, where the default "mode" obviously didn't do the right thing. Changing this to "Enhanced mode" did the trick, and the system performs well now.

Yahoo Search Web Services

Well, it's finally official, Yahoo released the search APIs to the public. The Developer Network has all sort of documentation, and downloads of example code and APIs. Obviously, you should use Python. Swaroop has already begun hacking, writing a QT Image search tool thingie. The Python APIs are hosted on SourceForge, at http://pysearch.sf.net/ .

I'm about 50% done with my next search project, a Gimp plugin that lets me search for Images, preview the thumbnail, and then import the selected image(s) as layers into the Gimp. I'll post with screenshots once it's looking less gimpy.

Fedora Core "devel" packages and yum

I try to keep my system up to date using the Fedora "devel" packages, using the yum updater. Sometimes I would get errors like

unsigned package //var/cache/yum/development/packages/glibc-2.3.4-3.i686.rpm
unsigned package //var/cache/yum/development/packages/eog-2.8.1-1.i386.rpm
unsigned package //var/cache/yum/development/packages/pango-1.8.0-1.i386.rpm

The problem here is that not all development packages are signed, for whatever reason. Assuming you still trust Fedora, simply modify your yum configuration file (/etc/yum.repos.d/fedora-devel.repo in my case) to add a line like
gpgcheck=0