Thursday, August 25, 2016

What is a Linux Distro?

We've got a number of folks in a Facebook Linux group I moderate who are playing around with the guts of their Linux by swapping around pieces from different distros. Which is cool--experimentation and tinkering are always good things.

It has raised a point that I think may require some background. Specifically, "What's a distro?"

Back in Ye Olden Days

When Linux first came around, those of us who wanted to play with it got source code. And that's all. We'd compile the kernel under some other operating system (Windows, another Unix, or maybe even the Mac of the time if you were a masochist!)

Then we'd start compiling binaries for our Linux kernel--a shell and cc would be a common place to start so that you could start compiling stuff for Linux under Linux.

After a while, we realized that we were duplicating a lot of effort. Many of us had fairly generic systems that we could swap binaries between without having to recompile absolutely everything.

With time, the concept of having a set of precompiled binaries for the kernel and applications as a starting point for a Linux system became the basis for a distro. Usually you'd install from a set of floppies or a CD. If the kernel you chose from the distro was close enough for your purposes, you'd just use one of the ones they'd precompiled. If you wanted something more suited to your hardware, you'd recompile the kernel with a few configuration changes and usually get much better performance and a more stable system, without having to recompile the application binaries for user space.

We still regularly compiled applications. Anything that wasn't bog standard usually would have to be compiled. As time went on, the list of precompiled binaries for each major distribution grew, and then distros started to have their own package managers to ease the installation and management of precompiled binaries.

The ability to do this is a large part of what has turned Linux from a tech toy used by a select few who are comfortable with compiling their own operating systems and applications to being the generally popular operating system it is today.

Stepping Into Today

Now it's not uncommon for users to choose a distro according to the application set they want for their system.

Different Linux distros have sprung up with selected sets of software precompiled and ready to install and run, or as part of their base installation.

The specialization has reached back into the kernel, too, as maintainers of the distros have improved their distro by compiling a kernel that suits the base suite of applications they provide. Distros that are intended to be more general-purpose likewise make changes to the Linux core to make the installation and hardware detection process simpler and more robust to make installing and setting up Linux easier for users.

More software is more easily available to everyone because of this. All the major distros are tied to a system of package management that provides users with almost limitless choices of software to install on their system.

Going outside the distro's own software repositories (repos) is certainly possible, especially in the instance of distros that are upstream of one's own.

For example, if you're running Mint, it's a snap to include repos for Ubuntu and Debian in your package manager's list of repos. And chances are almost all the software there will run without problems. For all I know (I haven't installed Mint in a while) Mint includes the Ubuntu repos by default, I seem to recall that being the case in the past.

However, if you're crossing over between branches, like wanting access to software compiled for Fedora that's not in the Debian-family distros, then you're starting to put yourself in a position of having more errors. The filesystem layout is different between Fedora and the Debians. There may be differences in the kernel configurations that will cause you problems.

If you want to get software that isn't in your distro's repos, or in a closely related distro (preferably upstream), then the correct answer is really to compile it yourself on your system, rather than use software someone has compiled on a different system configuration.

If you want to save other people the trouble, see about contributing your effort to your distro's repos. They'll probably have standards of what you have to do to do that, but you can be part of the team that makes your distro that much cooler pretty easily.

Kernel Swaps

I've seen discussions of turning one distro into another on the Facebook group. Hopefully a better understanding of what a distro is, and how it is defined, helps to show why "Turning Ubuntu into Kali" or some such is a misnomer. If you're grabbing another kernel then starting your system off it, you're no longer running either distro. You've gone custom.

That's not a bad thing, experimentation is a good thing. But you also want to look at how effective the technique of playing mix-and-match with precompiled system files and applications is versus just doing your own compilation with the stuff you want.

If there's a specific distro that you want the advantages of, it's best to install it rather than to build a sort of chimera by grabbing pieces then lashing them on to your current distro. You're asking for trouble by using binaries that haven't been compiled using the same assumptions at compile time.

If you want something truly custom, then rolling your own Linux is very probably the way to go. It's not hard, and that used to be the standard installation method. There are a number of systems out there to make it even easier than we had it in the old days (Linux From Scratch, Gentoo, etc.)

I hope this helps clear up some of the confusion about distros and their parts. :)

Wednesday, February 24, 2016

Yaesu FT-2900R PTT Switch Fix

One thing that's bothered me about my otherwise excellent Yaesu FT-2900R radio is how touchy the push-to-talk (PTT) switch is on the included microphone. It's got a very light "touch" to it, which means the least bump or press puts you on the air whether you want to be or not.

It's hard to get it out of the microphone bracket or to hand it to someone else without hitting the switch and doubling over someone while you make unhappy noises about the surprise of the switch getting pressed AGAIN. My wife and daughters often share my station with me when we're checking in to local 2m nets, so being able to hand off the mike is pretty important around here.

Today I finally decided to take matters in hand. Fortunately, Yaesu makes it easy to get into the mike. There are just three screws, two near the bottom of the mike, and one going through the button for the mike bracket (that will be the long screw when you go to put it back together.) Once inside you can see why there's a problem. All the keeps the PTT from getting pressed is a little piece of springy foam that's down near the pivot point for the switch. When you push on the normal part of the switch (or bump into it), you get a lot of mechanical advantage on this little bit of foam, it goes squish, and you're on the air as the plastic tab up top presses into the little microswitch on the microphone's PCB. Not good!

Adding Some Crunch

I took some measurements with a caliper, then headed to the hardware store. In the little drawers of specialty items there are springs (at least in my local hardware stores.) Among them are some small compression springs. The one I chose was a #9 Compression Spring. The specifications are: 0.312 inches OD, 0.047 thick wire, 2 inches long (as sold.) That's 5/16 inches diameter, aka 7.94mm. And 3/64 inches wire, aka 1.19mm. And 2" is about 51mm.

I took this home and clipped a bit off, as you can see in the images. The part I used was about 7/8 inches long, or 22mm. The cut end went over the plastic tab that presses the PTT switch inside the mike, with the flat end resting against the switch body.


If I were the paranoid sort, I'd put a bit of protective tape over the printed circuit board to protect it from the spring. However, there's nothing for the spring to short to even if it does wear through the solder mask on the trace it lays over. So I just left it alone.

After reassembly, my microphone has a nice crunchy feel to it, and it takes just the right amount of force to close the PTT switch now. The force resisting closure is up at the top of the switch where it belongs, now, so even this little spring does the job.

I hope this helps some of you out there, because I've heard a lot of other FT-2900R owners with the same complaint about the PTT switch that I've had.