Thursday, October 25, 2012

How to Setup an Alternative Linux Distro Chroot Under Ubuntu - Part 2

NOTE: This is part 2 of a 2 part series.

In my last post, we setup a chroot environment for our RPM based distribution in /srv/chroots/rhel6-ppc. Now we'll setup schroot so we can access this environment as if it were the booted system, and using a union type scheme (an schroot configuration setup) so that we will always have a pristine environment for builds and such.

So let's look at /etc/schroot/schroot.conf and add the following entry:

description=RedHat Enterprise Linux 6

This is the basic setup. The key here is that it uses overlayfs for union mounting the original. This means that after you exit a newly created schroot for this entry, it will be purged and the original chroot will not be changed.

Also, the profile=default means it will use configurations from /etc/schroot/default/. Make sure to add yourself to the adm group or run schroot as root.

In order to try it out, use the following command:

schroot -c rhel6

From here, you can do whatever it is you like to do in your new environment!

Wednesday, October 24, 2012

How to Setup an Alternative Linux Distro Chroot Under Ubuntu - Part 1

NOTE: This is part 1 of a 2 part series.

Developing a new server product requires me to test all sorts of things, including multiple distributions. As an Ubuntu developer, my main platform is, of course, Ubuntu.

It's a PITA to run multiple distributions from one system (and not very productive doing it from multiple machines), so I decided to setup chroots for each one. My production system has three environments outside of the main Ubuntu install: RHEL5, RHEL6 and SLES11.

Fortunately, Ubuntu has a nice tool called schroot. I like it because it's based off the original tool called dchroot, which I wrote back in 1999 (wow). It was mainly to allow people to use the UltraSPARC developer systems with more than one release of Debian without me having to setup multiple machines.

Fast forward 13 years, and now we have schroot. This tool has come a long way, and even includes support for snap shot of file systems so you can always start with a pristine environment. This is useful to me because I want to make sure when I build a package, only the required dependencies are installed, and I don't want to worry about screwing up the original environment. Not to mention, I can start more than one session and they wont bother each other.

In addition to schroot, we will need the rinse package. For anyone familiar with debootstrap, it's basically the same thing, but for RPM based systems. It will download and bootstrap all the required RPMs needed for a particular distro, in a manner suitable for a chroot environment.

sudo apt-get install schroot rinse

Now, if you look in /etc/rinse/rinse.conf, you will see several already configured RPM distributions. If you are wanting to do one for RHEL, you will need to either use CentOS instead, or duplicate the matching CentOS entry and rename, being sure to change the mirror URL to match your location. For my RHEL distros, I have a local RPM repository, so I use this entry:

mirror       = file:///srv/rhel6-ppc/RPMS/media/Packages

You will also need to copy the matching .packages file in /etc/rinse/ naming it the same as your entry.

Now decide where you want your chroot to be located. I've decided to put mine in /srv/chroots/rhel6-ppc. Create this directory, and then you can run the rinse command as follows:

sudo rinse --arch ppc --directory /srv/chroots/rhel6-ppc --distribution rhel-6

NOTE: I have my rinse script hacked a little to allow ppc as an arch. You will probably use i386 or amd64. Also, the --distribution argument is the same as the entry name.

In my next post, we'll move on to configuring schroot with a union type backing.

Monday, October 22, 2012

Where to Obtain PowerPC Dev Kits

I was asked this today on #ubuntu-kernel. It's a good question, and one which I hear often. Most people can go with old Mac hardware, but those things are kind of obsolete and largish for many people. Not to mention it doesn't do much justice for the modern CPUs you see today (multi-core, hardware virtualization, SATA, DDR2/3, etc.). Unfortunately, you aren't going to find many cheap modern Power kits like you would expect in the ARM world, but here some some quick links that I was able to put together. I would stick with Freescale, but IBM has some dev kits too.

  • Micetek - These are actually really nice
  • Embedded Planet - Very low CPU speeds
  • IBM 750FX - 64-bit but unsure about pricing
  • Emerson - Unsure of pricing, but very broad list of CPUs for IBM and Freescale

If you know of more, please comment and I'll add them to this post.

Friday, October 19, 2012

Can Canonical Make Skunkwork Work?

This post is in regards to Mark's recent announcement that Ubuntu 13.04 will be using a skunkworks approach to some of its more wow-factor features.

I know some people are going to cry out from their basement, screaming "community, community, community!" Let's face it though, one thing Linux is missing is being able to release something and people say "holy shitballs, batman!"

Anyway, I totally applaud Mark and Canonical for this decision. If it all goes well, here's my vote for naming 13.10 the Snazzy Skunk.

Tuesday, October 2, 2012

The GOP/DEM Circlejerk

This is slightly off from my normal blog topics, but it is election season. As I stare off with an uncontrolled dazed look on my face, pondering which candidate to vote for, a deep depression has set in.

I could choose Obama. At least I'll know what I'm getting, even though I disagree with his wealth distribution policies and bailing out too-big-to-fail companies that are sending us in a spiral of debt.

I could choose Romney, since I'm Republican, but I honestly don't like him as a person, and I feel he will serve money hungry people more than a strict capitalist agenda.

I could vote Libertarian, but, let's be honest, that will just take votes away from one of the other candidates. At this point, a vote for anything other than Romney is like voting for Obama.

My depression begins when I consider that the two primary political parties are only interested in preserving themselves. Considering that Democratic and Republican platforms have morphed every election campaign into what they think will get them voted into power, or attempt to separate themselves from one another, I can never be sure that the party I choose on my beliefs really fits who I'm voting for.

Every election it's the same thing: "Your problems are because of <insert opposite party>." Neither party will say "our platform allowed these problems to happen" or "the bills we voted caused a downturn in the economy, we'll revert that and try something else."

Let's consider this. Say you work at a company. You and another co-worker handle a particular product or service together. You work well together, bouncing ideas and patting each other on the back. One day, your manager quits, and since your company promotes from with-in, you know that you or your co-worker are going to replace him. You'll get more money, access to the executive bathroom, more vacation days, etc.

So during the manager's last couple weeks, you work your ass off. You make sure that the higher ups responsible for the decision see your hard work. You are basically campaigning for this new position. Your co-worker, being prudent, does the same thing.

Now, instead of working closely together, you are both trying to make yourself look more important and more manager-like. During these few weeks, arguments ensue, and instead of trying to build a great product or service, you are positioning, spreading distrust against your co-worker and generally being unproductive, all for the power of that promotion.

In the end, your co-worker wins out. You blame it on him bringing the top-shelf bottle of liquor to the Christmas party and taking the boss out to golf with some no-name NBA player that his cousin is towel-boy for. It's definitely not because he's better.

Now you stew in your hatred toward him as he becomes YOUR boss. At first, you continue to do your job, until one day he tells you that he thinks the product would be better if you changed one aspect. This doesn't sit well with you. "Who does he think he is?" It wasn't your idea, so it must be crap. You toss all logic aside and just hate his suggestion, regardless of the fact that it will save tons of money and is generally better at solving a certain problem than your solution would have been.

You do as you're told, but you don't have it in you to put in 100% effort. You don't necessarily sabotage the product, but the solution he asked you to implement is definitely half-assed and you don't care.

Now the product goes into production, and sure enough, the implementation falls flat, the one that you worked on. However, it was his idea, so you don't care. When the firestorm comes down from above, you blame the problem on your back-stabbing co-worker that took yer job. "He wanted it implemented this way, but I wanted to do it different." Sure enough, he's canned and now you have the manager job.

You got what you wanted. The power courses through your veins like an espresso hopped up on Redbull. You are the man. Now, two people work for you, one of whom was there when you did the poor implementation, and overheard you complain about your manager at the water cooler. He knows what you did, and has a distaste for how you got your new job. He thinks you are incompetent and undeserving: He is just like you used to be.

You get my meaning here? How can we expect Congress or the President to do anything useful if their entire intent is to make their affiliate party look good, not to mention, self-serve their lust for power? How is the President supposed to get anything done when his counterparts in Congress are trying to set him up for failure so they have bullet points on the next presidential election?

I wish I had some sort of proposal to fix this, but alas, I'm not a political scientist, so all I can do is bring the bad news.