Thursday, 31 May 2012

Fedora 17 on Raspberry Pi

I received my Raspberry Pi this week and set about installing Fedora, my operating system of choice, on it.  Unfortunately, Fedora 14 is regarded as unstable on the Raspberry Pi and Fedora 17 isn't quite ready for it yet.

However, there are some very good nightly snapshots of Fedora 17 (http://scotland.proximity.on.ca/arm-nightlies/) for Raspberry Pi available.  I thought I would put together a short guide on using these.

This guide assumes:
  • You are logged in as root on a Linux computer
  • Your SD card is /dev/mmcblk0 when inserted into your SD card reader.  If your SD card is on a different device file then make sure you work out what it is and use the right file-name in the instructions below - getting this wrong could permanently lose data.


The first thing to do is to select the image you want to install.  The nightly builds come in three flavours:
  1. Console only (this is the one I use and referred to in the rest of the instructions)
  2. Minimal X Windows
  3. XFCE

Once you have chosen your image the process is:
  1. Download the software (replace the URL here with the one for the image you have selected):
    # wget http://scotland.proximity.on.ca/arm-nightlies/vault/f17arm-latest-arm-rpi-mmcblk0.img.xz
  2. Insert your SD card (unmount it if your computer automounts it for you) and write the image to the card:
    # xzcat f17arm-latest-arm-rpi-mmcblk0.img.xz > /dev/mmcblk0
  3. When your Raspberry Pi boots this image for the first time it will resize the root file-system to use up the whole card.  Waiting for this is tedious and it gets in the way of using your Raspberry Pi right away.  Fortunately, on a Linux PC, you can do this manually (and quickly):
    # fdisk /dev/mmcblk0 (commands I entered and comments in bold below)

    Command (m for help): p

    Disk /dev/mmcblk0: 7822 MB, 7822376960 bytes
    4 heads, 16 sectors/track, 238720 cylinders, total 15278080 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

            Device Boot      Start         End      Blocks   Id  System
    /dev/mmcblk0p1   *          63     1044224      522081    c  W9...
    /dev/mmcblk0p2         1044225     7784447     3370111+  83  Linux

    Command (m for help): d
    Partition number (1-4): 2

    Command (m for help): n
    Partition type:
       p   primary (1 primary, 0 extended, 3 free)
       e   extended
    Select (default p): p
    Partition number (1-4, default 2): 2
    The first sector must be the start sector of /dev/mmcblk0p2 (above).  This number may be different on your SD card.  It should be the default value here - but check it carefully anyway.

    First sector (1044225-15278079, default 1044225): 1044225
    The last sector should be the default if you want to use all available space on the SD card.  If the default is what you want just press return.

    Last sector, +sectors or +size{K,M,G} (1044225-15278079, default 15278079):

    Using default value 15278079

    Command (m for help): w

    The partition table has been altered!

    Calling ioctl() to re-read partition table.

    Syncing disks.
    # e2fsck -f /dev/mmcblk0p2
    # resize2fs /dev/mmcblk0p2
    # mkdir /tmp/rootfs_pi
    # mount /dev/mmcblk0p2 /tmp/rootfs_pi
    # rm -f /tmp/rootfs_pi/etc/systemd/system/multi-user.target.wants/rootfs-resize.service
    # umount /tmp/rootfs_pi
    # rmdir /tmp/rootfs_pi
  4. Now eject the SD card from your reader, put it in your Raspberry Pi and power up.  Once it has booted log in as "root" using the password "fedoraarm".  (Assuming that you are connected over a wired LAN with a DHCP server) the Raspberry Pi will automatically obtain an IP address and LAN settings (I am going to assume this is the case - if not the process for configuring networking is exactly the same as it is on any other Fedora 17 machine).
  5. Update your packages:
    # yum update

    Don't worry about the fact that a new kernel is installed - even though this new kernel is not Raspberry Pi compatible.  When a new kernel is installed using "yum update" the old one (and it's modules) are not removed.  Also, because of the way the UBOOT partition in the images works, installing a new kernel does not change the default kernel used when you boot.
Job done.  You now have a perfectly usable and up-to-date Fedora 17 Raspberry Pi SD card.




Monday, 9 April 2012

Air Video Server for Linux on Fedora 16

I use the excellent Air Video software to stream non-MP4 video (including DivX) to my iPad and iPhone (I then sometimes use Air Sharing to stream the video from the iPad or iPhone to my AppleTV).  The one problem I have with this set-up is that the Air Video Server software is only released for Macs (which I don't have) and Windows (which I do have, but don't like to leave running 24x7).

Luckily InMethod have released an alpha Air Video Server for Linux.  Unfortunately, getting this installed and running on Fedora 16 (my distribution of choice) isn't entirely straight forward.  The rest of this post is a guide to installing Air Video Server Linux alpha 6 on Fedora 16.

  1. Download the software:
    - From InMethodAirVideoServerLinux.jarffmpeg-for-2.4.5-beta6.tar.bz2test.properties
    - From mempeg4ip-1.6.1.tar.gz (no longer available from original website), mpeg4ip-1.6.1-pd.patchairvideo.serviceairvideo

    The patch is required to make mpeg4ip build on Fedora 16.  This patch is the minimum change to get mpeg4ip to build, and has only been tested in the context of getting Air Video Server Linux alpha 6 to work.
  2. Make sure you have installed the RPM Fusion repos.  You should also consider using yum priorities to protect the integrity of your machine - that is, make sure that when the same package is in the Fedora repos and RPM Fusion repos you do not break your machine by installing the RPM Fusion version.
  3. Install the dependencies that are available as RPMs:
    [sudo] yum install esound-devel faac gcc gcc-c++ \
             glib2-devel gtk2-devel java-1.7.0-openjdk lame-devel \
             SDL-devel x264-devel
  4. Build FFMpeg:
    tar jxvf ffmpeg-for-2.4.5-beta6.tar.bz2
    cd ffmpeg
    ./configure --enable-pthreads --disable-shared --enable-static \
      --enable-gpl --enable-libx264 -
    -enable-libmp3lame
    make all
    [sudo] make install
    cd ..
  5. Build mpeg4ip:
    tar zxvf mpeg4ip-1.6.1.tar.gz
    patch -p0 < mpeg4ip-1.6.1-pd.patch
    cd mpeg4ip-1.6.1
    ./configure
    make all
    [sudo] make install
    cd ..
  6. Install Air Video Server for Linux:
    [sudo] mkdir /usr/local/share/AirVideoServer
    [sudo] cp airvideo /usr/local/share/AirVideoServer
    [sudo] cp AirVideoServer.jar /usr/local/share/AirVideoServer
    [sudo] cp test.properties /usr/local/share/airvideo.properties
  7. Update /usr/local/share/AirVideoServer/airvideo.properties to match your system:
    path.ffmeg = /usr/local/bin/ffmpeg
    path.mp4creator = /usr/local/bin/mp4creator
    path.faac = /usr/bin/faac
    folders = <the location of your video files>
  8. Configure Avahi (Bonjour/mDNS):
    [sudo] cp airvideo.service /etc/avahi/services
    [sudo] service avahi-daemon restart
  9. Configure the firewall:
    Use system-config-firewall or system-config-firewall-tui and:
    - add Multicast DNS (mDNS) to the trusted services
    - add 45631:tcp in "Other Ports"
  10. Auto start/stop on system startup/shutdown:
    [sudo] ln -s /usr/local/share/AirVideoServer/airvideo \
             /etc/init.d/airvideo
    [sudo] chkconfig airvideo on
  11. Start Air Video Server for Linux:
    [sudo] service airvideo start
After all this your Fedora 16 PC will be running Air Video Server for Linux.  The Air Video software on your iPad or iPhone will automatically find your PC on your network (thanks to Bonjour/mDNS), and Air Video Server for Linux will automatically start/stop when you startup/shutdown your PC.

Updated Sun 10 Jun 2012 00:13

Thursday, 15 September 2011

Moving my online presence

For several years I have used a combination of paid services (Dreamhost, MobileMe, and Mythic Beasts) to host my online presence.  Specifically:

  • Blog (Wordpress on Dreamhost)
  • Email (Dreamhost, then MobileMe with forwarding from Dreamhost)
  • File hosting (Dreamhost)
  • Photo gallery (Gallery on Dreamhost and then MobileMe)
  • Calendar (MobileMe)
  • Address book (MobileMe)
  • DNS (Dreamhost)
  • Domain registration (Mythic Beasts)
Earlier in the year I moved my email (still forwarded from Dreamhost), calendar, and address book to Google.  More recently I moved my photo gallery to Google Picasa.  This has means I have moved everything I had on MobileMe to free services provided by Google.  In fact, GMail has proved far superior to MobileMe as it allows me to send emails from my preferred (non-Google) email address - something MobileMe never did (I had to bodge it by send email out through Dreamhost to achieve the same result with MobileMe).

This week I received an email reminding me that my Dreamhost account was due to be renewed, so I decided it was time to find a less expensive place to host my blog, perform email forwarding, and provide DNS for my domains.
Now pretty much all of my online presence is hosted on Google, with my domains registered on (and email forwarding and DNS provided by) UKReg.  I have now gone from using two expensive services to just having to pay for my domain registrations.

Oh, and I now use links to content in a public Dropbox folder for file-hosting.

Saturday, 6 August 2011

Twitter Weekly Updates for 2011-08-06


  • I finally got around to joining CAMRA today. I've only been intending to join for 10 years now. #fb #

Saturday, 30 July 2011

Twitter Weekly Updates for 2011-07-30


  • It's been a busy week but I (finally) managed to put a lot of the work I have been doing back into #Kamailio git - more to follow soon #fb #

Saturday, 23 July 2011

Twitter Weekly Updates for 2011-07-23


  • Thinking about next year's summer holiday. I like the idea of island hopping for a couple of weeks. http://t.co/3ft19PT #fb #

Saturday, 9 July 2011

Twitter Weekly Updates for 2011-07-09


  • Considering buying an Olympus PEN E-PL1. I want something more sophisticated than a compact without the bulk and complexity of a DSLR #fb #

  • Hmm. Now thinking about getting an Olympus PEN E-PL2 instead. I found one for under £390 including VAT and delivery... #fb #

  • Ordered Olympus PEN E-PL2, leather case, and 8Gb SD card. Might treat myself to a view finder and extra lens in a couple of months #fb #

  • Congratulations @mathie and family. #