Small Steps on Arm Rpms

I’ve recently been working on automating the RPM package generation for ARM processors.  The script takes as input the SOURCE packages for the School Server at http://fedora.laptop.org/xs/stable/olpc/xs-0.7/source/ and grinds out binary RPMs  on the local Trimslice ARM processor.

To my amazement, after the usual false starts, I launched the script, and 50 minutes later 18 of the 21 source packages came popping out as armv7hl binaries, or noarch script RPMs at the other end.  I giggle a little to realize that the first time I tried to do it, with all the learning curve, and tool setup, the same process took over a week.

The packages that didn’t compile were kernel, linux-firmware, and syck, which seemed like a manageable outcome. The scripts to accomplish it all turned out to be pretty simple:

#!/bin/bash
#script to process olpc soure rpms

WORK_DIR="/home/gh/xs_srpms"
SOURCE_URL="http://fedora.laptop.org/xs/stable/olpc/xs-0.7/source/"

mkdir -p $WORK_DIR
cd $WORK_DIR 
#if [1 -eq 1] ;then
    wget -r -l1 -nd -nH -o wget.log %s $SOURCE_URL
#fi

for name in `ls *.src.rpm | gawk 'FS = "-[0-9]" {print $1}'`
do
    mkdir -p $name
    mv $name* $name
    pushd $name
    rpm2cpio $name* | cpio -idm
    popd
done

#now compile all the stuff
rm -rf /home/gh/rpmbuild
rpmdev-setuptree
/home/gh/bin/compilexs > compile.log

The output from the compile script is sent to a log file:

#!/bin/bash
#script to compile packages
#filename: compilexs
#turn on line by line debug output
set -x

WORK_DIR="/home/gh/xs_srpms"
BUILDIR="/home/gh/rpmbuild"

cd $WORK_DIR 

for name in `ls -1 -I".*"` 
do
    pushd $name
    echo "operating on $name"
    cp * $BUILDIR/SOURCES
    rpmbuild -ba $name.spec
    popd
done
Advertisements

About George Hunt

Retired electrical engineer and programmer, enthusiastic about OLPC as a vehicle for gathering together volunteerism, mine and so many others', for helping education in developing countries.
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to Small Steps on Arm Rpms

  1. kevix says:

    good to see that things are working now. funny how the 2, 3 or 4th time it seems to work like magic. just part of the learning curve.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s