Archive for the ‘Gentoo’ Category

Fun with Precompiled Binaries (Or, Why I Recompile So Many Things)

July 27, 2011

I often note that I find things in binary packages that irritate me. Sometimes it’s too much nonsense compiled in so that installation of a small utility requires massive dependencies to install. This means not just a lot of extra stuff taking up hard drive space, it means more packages that get updated and other inconveniences.

Sometimes I also notice little things that make me go hmmm. Today I was playing around with mocp, a curses-based server-client music program. There’s not yet a package for *el6 so I compiled it myself. I thought I’d hit up all the right things so that it would stream and play all common music codecs. Everything seemed fine with mp3, ogg-vorbis, and even an ASX stream. Then I tried an AAC stream and found I had more work to do.

No big deal. I searched to find out what I was missing. I found a suggestion that I should build it –without-aac (overriding the internal AAC decoder) so that AAC would be handled by the ffmpeg plugin. I tried that and it didn’t work.

So I decided to double check my ffmpeg version, which was installed from rpmforge. While it had faad and faac support enabled, I found something else that seemed a bit weird.

I know, I know. It’ll still work on other CPUs but it’s optimized for Intel Atom. Why? I’m not using this on my dual thread netbook, it’s on a dual core laptop. It could’ve (should’ve?) been compiled with -mtune=generic.

It’s stuff like this that drives me nuts and makes me start recompiling things or install something that I can optimize for my own use if the packaging (indiscriminately!) includes optimizations that suit particular hardware rather than generic. I thought that was the idea of pre-packaging binaries: so they could be used by a wide variety of common users.

For what it’s worth, the spec says:

Description: FFmpeg is a very fast video and audio converter. It can also grab
           : from a live audio/video source.
           : The command line interface is designed to be intuitive, in the
           : sense that ffmpeg tries to figure out all the parameters, when
           : possible. You have usually to give only the target bitrate you
           : want. FFmpeg can also convert from any sample rate to any other,
           : and resize video on the fly with a high quality polyphase filter.
           :
           : Available rpmbuild rebuild options :
           : --without : lame vorbis theora faad faac gsm xvid x264 a52dec
           : altivec

So it has faad/faac enabled. Should’ve worked, no?

I checked version information against what I have on my older laptop running Sabayon (with dwm). No extra c flags noted in the ffmpeg -version output but I’ll double-check that tomorrow:

ffmpeg version 0.7.1, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jun 30 2011 12:51:22 with gcc 4.5.2
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib \
  --mandir=/usr/share/man --enable-shared --cc=i686-pc-linux-gnu-gcc

I still didn’t get AAC working on m *el6 laptop with the ffmpeg-devel package from rpmforge, or even when disabling it and building against the -devel packages for faad/faac. I’ll mess with it again tomorrow.

By the way, with all the -devel packages installed and all the compiling I end up doing, I wonder why I don’t just install something that has the relevant headers (Slackware) or that I can optimize and set up the right way — my way — from the start (Gentoo). Days like this, I wonder if the multi-year support of the EL clones is really all it’s cracked up to be. In fairness, though, we’re talking about a third-party repository and not stuff in the base which seems to be put together with more care and diligence. Maybe my lesson is to build my own packages for things not provided in the CentOS/SL repositories; that would solve not only this kind of issue but conflicts when a third-party repository has a more recent version number of something provided in the base.

Update 20110723 – CentOS 6, Sabayon, Slackware, NetBSD, Etc.

July 23, 2011

Long time no see, haters. Since my last update earlier this year, I’ve been pretty busy. Usual stuff: family, work, and sports injuries.

I have a shiny new Lenovo laptop. One of the reasons I chose this one is because I was able to get a list of the hardware and checked it against lists of supported devices. It’s all supported very well under Linux and the BSDs (Net, Open) I looked at.

First thing I did was reduce the very large NTFS partition someone formatted it with (I never have booted this into Windows 7) so that it’s actually quite small. Then I installed a release candidate for Scientific Linux 6 on it, as that was the first available RHEL6 clone. I’ve since changed that over to CentOS 6 using a net install. And since I have no interest in booting the pre-installed OS, I changed my grub menu.lst to no wait, no options, just load that one in a freaking hurry.

As usual, I found some nits to pick about how certain other things were configured and I had to make some changes to get simple things to work. This goes for software as well as hardware.

First the hardware side of it. I thought the inkjet printer I keep in my room was supported out of the box despite noticing the printer would “eat” up paper upon finishing the job — not fully ejecting it before pulling it back in to the printer. It was only the past few days, though, I realized there was more wrong than met the eye. I needed to make some quick scans and xsane reported back I had no scanner. Hmmm. I checked it via scanimage and it was detected. I also double-checked the drivers and saw that the sane backends for hp and usb were there. I decided to see if the hplip site had a newer RPM than is available in any of the repositories I’ve enabled. I entered the relevant information and downloaded an up-to-date RPM with new drivers. Installing it required removing old RPMs. Then I had to set some permissions so I could use the scanner without escalating my privileges to root. The new hplip RPM also resulted in better printing and no more “eating” paper.

There was a variety of software I installed from the normal as well as third-party repositories. Most of it has been without any trouble — only a couple things from a more bleeding edge repository (EPEL) have conflicted with packages from others. Some of the configuration issues have been simple and straightforward. I’m coming around to accepting pulseaudio, especially as it makes some things easier. My Bluetooth headphones work fine and are able to remotely control playlists in totem. Haven’t tried yet in rhythmbox but mplayer (from rpmforge) needs remuco to work.

Even though I’d be exaggerating to call RHEL6 or its clones bleeding edge, it’s still new enough that repositories lack certain packages that I wanted to install. One solution (other than “wait”):

sudo yum groupinstall 'Development Tools'

I’ve recompiled things that bugged me as well as things that were either unavailable or that I wanted to update. I wanted liferea so I had to compile it myself. Dittos sylpheed (NOT claws) and mew (emacs e-mail client). I also wanted an update of org-mode for emacs, but I’ve also played around with compiling other emacsen. This morning, I decided to try sxemacs.

I wasn’t impressed with the clunky xaw widgetry, let alone the faces available on my laptop (trust me, terminus looked only a little better), and I decided against installing GTK1 headers just to see if that would look any better. Not even some minor color changes helped. I usually run emacs from console anyway because it’s easier to run it in screen and then shell in and out, locally or remotely, as needed. The faces (fonts) bother  me a lot more than the widgets — it’s not about the aesthetics as much as if I can clearly see what the hell I’m doing.

I’m going to try this for a while and see how much work it’ll take to get it working the way I use GNU emacs. Just remembered I forgot to change EDITOR=emacsclient to EDITOR=gnuclient. Also, this (last line!) has to go in the init.el to keep from opening a new sxemacs GUI instance:

(require 'gnuserv)
(gnuserv-start)
(setq gnuserv-frame (selected-frame))

Sheesh! Recompiled –without-x. Much better, too, after removing background color (transparent terminal over black wallpaper).

Now the fun of getting my other emacs stuff to work correctly with this.

I also converted my previous laptop over to CentOS 6. I did a minimal net installation, installed xfce from EPEL, and then added some of my own packages (including dwm and jwm because I decided I don’t care for xfce). My ridiculous Acer Aspire One is still running SL6 and still having issues with the fucking Atheros wireless card. When it starts to flake out on me, I pop in a zyd-based USB wireless adapter. Voila. I should blacklist the module for the Atheros card but, honestly, the AA1 has been such a pain in the ass that I seldom use it. I recently updated XP (30-something packages!) after not even booting it for like half a year and suffered some USB-related issues as a result. The good news is under the RHEL6 clones, all the other AA1’s hardware — including both internal card readers — work properly, without having to boot one side with a card inserted.

Okay. The headline mentions other distros and NetBSD. I’m considering some changes on the other laptop because a lot of stuff I’ve compiled for it would be just as easy from scratch instead of using source RPMs or new source. I tried to get a measure of how many packages are installed by default on a minimal install of various distros. I figure RHEL clones will have the most, followed by Debian, and on the other side of the scale will be Slackware and Gentoo (I haven’t used Sabayon before but I like the option of using a binary or portage depending on my tastes — this is why I’m also considering a BSD and pkgsrc).

There are certain distros I’ve taken off my radar list despite having a fondness for them. As I now use laptops, netbooks, and other portable devices — including portable USB storage — about 90% of the time, encryption is very important to me; one of my parents’ was a victim of identity theft in the past couple years and I was already a bit paranoid about what kind of information could be found in plaintext on my computers. On all my computers, I like the option of installing to, or easily setting up, one encrypted LVM which includes at the very least my /home, /var, /etc, and swap. I used to think it was adequate to encrypt just /home and swap but I’ve changed my mind after auditing “identifying” information available elsewhere on an unencrypted system. For example, plaintext wifi passwords in /etc/wpa_supplicant/wpa_supplicant.conf (or elsewhere on a “non-standard” system) or stuff stored in /tmp. I also think it’s not enough that the “core” of the operating system be protected from threats, such as over the Internet; the biggest vulnerabilities usually stem from applications and user choices, and you can’t reboot those problems away — they’ll still be there if (or because) /home and /usr/local are RW, not read-only. When storage is measured in GB and TB and speedy multi-core processors, it’s harder for me to choose to run my OS in some “embedded” style.

Still on my TODO list is my post about what I use instead of OpenOffice.org. Also, I’ll try to write a post about the minimal install I did with more specifics (need to edit my gnote version of it — wish I could import that into this without reformatting) in the near future. As usual, no promises on time lines.

Setting Up Desktop – Part 2

March 15, 2010

Had time to kill during a conference call Did some more work on the desktop this afternoon. Decided to scrap Gentoo install after rebooting and realizing I just want it to work ASAP without any fuss.

I decided to set up Micro Core. As I suspected, some of the extensions were problematic. First up was GNU screen since microcore boots with one tty and I need some multiplexin’ action. Unfortunately, screen insisted that it couldn’t even run on my lone tty , at least not as user tc. I could run screen as root but what’s the fun in that? I need to be user tc to use the packaging system. I added ssh and monkey (http daemon). Then I started screwing around with my persistent files and decided this wasn’t what I wanted. I’m not dissing it, but I’m also not using it. It won’t be nomadic, though I will be.

I grabbed my Debian net install mini CD and booted it. In very short order I had it installed with encrypted LVM and swap, no headaches and no convoluted hoops to jump through, with standard file layouts. I quickly added sudo, added myself to sudoers (who the fuck decided on fucking POS nano as $EDITOR?), set up group sudo to require password (one of the uneasy things I decided I wouldn’t compromise with under Micro Core), openssh-server, and am now adding various and sundry packages I need installed.

I got more done in about 30 minutes with aptitude than it took to compile the Gentoo kernel (counting a very hasty run through menuconfig). Yeah, it’s going to have a bit more bloat and it’s not as optimized. I’ll deal with all that when I have time to spend on it.

Maybe another update soon, but I think you can see from the above description that there’s nothing fancy. Hell, I didn’t even install X. Pound for pound, I’m about where I expected to be with Micro Core at this stage — with bash, with openssh, with core utils, with a variety of extensions I wanted to set up in a hurry. I still have tinkering to do, particularly with config files (which I’d have to do anyway no matter which distro I’d settled on) but it’s been a lot faster to get set up and relatively free of hassle and zero — really, zero — drama.

Now if I can find some time to finish this before I head off again…

Setting Up Desktop – Part 1

March 15, 2010

I won’t be using my desktop as a desktop very often but I need to get it up and running. After wavering between what to do with it, I started installing something today at lunch. I hope to have it finished by this weekend. Or sooner. I left in the IDE drives because the big honking SATA drive is being used for NAS until I find a big-enough replacement for that (original crapped out).

Yeah, I know. Geez. I didn’t want to do any work at all. I was going to do a minimal Debian net install and only set up what I want. Then I thought I shouldn’t waste anymore time since I installed NetBSD (and Scientific Linux on the secondary drive). Then I was going to just set up MicroCore with only the things I need it to have, and then do more later when I have time. I think, though, that I want a bit more flexibility than Debian and I want to avoid some of the hacky-ness of {Tiny,Micro}Core and have a full set of utilities instead of busybox. As much as I love the latter, it’s just a bit Rube Goldberg in setting up the way I want it to work (not to mention I’d have to compile quite a few things that I want/need which aren’t in the repository); the remaining Linux partition on my AA1 is TinyCore — which I could only use with a USB wifi adapter anymore since I have zero confidence in the Linux ath5k driver with wpa_supplicant — and by the time I add GNU core utils, compile libarchive, etc., I’m pretty close to a Debian/Slackware minimal install anyway. Aside from portage’s bloat, I think I can keep this pretty lean (which is more a goal than a necessity). If I end up regretting Gentoo, I’ll likely install MicroCore and then screw with it more when (if) I can find more time. If it goes as smoothly as it has so far, I could end up putting it on my laptop, too (I’ve aborted several entries I started about excessive dependencies…).

My kernel is still compiling now. I won’t have much chance to mess with it until later tonight (after 24 at the earliest) and probably won’t touch it again until Wednesday. Hopefully I’ll have a “Part 2” up in a timely manner. Haha.