Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Source RPM and Pi Images

Dylan Christopherson edited this page Aug 8, 2018 · 1 revision

Creating an RPM of OpenMPI to transfer it into the image.

Build OpenMPI

https://www.open-mpi.org/software/ompi/v3.0/srpm.php

git clone https://github.com/open-mpi/ompi.git
cd ompi
./autogen.pl
./configure --prefix=/directory/to/place/folder/build --enable-static --enable-orterun-prefix-by-default
make dist install

Prep Source RPM Files

Within the /ompi/contrib/dist/linux/ directory, you'll find the files buildrpm.sh and openmpi.spec

Copy the files into the area you will run chroot in. Also copy the openmpi-gitclone.tar.gz file in your openmpi directory into the same folder as you copied the two files. Create a new file

cd ~
vim .rpmmacros

In the file:

%_topdir /home/pi/rpm
%_tmppath /home/pi/rpm/tmp

Build Source RPM

In the folder you built openMPI in, there should be an openmpi.tar.gz file (This was created when using dist). The buildrpm.sh should build the correct file structure in the correct directory; if it doesn't, you might need to build it yourself.

cp openmpi.tar.gz /home/pi/rpm/SPECS/openmpi-openmpi.tar.gz
./buildrpm.sh openmpi-openmpi.tar.gz
cp /home/pi/rpms/SRPMS/openmpi-openmpi...rpm /tmp/messy
cd /tmp/messy
rpm2cpio openmpi-openmpi..src.rpm > name.cpio                //Converts RPM to a CPIO fle

Add RPM into Image

Now copy the images already created in the /home/pi/go/bin/boot directory to another folder. /tmp/messy2 should work.

cd /tmp/messy2                   //An image should be in the folder now
gzip -dc <img.gz> | cpio -iv                 //Opens up the image...

cp /tmp/messy/name.cpio /tmp/messy2
cpio -idv < name.cpio                        //Dumps the contents of the cpio file into its current folder
gunzip openmpi-openmpi.tar.gz                //Unzips contents
tar -xvf openmpi-openmpi.tar.gz              //Untars contents
rm a.cpio openmpi-openmpi.spec openmpi-openmpi.tar.gz    //Removes unnecessary files

find . | cpio -oc | gzip -c > ../<name.img.gz>           //Rebuilds the image
Clone this wiki locally