Skip to content
RootFS Build Factory
Branch: master
Clone or download
Latest commit b83b56f Dec 14, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Added screenshot Jul 30, 2015
templates template for odroidc2 Dec 11, 2016
tests Fix etcoverlay path in test template Jul 18, 2015
yumplugins Added rbf kernel upgrade plugin Jul 12, 2015
LICENSE Update to README Nov 26, 2016
pylintrc Integrated arnebjarne's patch to determine loop device using subprocess Jul 9, 2016 Added support for Dnf Jul 11, 2015 Added Lamobo R1 to list of Special Boards Aug 2, 2015 Tweaks to root password setting process Sep 13, 2015 Code Cleanup Jul 10, 2015 First Commit. Uploaded Code Jun 10, 2015

RootFS Build Factory

Developed for Google Summer Of Code 2015

Organization: CentOS

Written By: Mandar Joshi [emailmandar at]

Mentor: Ian McLeod [imcleod at]

RootFS Build Factory is a set of tools and scripts to generate rootfs images for 32-bit ARM Boards.

  • Tested with Fedora 23 ARM (Dnf) and CentOS 7 ARM repositories.
  • Default root password has now been set to password1234 in all templates.
  • For now, disable SELinux while generating an image.

Tested Emulators

Tested Boards

  • Cubietruck
  • Odroid C1
  • Raspberry Pi 2
  • Banana Pi (Tested By Nicolas [nicolas at])
  • Cubieboard 2 (Tested by David Tischler [david.tischler at]
  • Cubieboard (Tested by CoruNethron) [corunethron at]

Untested Boards

  • Wandboard{solo,dual,quad}
  • Pandaboard
  • CompuLab TrimSlice
  • Beaglebone
  • Banana/Lamobo R1

Unsupported Boards

  • Refer this document to learn how to add support for more boards.

If you have any of the untested boards, please test the RootFS Build Factory and let us know the results. You can email me [emailmandar at] or discuss it on the CentOS arm-dev mailing list


  • You need to be root to use RootFS Build Factory

  • One of the initial checks makes is if you have the required programs to generate images.

  • If you want to use, 'dialog' is required as a dependency of python2-pythondialog (gsoc2015 repo). Install it using

      yum install dialog
      yum install python2-pythondialog
  • My test setup is Fedora 21 ARM and CentOS 7 ARM on Cubietruck.

  • root password has been set to password1234 in all templates.

  • You need to install dosfstools if you want to create vfat partitions.

  • the etc overlay directory (default ./etc) is not cleared before every run. It allows you to copy any config files to the new installroot. So files present in the etc overlay directory will be copied to the new installroot's /etc.

Usage of

  • Edit template/cubietruck.xml and set image path in the image tag

  • Set repository information as per your distro. templates/cubietruck.xml and templates/rpi2.xml are bare minimum ones. You can even specify a local repository if you have one. The provided info is used as baseurl.

  • To just parse the XML Template

      ./ parse templates/cubietruck.xml
  • To Also build image.

      ./ build templates/cubietruck.xml
  • Follow the output of the script.

  • Once the image is generated write it your microsd card using dd or dcfldd

      dcfldd if=cubietruck-centos-image.img of=/dev/sdb bs=1M
  • The default config of u-boot is set as console=ttyS0,115200 If you want to see the boot messages you will need a USB to TTL Cable. The provided u-boot for cubietruck supports HDMI console. However USB Keyboard gives some problems.

  • With the Cubietruck,Raspberry Pi and Odroid C1, once booted you will get the login prompt on HDMI tty0.

  • You can experiment with different templates. You can use custom built kernels too. See templates/odroidc1.xml

  • The group and package tags in the packages element take comma separated package names as well.

Usage of

  • It uses the python2-pythondialog-3.3 library. You can get the rpm from the rpms directory or install it from source from As dependency it needs dialog installed. So do this first

      yum install dialog
  • The main menu looks like this

![rbf dialog main menu](doc/screenshots/rbfdialog_main.png "Main Menu")
  • There are quite a few options to set. So the best way to use it is to load a working template first and then edit the options as per your requirement.

  • Go to View Template to verify that all the options have been set.

  • The do Save Template to save the XML template to a location of your choice.

  • Then run

      ./ build /path/to/template.xml
  • The dialog based UI uses space completion instead of tab completion. It takes some time to get used to.

Usage of

  • If you have generated a Qemu image i.e. one with no bootloader, you can use to create a microSD for boards where the only change required is the bootloader.

  • In case of SPECIAL_BOARDS (RPi2, Odroid, Lamobo R1*), Writes RBF Generated Image to microSD

  • In case of Other Boards: Writes Generic/QEMU image to microSD and then Board Specific U-Boot to microSD

  • Usage

      ./ <imagePath> <device>
      ./ centos.img /dev/sdb

Known Issues:

  • This happens with the Cubietruck at times. It has happened to me twice after plugging in the HDMI cable. It boots from NAND flash instead of the microsd card. Just rebooting by pressing the button on the side fixes the problem for me.

  • On one of my micrSD cards, one issue I have faced on the Cubietruck is resetting of CPU while loading the dtb. Here are the messages from the serial console

  • On Raspberry Pi 2, firewalld doesn't start correctly. This is caused by IPv6_rpfilter=yes in /etc/firewalld/firewalld.conf. Firewalld gives this error in /var/log/firewalld while starting. Setting IPv6_rpfilter=no in /etc/firewalld/firewalld.conf fixes the problem for me.

Usage of scripts in commonscripts:

  • $FILE $EXPANDBY Expands $FILE by $EXPANDBY. Uses fallocate to expand the provided file

      commonscripts/ disk.img 4096M
  • $FILE $LOOPDEVICE Creates a loop back device for provide partition. Can be use to create /dev/loop* for partition from raw disk image.

      commonscripts/ disk.img /dev/loop0

    To Detach, use losetup -d

      losetup -d /dev/loop0
  • $FILE $PARTITION $MOUNTPOINT Mounts specified partition from disk image to mount point.

      commonscripts/ disk.img 1 /media/pendrive/
  • $FILE $DEVICE Informs user which device will be written to (displays vendor and model) before executing the dd command

      commonscripts/ centos.img /dev/sdd

Usage of yumplugins/

This plugin executes kernelup script rbf(boardname).sh everytime kernel-core is installed or updated. To learn how to write a kernelup script, refer this document.

  • Copy yumplugins/ to /usr/lib/yum-plugins/ and yumplugins/extlinuxconf.conf to /etc/yum/pluginconf.d/

      cp yumplugins/ /usr/lib/yum-plugins/
      cp yumplugins/rbfkernelup.conf /etc/yum/pluginconf.d/

Usage of dnfplugins/

This plugin executes kernelup script rbf(boardname).sh everytime kernel-core is installed or updated. To learn how to write a kernelup script, refer this document.

  • Copy dnfplugins/ to /usr/lib/python2.7/site-packages/dnf-plugins/ and dnfplugins/rbfkernelup.conf to /etc/dnf/plugins/

      cp /usr/lib/python2.7/site-packages/dnf-plugins/
      cp rbfkernelup.conf /etc/dnf/plugins/

About contents of the directory 'files':

You can’t perform that action at this time.