|
.comment: A Tale of Two Packages
It Was the Best of Installs...Riddle: What do XFree86-4.x and early versions of Enlightenment have in common? Answer: While tremendously powerful and feature rich, both are enragingly difficult to configure unless you happen to be the author. This not-very-funny riddle occurred to me during about the fourth day of my installation of SuSE 7.1 on an IBM Thinkpad 760XL (P-166, 104 megs of memory, Trident Cyber 9385 video chip with a meg video ram, 800x600 TFT screen). The fact that I'm writing this in StarOffice 5.2 on that very machine using that very distribution might lead you to believe the install was a success; if so, you would be led astray. I'm not one to jump promiscuously from distribution to distribution. My Linux life began with Caldera 1.1, and but for a brief and unsatisfying fling with Red Hat 5.2 as I awaited the arrival of an official glibc-2.x, I've been a Caldera user ever since. Alas, Caldera is heading off now in a different direction. It's concentrating on business, with its desktop distribution aimed at developers within businesses. I wish them well, but this has about as much to me as does an embedded system that keeps track of the amount of gasoline pumped by a filling station. The potential to be a desktop system is what separates Linux from all those other Unixes that have been merrily cooking along in the back shops for decades now. As an advocate of Linux on the desktop, I'm not all that interested in how a distribution might be made to work on the desktop. I want one that's there already. In a lot of ways, that means SuSE. There are others who make distributions suitable for desktop use, but I don't think anyone is as committed to general desktop Linux as SuSE is. Friends who use it say its installation routine is the best in the business, and it is reputed to recognize hardware very well. Now, it could be argued -- I know, because I have argued it -- that once you have a running Linux system, any distribution of just about any age, you really don't need to get anymore new ones, because you start out by breaking the RPM database, then upgrade things as the spirit moves you or the need arises. I've done this with my desktop machine, which is running Caldera eDesktop 2.4 in name only. But I have multiple machines to tend, and putting eDesktop on them and then traipsing around all over the web to get the stuff necessary to upgrade the kernel, so I can upgrade XFree86, so I can upgrade QT, so I can upgrade KDE and have niceties like working 3-D and typeface anti-aliasing -- this stuff isn't so bad the first time, spread out over months, but doing it all at once would be dull and irritating, to say nothing of time consuming. If I can send SuSE $30 and get it all on a nice CD, it's a bargain. So I did just that. My idea was to use it to upgrade two machines, aforementioned Thinkpad and my wife's desktop system, which is about as vanilla as it gets -- K6-2-400, ATI Rage 128 ATI with 32 megs, 256 megs of memory -- with one exception. She loves LCD panels for desktop systems, and a few weeks ago I found one for dirt cheap at, of all places, the local Sears, on the junk table in the electronics department. It had no video cable (trivial) and no power supply (nontrivial), as well as no box or docs. It wanted 12 volts at 3.2 amps, and 3.2-amp power bricks are not easy to find. I'll digress long enough to tell you how I solved the problem. Computer power supplies, you may remember, provide 5 volts (the red lead on drive power connectors) and 12 volts (the yellow lead). Yes, I asked Mr. Voltohmmeter to confirm this. So I grabbed a drive power cable Y adapter from the drawer'o'wires, removed the yellow (positive) and adjoining black (ground) from one side, inserted a fuse holder containing a 4-amp quick blow on the hot side, then soldered the leads to a female power plug (center is hot) that I'd installed in a 7/16" hole I'd drilled in a blank slot cover. Then I installed the slot cover and plugged the bottom of the Y on the adapter into a spare drive power cable in the machine. I didn't even lose a power connector-- the other side of the Y was intact. Yes, I checked the voltage of the plug on the outside, just to make sure I'd made no mistakes. Finally, I used a male-male power cable, both ends like the business end of a garden-variety power supply brick, to connect the computer to the power in of the LCD. It worked perfectly. (Disclaimer: The above is for amusement purposes only, and if you go trying a stunt like this and blow up your computer or burn down your house, it's your own fault, so don't come crying to me, and don't send your lawyer crying to me, either.) The only tough part in setting up the LCD on my wife's machine had been configuring XFree86-3.3.whateverCalderaships, which took a few hours of trial and error. XFree does not seem to have heard of LCDs, which is understandable in that they've only been in common use for about 15 years. So I was a little concerned about a new distribution there. Fortunately, I had the Thinkpad as a testbed, and with it I would be throwing SuSE 7.1 some serious curves. The 760XL, about five years old and acquired from the same shop where I get all the stuff I couldn't afford when it was new (they buy lots of machines off lease), is wonderfully modular: if you push the screen latches (pulling them lets you open the screen), you can lift up the keyboard and rearrange everything. You can switch hard drives. On the left is a bay that holds the floppy drive, a CD reader, a second hard drive, or a second battery. Pretty cool, no? It came with the floppy drive and a 20x CD reader built for IBM by Hitachi. But leave it to IBM to leave out the little piddling feature that would have been easy to implement but they just didn't: you can't boot from the CD drive. I have a PCMCIA CD drive, a Panasonic KXL-783A, that for the longest time wasn't supported under Linux at all. Recently It's been added to the list of supported stuff, but the way of making it work is long and convoluted and I've never succeeded at it. Because I'd need to have the floppy in the machine to boot the SuSE install diskettes, it would be my lone hope. And SuSE supports everything, right? The target was a 4.2-gig IBM drive (which I had -- the 2-gig drive that came in the machine has an OS/2 install on it, because it's a neat system and for old times' sake; I'll spare you the story of how I got a spare drive caddy for ten bucks and learned after many hours that IBM had for no apparent reason screwed around with the drive select pins, such that the only solution was to just cut the damn things off of the caddy). So I booted the SuSE install disk. It detected the PCMCIA chip and prompted me for the modules diskette (both of which were provided; none of this bush-league business of making the diskettes from images on the CD first). Then a hellish red box, saying that it had found no CD drive and the install would be text-based. Weird, I thought -- some trick, installing with nothing to install from. Then it asked me if I'd like a NIS or FTP install. It had detected the network card in the second PCMCIA slot. The one that had taken me days to set up in OS/2 and that I'd never quite gotten to work on a Windows machine. So I said sure, FTP, amused that my $30 would have gone to get, essentially, two floppies, and I'd be doing everything else from SuSE's FTP site. Not so fast. Though I fed it all the right numbers, it wouldn't connect to SuSE, though it hooked up just fine to the hub here. (I've tried it since then, and it still won't.) Hmmm. Okay . . . I keep all the services I can get my hands on turned off on every machine on the network. The machines don't talk to each other and hook up at the hub solely to get cable modem access to the outside world, through one of those nifty little D-link gateway boxen. Time for that to change for awhile. Caldera shipped with eDesktop 2.4 (and eServer 2.3) a browser-based service configurator called WebMin. My previous experience with it had been limited to turning things off and, for an article, using it to set up a SAMBA share. It took about five minutes to start it and use it to set up an FTP server that would give residents of the local network access to my desktop machine's CD reader. I put the SuSE CD into the drive, mounted it, pointed the SuSE install to my desktop box, and whammo! the install began. In my experience, it's best when installing a distribution to install everything and uninstall the stuff you don't need later, because otherwise one of the pre-built package tours is certain to leave out something you'll sooner or later need. As I watched the packages come zooming across onto my notebook, I had time to contemplate, which contemplation I've since expanded upon through experimentation. Thus we arrive at the first package referenced in the title of this column. It's the PCMCIA stuff, known in the world at large as pcmcia-cs. A few years ago, it listed my PCMCIA CD machine as unsupported and unlikely ever to be. The fact that through some alchemy it can now be made to work is a nice feature, though one I'm unlikely to use, because after the installation I can put the CD reader back in the Thinkpad and Linux will see it just fine. I wasn't at all surprised that it wasn't automagically recognized. It's a little bit of a weirdo, running off an Ataptec card or clone and otherwise odd. No other operating system recognizes it right off the bat absent the intervention of drivers from Panasonic. But consider. I have four PCMCIA network cards here, all from my efforts to get Warp to connect. They include a 3Com, a Xircom NIC/modem, a NE2000 clone, and an Intel (a rebadged Xircom). Only the Intel works with OS/2; in Windows all work to some extent, but all with little crotchets. Reliability is assured only by shutting down, inserting the card, and starting back up again. Ah, but with pcmcia-cs! I'm online right now. I can yank the card, replace it with a different one, and I'm online again. No shutting down. No restarting. I pull the card, and pcmcia-cs unloads the module for the card and shuts down the networking on the machine. I put in a different card, and pcmcia-cs loads the module and restarts the network, and I'm back online. If I'm reasonably quick, I can do this in the middle of a big FTP download, and it picks up where it was. This works with all four of the ethernet cards I have. And I've told pcmcia-cs nothing at all about any of them. Nor does it make any big deal about it -- no "new hardware detected, would you like to install drivers?" self aggrandizement. It just works. It's some of the most gorgeous programming in all of what we broadly refer to as Linux, and if everything worked as well we'd have nothing left to hack. (The 2.4 kernel includes more PCMCIA stuff than 2.2 did; if you use a notebook and are upgrading the kernel, read the pcmcia-cs docs before you build your kernel, because the kernel can break a lot of the goodness that pcmcia-cs provides.) Ah, the metaphorical FTP transfer from my desktop machine is done. Time to move to darker things.
...It Was the Worst of ConfigurationsHaving paid attention to the installation of the packages via FTP, it was clear that not everything was on the first SuSE CD, but it couldn't find the words to tell me to umount that CD and put in and mount the second one. So it said it was done. It now went through a series of questions, the critical one being whether I wished to boot Linux-2.4 or 2.2. I chose, of course, the latter. It ran lilo, which failed. (I understand that under the graphical install this isn't a problem, but when you install via FTP you are text-based and this problem arises.) The problem had to do with /boot/initrd_24, which lilo said didn't exist because it didn't. The solution, provided by the SuSE support database, was to enter a different virtual terminal, chroot /mnt, and edit the offending line out of /etc/lilo.conf, save the file, and run /sbin/lilo. It worked. And in due course it arrived at the point where it wanted to reboot. I let it, but when everything was shut down I turned the machine off. Then I pulled the floppy drive and put in the CD drive. I also umounted (note to newbies: it's not a typo; Linux doesn't unmount, it umounts, though I have no idea why) the CD in the desktop machine. Then I turned the notebook on again. Oddly, it acted as if it expected all of this, and asked me where my CD drive was. I told it it was /dev/hdb, put the second CD in the CD reader, and watched the rest of the packages install. At which point I was pretty much done, or so I thought. There was still X to configure. Distributions vary considerably in the way they do things, and this will continue to be the case until a meaningful standard base is arrived at. There is talk of work toward this, and I can understand how it has taken forever, in that a committee is involved. One competent person could do it in an afternoon; hell, I could do it in a day. But with a committee, nothing much ever happens. Anyway, SuSE has its way of doing things, and though I'm hesitant to say they're better or worse than the way Caldera does/did them, they're certainly different. Poking around the file system with Midnight Commander (in my estimation Miguel de Icaza's absolutely essential contribution to Linux; no matter what desktop you use, you need mc), I learned that SuSE did different things with XFree86. There was a /var/X11R6 directory that was new to me. There were various new X security files in the /home/[user] directories. And, of course, there was a proprietary X configurator. And here we begin the story of the second package mentioned in the title. It is XFree86-4.x. SaX sux; SaX2 sux2. So went the little ditty that pushed forward as I tried and failed to get XFree86-4.02 to work on this machine. SuSE's X configurator is called SaX; its configurator for XFree86-4.x is called Sax2. I hoped to use XFree86-4.02. There are actual reasons for choosing the latest XFree. For those whose chips support it (the one in my notebook doesn't), the DRI rendering of 3-D images is one reason. Of more importance to me is freetype2, which enables the Render extension for chips that support it (the one in my notebook does), which in turn enables typeface anti-aliasing if you use KDE and your QT is compiled for it. But wait, you say, you have an LCD display on your notebook (and your wife has one on her desktop). Right. Normal things that bring this about don't work with LCDs. I wouldn't even try but for some magical commands that Linda Walsh at SGI cooked up which show promise. And I promise to make a little howto out of them as it unfolds -- and if I ever get XFree86-4.x to work on an LCD here. In any case, I wanted to try t out. To configure XFree86-4.02 in SuSE 7.1, one invokes Sax2. It informed me that my machine had been set up for XFree86-3.3.6; did I want to continue, which would move me to XFree86-4.02. "Damn straight!" not being an option, I typed "yes." Whereupon my screen went crazy. Not good crazy but dangerous, hit ctrl-alt-backspace right now crazy. Well. Let's try plain old SaX. It did, best I could tell, nothing. And startx produced the same hash of things that Sax2 had. Okay, but there's that xf86cfg thing that is the latest and greatest that comes with XFree86. It caused my screen to go blank, but graphical blank. I don't know how to describe it, but I knew that it had gone graphical and sure enough, when I hit the three backout keys I saw that it had decided that none of my font paths was valid, which was nonsense. What did that leave? There's always xf86config. I dutifully entered the specs. (Here I first noticed that XFree takes no notice at all of LCD monitors.) This produced an /etc/X11/XF86Config that from the looks of it might work. Time for startx. The screen went blank. The hard drive chugged along. After a long time (as is typical) the KDE startup music played. Problem was, the screen was still blank. This was getting a little annoying, but I'd learned from the desktop machine that no known configurator produces an optimized XFree86-4.x configuration file. So I opened XF86Config in a console editor and started trying different things. No joy. My choices were the frantic screen corruption or polite blankness that otherwise worked. Diving back into the docs, I learned that SaX2 could be invoked with -m 0:[something] switches, where [something] was a driver. I tried it with VGA, and it started politely. SaX2 is a nice program, and it makes all the quiddities of XFree86 accessible to anyone. Problem is, it concluded that it was the VGA server I was trying to configure, rather than my having used the VGA server to get to it in the first place. Afterwards, startx didn't even try to go graphical. It rendered instead the X equivalent of "what the hell is the matter with you?" Editing the XF86Config file it had produced gave me a choice of calm KDE start, music and all, but blank screen, or frenzied screen I dumped out of before I learned whether there was any music. I reread the docs, both SuSE and XFree. I tried everything that showed the slightest promise. No joy. I went to the wonderful linux-laptops.net site, which has a great repository of XF86Config files, though many are outdated. Finally, in desperation, I typed "XF86Setup." The familiar screens appeared. I entered the information. It made an /etc/XF86Config. I typed "startx." Soon I was in KDE. And in XFree86-3.3.6. Which is where I am as I write this. And it strikes me, the difference between pcmcia-cs, which is a kind of niche package, of use to a relatively small portion of the Linux universe, and XFree86, which most everybody needs. The former just works. Where it doesn't, it allows for fiddling around. The latter, in its 4.x incarnation, just about never works out of the box. Its automatic configurations, in my experience, always require editing, usually through the insertion of modelines calculated by trial and error. In this case, even that didn't work. As good as pcmcia-cs is, XFree86 isn't. Pcmcia-cs doesn't pretend to identify cards it can't; XFree does. SaX2, 2. And the XFree people have abandoned a familiar configuration program, XF86Setup, for some goofy new thing. Nice coat of paint, but rust underneath. It is a far, far better thing that pcmcia-cs does than ever XFree86 has done before.
|