Archive for the 'fedora' Category

Making a Less-Limited USB Stick

9 Dec 2013

The FAT32 filesystem is the closest thing we have to a universal standard for passing data around, but with the capacity of modern USB flash drives its 4 GB file size limitation has become problematic. exFAT is a popular contender for dealing with that, but the patent issues that surround it make true portability a pipe dream at best.

Enter UDF. As the filesystem of choice for DVDs and Blu-Ray disks, UDF support is ubiquitous. Appropriately-formatted disks are readable by operating systems dating back to the early 2000s. All that remains is figuring out how to format it. In general, there seem to be three important things to keep in mind:

  1. Remove all traces of previous filesystems. Different operating systems use different methods to detect what filesystems a disk contains, so ensure maximum reliability by eliminating potential sources of confusion.
  2. Format the entire disk, not just a partition. OS X seems to only look for UDF when the filesystem takes up the whole disk, as it does on DVDs, so overwrite the partition table before formatting the disk.
  3. Use the correct UDF version. UDF has a number of versions that add different features, but as you might expect, newer versions require newer operating systems. Windows XP will read up to version 2.01 out of the box, though some Blu-Ray drive manufacturers have released drivers for newer versions.

I formatted my most recently-purchased USB stick on Fedora. First off, I blew away the partition table and all traces of the FAT32 filesystem it came with:

# dd if=/dev/zero of=/dev/sdb bs=1M count=1
# wipefs -a /dev/sdb

Fedora uses the mkudffs command for creating UDF filesystems, which is part of the udftools package:

# yum install udftools
# mkudffs --revision=0x0201 --media-type=hd /dev/sdb

That’s it! Now the disk seems to be usable on Fedora, OS X, and Windows, which covers just about all of my computers. I will test OpenBSD one of these days.

There are undoubtedly ways to do this on other operating systems. Feel free to comment with instructions for your favorite operating system if you know them.

Running a Text-based Kiosk with Systemd

9 Jul 2013

Eucalyptus HQ has a big TV on the wall that displays the #eucalyptus-devel IRC channel so developers can always see what is going on and jump in if they need to. Until recently, a laptop drove that display, but that seemed like overkill to me, so I went to employ my Raspberry Pi running the Raspberry Pi Fedora Remix to do that instead. Since the IRC program it’s using, irssi, is text-based I don’t need to use any of the Pi’s precious little memory to run anything graphical, so I just needed to figure out how to make systemd spawn irssi instead of a login prompt on tty1.

I would normally do this by copying /lib/systemd/system/getty@.service to /etc/systemd/system/getty@tty1.service and then editing that, but F18’s version of systemd let me do this in an even simpler manner. By creating a directory with the same name as that file, plus .d, I can add a config file to that directory that overrides only the parts of the original unit file that I need to change:

[Service]
After=network-online.target
Wants=network-online.target
ExecStartPre=/usr/bin/nm-online
ExecStart=
ExecStart=/usr/bin/irssi
KillSignal=SIGTERM
StandardInput=tty
StandardOutput=tty
User=kiosk

Now I can just plug the system in and have it automatically up and running irssi in less than a minute.

Unexpected lessons

I didn’t expect to have to run nm-online here because network-online.target is supposed to wait for a service that runs that itself, but for some reason systemd didn’t order things that way and irssi came up before the network connection did. Running that command as part of this unit worked around that problem.

Use the consoleblank=0 parameter to prevent Linux from blanking the screen after the usual ten minutes of inactivity.

I’m using the TV’s USB “service” port to power the raspberry pi. That usually works just fine, but when the TV turns off it cuts the power to that port as well, abruptly shutting the raspberry pi off. I don’t have any data loss in particular to worry about, but turning the system back on causes some annoyance: when the TV turns on the raspberry pi also powers on and attempts to detect what kind of screen it is plugged into. At that point the TV hasn’t figured out what it wants to display yet, so the detection fails and I’m left with a blank screen until I reboot the computer.

Useful Yum Commands: Installing by Path

25 May 2012

Every once in a while I find myself trying to install something, but not knowing what package contains it.

# yum install g++
Setting up Install Process
No package g++ available.
Error: Nothing to do

But if you’re using a modern version of yum (i.e. that of RHEL 6 or Fedora) then you can simply tell it to install the program you’re looking for.

# yum install /usr/bin/g++
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.4.6-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

Moving the Cloud Forward

23 May 2012

It is sort of becoming a tradition for each member of the Fedora Board to declare a personal goal of some sort and then lead by doing. So now that I am the newest Board member, some people are curious about my plans.

In 2010 I helped get Fedora’s Cloud SIG off the ground. At that point in time our main goal was to get a modern version of Fedora running inside Amazon’s popular cloud, EC2. Nowadays the EC2 image is part of Fedora’s regular release process and the Cloud SIG has grown into one of Fedora’s most vibrant groups, added support for one self-hosted cloud platform, and is on the way to adding several more.

In light of that, the answer is obvious: I plan to help the Cloud SIG continue to be successful.

Of course, that’s a rather vague goal, so here are some examples of what success for the Cloud SIG has meant in the past:

  • Building and testing EC2 images
  • Adding the EC2-controlling euca2ools command line suite to Fedora
  • Porting the cloud-init boot-time scripts to systemd

Now that those are done, here are some things success for the Cloud SIG may mean today:

  • Add more cloud software, such as the relatively venerable Eucalyptus, to Fedora
  • Continue to stabilize cloud-init on Fedora
  • Help make PaaS software like OpenShift and Cloud Foundry work with IaaS software like Eucalyptus and OpenStack

Lofty? Possibly. But they are certainly all worth the effort!

We need your help!

Want to give one of these a shot? Are you interested in attending a hackfest or an activity day for moving the cloud forward? Leave a comment or stop by #fedora-cloud on Freenode!

Comparing Versions in RPM Conditionals

10 Apr 2012

It’s easy to check a distribution’s version in a spec file since it is usually an integer:

%if 0%{?fedora} > 16

But this scheme doesn’t usually work for comparing program versions because they typically contain periods, which blow rpmbuild’s little mind. But if you have rpm 4.7 or later, you can use a bit of inline Lua to do it:

%if %{lua:rpm.vercmp('%{version}', '2.0.2')} > 0