A Gentle Introduction to the Autotools in Portland

Posted by Scott on Nov 29th, 2011

If you’re in the Portland area and are curious to learn a few things about the Autotools, please feel free to attend the December meeting of the Portland Linux User Group at PSU. I’ll be giving a novice-friendly introduction to the Autotools.

Autoconf. Automake. Libtool. This trio of build configuration utilities (known as the Autotools) are used in a large majority of compiled software applications for Linux, but they remain a mystery to many of us.

In this gentle introduction to the Autotools, Scott Garman will help lift the veil of uncertainty most people have about them. You’ll also learn about the GNU Coding Standards and the Filesystem Hierarchy Standard, two specifications which explain a lot of the “why” behind the Autotools (yes, there is a method to this madness!).

Finally, Scott will offer some practical tips for understanding and fixing errors you may see when building an Autotools-based package. It’s sure to be a fun romp for the whole family.

When: 7-9pm Thursday, December 1, 2011
Where: Portland State University Engineering Building, room FAB 86-01 (this is in the basement). The building is on SW 4th Ave across from SW College Street.

How to Setup an openSUSE chroot

Posted by Scott on Feb 13th, 2011

chroots provide an extremely useful way of running multiple Linux distros on a single computer without having to run them within a full virtual machine environment. Why would this be an advantage? Well, in my case, I’m performing builds of hundreds of packages for the Yocto Project, and I want to maximize performance by avoiding having to go through a virtualization layer to access my hard disks.

My goal was to create a minimal environment which closely matched what we’re running on some of our autobuilders, which happens to be openSUSE 11.2. It’s easy to set up Debian-based distributions within a chroot by using the debootstrap command, but openSUSE doesn’t have anything analagous to this AFAIK.

It turns out it’s pretty simple to use zypper, openSUSE’s command-line package management utility, to bootstrap an installation into an arbitrary sysroot that you can then use to pull in additional packages over the network. The only caveat is you have to create your initial chroot on an existing openSUSE machine where you have root privileges. Here’s how.

The first thing you’ll need to do is set up the most basic openSUSE package repository config within your sysroot. To create this in the /data/opensuse-11.2 directory, you’d do the following:

mkdir /data/opensuse-11.2
zypper --root /data/opensuse-11.2/ ar http://ftp.osuosl.org/pub/opensuse/distribution/11.2/repo/oss/ repo-oss

Next, you’ll need a /dev/zero device file within your sysroot, since some packages have post-install scripts which make use of it. You can create it manually, but I prefer to simply copy it from /dev:

sudo mkdir /data/opensuse-11.2/dev
sudo cp -a /dev/zero /data/opensuse-11.2/dev/

Presumably you’ll want to move this chroot onto another computer as soon as possible, so here I only install a few needed packages to get started (rpm, zypper, wget, and vim). An editor can be handy in case you need to edit a configuration file (in my case, to configure system-wide proxy settings in /etc/sysconfig/proxy):

sudo zypper --root /data/opensuse-11.2/ install rpm zypper wget vim

At this point you can now tar up the chroot and copy it over to your destination machine of choice. Keep in mind you’ll still need root privileges to tar it up properly:

cd /data
sudo tar cvjf opensuse-11.2.tar.bz2 opensuse-11.2

I use schroot to manage my chroots and highly recommend this little-known utility. It allows you to work within a chroot’ed environment but still have access to your home directory (or any other directory, if you configure it as a bind mount).

After having moved my chroot to its final destination, I added additional zypper repositories and followed the Yocto Project Quick Start Guide to install required build dependencies.

zypper ar http://download.opensuse.org/update/11.2 repo-update
zypper ar http://download.opensuse.org/repositories/security/openSUSE_11.2/ security
zypper ar http://download.opensuse.org/repositories/openSUSE:/Tools:/1.7/openSUSE_11.2/ tools
zypper refresh
zypper install python m4 make ...

From that point on, I could fire up a schroot session anytime I needed to perform builds within a minimal openSUSE 11.2 envrionment with no need to deal with virtualization environments or reboot into another OS.

Twitter for Power Users

Posted by Scott on Aug 3rd, 2008

Someone had to do it – a vim plugin for twitter. Now you can send your tweets in between config file edits or code checkins. I’m gonna have to try this one out.

Blog Badges



[FSF Associate Member]

Archives