Smokes your problems, coughs fresh air.

Tag: Gentoo (Page 2 of 2)

Gentoo update: e2fsprogs blocks e2fsprogs

Yesterday evening, I dropped by at Wiebe‘s with my laptop to start updating our Gentoo systems together. I hadn’t updated this machine since first installing it in spring last year, so I expected quite a few problems. The first blockage that we both had to solve was caused by e2fsprogs.

Wiebe searched the forums for help and found an unfortunate abundance of it. Eventually, I decided to give one of the many contradictory tips a try, although it seemed risky.

$ emerge --unmerge --ask --verbose e2fsprogs

Until you reinstall e2fsprogs, you won’t have any of the ext2/3 utilities such as e2fsck. So, reinstall immediately:

$ emerge --oneshot --ask --verbose e2fsprogs

This will remove libcom_err and libss, and replace them with e2fsprogs-libs, thus solving the blockages.

Wiebe tried an alternative route by first unmerging com_err and ss, and then replacing e2fsprogs. This didn’t work as expected, probably because he had kerberos in his use flags. libkerberos used libcom_err, which broke wget. Scp’ing the distfiles to him didn’t work either (OpenSSH also has kerberos support). Neither did mounting an USB stick with the files. Luckily, Thunderbird still worked, so I emailed the distfiles and the problem was solved. We found it amusing to have to use e-mail while being in the same room. 😉

The reason why this blockage occurred is not entirely clear to me. What I do understand is that com_err and ss were both provided by the e2fsprogs project and are now deprecated in favor of e2fsprogs-libs. Also, it’s clear that the new libraries are binary compatible with the old libraries or his system would have remained unusable, even after merging e2fsprogs-libs.

Before we tackled this problem, I had only updated portage and net-print/foomatic-db-ppds (also a blocking situation). Afterwards, I had just some motivation left to update krb5. Which leaves another 282 packages for the next get-together.

Using Caps Lock as an extra Control key

With me mostly posting about computer stuff on this weblog, it might surprise you that, until May this year, I hadn’t owned a personal computer in years while the last one that I did own was a slow pig grown from some old parts of an even slower pig and some second-hand replacements. So, you can image my joy when I got a shiny, new Lenovo Thinkpad 61 this spring.

One of the joys of once more owning a personal computer is that I don’t have to live through PuTTY anymore. (I used to SSH to the local Debian server here if I wanted to get anything done.) I’ve reacquainted myself with Gentoo and I’m loving it. Of course, there’s a lot more to configure than with Ubuntu (which supports the T61 very neatly out of the box), but that’s the whole point; I want to be able to configure everything my way and I want to update my knowledge about how Linux systems are made up these days. Control.

On the topic of control, the Control key on the Lenovo keyboard, as with many laptop keyboards that I’ve encountered, is in a bit of an awkward position, squeezed to the right by the Function key. Since, I very much depend on the Control key for shortcuts (in just about anything, but especially in libreadline-based programs), I decided to change the Caps Lock key to be an extra Control key. I’ve never actually used the CapsLock key in my life, I probably never will, older keyboards used that very spot for the Control Key, and why not? It’s a much better spot, requiring less gymnastics for my little pinky to reach. Once I considered this I was actually puzzled about why I’ve always wasted such an well-accessible key position.

X

On to the configuration. I wanted this to work in both Console mode and in X. But first X. In the xorg.conf, I went to the InputDevice section for my keyboard and added ctrl:nocaps to XkbOptions. The full XkbOptions line now reads:

Option "XkbOptions" "ctrl:nocaps,altwin:menu,compose:ralt,eurosign:e"

That’s it. I had to take a few more steps to get it to work in the console also.

Console

First, I created a file called “/etc/extra-key-conf” with the following contents:

keymaps 0-15
keycode 58 = Control

Then I added the following to /etc/conf.d/local.start. This is a Gentoo specific script that is loaded by /etc/init.d/local.

[ -z "$DISPLAY" -a -e /etc/extra-key-conf ];
        loadkeys /etc/extra-key-conf &>/dev/null

What this does is to check if the $DISPLAY variable isn’t set (of which we can be sure in this context, but may be useful if you plan to copy this snippet). It also checks if /etc/extra-key-conf exists. If both conditions are satisfied, loadkeys is called with that file as its argument.

In conclusion

I can really recommend this configuration even if your Control key is not awkwardly positioned on your keyboard. Do you use your Caps Lock key? Regularly? If you don’t, this will make your keyboard use more effective.

Reference

If you want to read into this more extensively, I recommend the Remap Caps Lock article from the Portland Pattern Repository.

Converting Monkey Audio to WAV in Gentoo

I had the bad luck that a CD image I acquired from the Internet consisted of a .ape file for the audio and a .cue file for the track offsets. cdrdao has no problem with .cue files but .ape is the file extension for Monkey Audio files. Monkey Audio is the awkwardly licensed monkey brother of Flac. (They’re both lossless audio encoding formats.)

This is one of those I-want-to-remember-this-for-later posts which I should really do more often if I wander about investigating various technicalities. Although such posts aren’t the most comprehensive and useful to the reader, they’re invaluable to myself six months from now.

mac is a tool capable of converting .ape files to .wav files. But first, .Ape’s awkward licensing problem meant I had to find an ebuild for mac to put in my Portage overlay in $PORTDIR_OVERLAY at $PORTDIR_OVERLAY/media-sound/mac. Through references in the Gentoo Forum and the Gentoo Wiki, I came across two different bug reports with ebuilds for mac attached. Bug 52882 had the newest ebuilds attached.

$ mkdir -p /usr/local/portage/media-sound/mac
$ cd /usr/local/portage/media-sound/mac
$ wget http://bugs.gentoo.org/attachment.cgi?id=154775
$ ebuild mac-3.99.4.5-r2.ebuild manifest
$ emerge -av mac

Now, I could convert any .ape files to WAV:

$ mac CDImage.ape CDImage.wav -d

Alternatively, I could have done this using shntool, a handy front-end for all sorts of lossless audio programs:

$ emerge -av shntool
$ shntool conv -o wav CDImage.ape

Now, I could have just gone into the CDImage.cue file and change the reference to the .ape file to a reference to the .wav file:

$ sed -i -e 's/.ape/.wav/' CDImage.cue
$ cdrdao write CDImage.cue

But, first I was sidetracked to splitting the tracks (until realizing that wodim wouldn’t burn the correct pregaps).

Just grepping for “INDEX 01” didn’t generate the indexes in a format that shntool split would eat, leading to the emergence of yet another package: cuetools.

$ emerge -av cuetools
$ cuebreakpoints CDImage.cue | shntool split CDImage.wav

Bypassing smart completion in Bash

Luca Citi, a nice Italian Ubuntu user, just gave me an excellent tip in response to my list of Readline keyboard shortcuts. Modern Linux distributions such as Ubuntu and Gentoo can easily be configured for Bash to use smart completion. With smart completion enabled, instead of just looking among all the available files and directories without discrimination, TAB will be able to more accurately adjust its list of available completions depending on the program for which arguments are being sought.

An example of smart completion is that completions for the cd command will only include actual directories and no longer any regular files. Luca gave me another good example: completions for the kpdf command will only include files with the .pdf extension.

Myself, I’ve been bitten by smart completion a few times because I’d want to complete a command argument towards a filename which wasn’t supported by the smart completion rules. Luca gave me his typical example of such a case: his smart completion configuration includes only entries from the fstab as valid mount points for the mount command. But, what if you want to do an ad-hoc mount? Will you just have to type out the full mount point without auto completion? That’s what I used to think before Luca told me about the Alt+/ shortcut. In Bash, this shortcut will act as the TAB-key would without smart completion enabled.

Of course, I’ve updated my list of Readline keyboard shortcuts to include Alt+/.Thanks Luca! 🙂

Newer posts »

© 2024 BigSmoke

Theme by Anders NorenUp ↑