Project

General

Profile

EmbeddedLinuxWiki

New Build Host

Waiting on cloud computing group to create a VM for us...

Current Build Host (adlinuxdev.fnal.gov)

adlinuxdev

An SLF machine outside the Controls system firewall is available for embedded Linux development -

adlinuxdev.fnal.gov

Contact Kevin Martin or John Diamond to have your Kerberos principal added for access.

Building your own tool-chain

  1. Clone the ees_buildroot project (you may want to clone into a directory named for the project or board you are developing for) -
    git clone ssh://p-ees-buildroot@cdcvs.fnal.gov/cvs/projects/ees-buildroot ees_buildroot_Conc405x
    
  2. There are several Buildroot configurations for each embedded Linux project. Select which one you want to use -
    -rw-r--r--. 1 jdiamond bdmicrop 28K Nov 21  2017 boxcar-config
    -rw-r--r--. 1 jdiamond bdmicrop 45K Dec 13 09:52 bpm-config
    -rw-r--r--. 1 jdiamond bdmicrop 47K Nov 21  2017 bulb-config
    -rw-r--r--. 1 jdiamond bdmicrop 79K Nov 30  2017 conc405x-linux-config
    -rw-r--r--. 1 jdiamond bdmicrop 27K Nov 21  2017 gunmod-config
    -rw-r--r--. 1 jdiamond bdmicrop 47K Nov 21  2017 lens-pmag-config
    -rw-r--r--. 1 jdiamond bdmicrop 27K Nov 21  2017 miextr-config
    -rw-r--r--. 1 jdiamond bdmicrop 47K Nov 21  2017 psrac-config
    -rw-r--r--. 1 jdiamond bdmicrop 27K Nov 21  2017 smtfmod-config
    
  3. Copy the -config file for the project you'd like to develop for to .config -
    $ cp bpm-config .config
    
  4. You can modify the Buildroot configuration if you'd like to customize it for a new board -
    $ make menuconfig
    
  5. Also, if you like, you can modify the Linux kernel configuration -
    $ make linux-menuconfig
    
  6. Once configured, you can start building Buildroot. The first step will download a build the cross compiler,
    then the rest of the build chain, the Linxu kernel, the root filesystem, shared libraries and ACNET applications, etc etc etc -
    [jdiamond@adlinuxdev ees_buildroot_Conc405x]$ make
    mkdir -p /home/jdiamond/workspace/ees_buildroot_Conc405x/output/target
    rsync -a --ignore-times --exclude .svn --exclude .git --exclude .hg --exclude .bzr --exclude CVS \
                    --chmod=Du+w --exclude .empty --exclude '*~' \
                    /home/jdiamond/workspace/ees_buildroot_Conc405x/system/skeleton/ /home/jdiamond/workspace/ees_buildroot_Con
    c405x/output/target/
    /usr/bin/install -m 0644 support/misc/target-dir-warning.txt /home/jdiamond/workspace/ees_buildroot_Conc405x/output/target/
    THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
    touch /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/.root
    /usr/bin/make -j1  HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" silentoldconfig
    make[1]: Entering directory `/home/jdiamond/workspace/ees_buildroot_Conc405x'
    mkdir -p /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/buildroot-config/lxdialog
    /usr/bin/make CC="/usr/bin/gcc" HOSTCC="/usr/bin/gcc" obj=/home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/buil
    droot-config -C support/kconfig -f Makefile.br conf
    make[2]: Entering directory `/home/jdiamond/workspace/ees_buildroot_Conc405x/support/kconfig'
    /usr/bin/gcc -I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"  -DNCURSES_WIDECHAR=1 -DLOCALE  -I/home/jdiamond/workspace/e
    es_buildroot_Conc405x/output/build/buildroot-config -DCONFIG_=\"\"   /home/jdiamond/workspace/ees_buildroot_Conc405x/output
    /build/buildroot-config/conf.o /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/buildroot-config/zconf.tab.o  -
    o /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/buildroot-config/conf
    make[2]: Leaving directory `/home/jdiamond/workspace/ees_buildroot_Conc405x/support/kconfig'
    BR2_DEFCONFIG='' KCONFIG_AUTOCONFIG=/home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/buildroot-config/auto.conf
     KCONFIG_AUTOHEADER=/home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/buildroot-config/autoconf.h KCONFIG_TRISTA
    TE=/home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/buildroot-config/tristate.config BR2_CONFIG=/home/jdiamond/
    workspace/ees_buildroot_Conc405x/.config BR2_EXTERNAL=support/dummy-external /home/jdiamond/workspace/ees_buildroot_Conc405
    x/output/build/buildroot-config/conf --silentoldconfig Config.in
    make[1]: Leaving directory `/home/jdiamond/workspace/ees_buildroot_Conc405x'
    >>> host-binutils 2.22 Extracting
    bzcat /home/jdiamond/workspace/ees_buildroot_Conc405x/dl/binutils-2.22.tar.bz2 | tar --strip-components=1 -C /home/jdiamond
    /workspace/ees_buildroot_Conc405x/output/build/host-binutils-2.22  -xf -
    
    ...
    
  7. At the end of the build process the root filesystem is tar'd and the boot images are placed in output/images -
    >>>   Generating root filesystem image rootfs.tar
    rm -f /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/_fakeroot.fs
    rm -f /home/jdiamond/workspace/ees_buildroot_Conc405x/output/target/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
    rm -f /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/_users_table.txt
    echo "chown -h -R 0:0 /home/jdiamond/workspace/ees_buildroot_Conc405x/output/target" >> /home/jdiamond/workspace/ees_buildr
    oot_Conc405x/output/build/_fakeroot.fs
    cat system/device_table.txt system/device_table_dev.txt > /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/_dev
    ice_table.txt
    printf '' >> /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/_device_table.txt
    printf '        /bin/busybox                     f 4755 0 0 - - - - -\n /usr/share/udhcpc/default.script f 755  0 0 - - - -
     -\n' >> /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/_device_table.txt
    echo "/home/jdiamond/workspace/ees_buildroot_Conc405x/output/host/usr/bin/makedevs -d /home/jdiamond/workspace/ees_buildroo
    t_Conc405x/output/build/_device_table.txt /home/jdiamond/workspace/ees_buildroot_Conc405x/output/target" >> /home/jdiamond/
    workspace/ees_buildroot_Conc405x/output/build/_fakeroot.fs
    printf '        sshd -1 sshd -1 * - - - SSH drop priv user\n' >> /home/jdiamond/workspace/ees_buildroot_Conc405x/output/bui
    ld/_users_table.txt
    PATH="/home/jdiamond/workspace/ees_buildroot_Conc405x/output/host/bin:/home/jdiamond/workspace/ees_buildroot_Conc405x/outpu
    t/host/sbin:/home/jdiamond/workspace/ees_buildroot_Conc405x/output/host/usr/bin:/home/jdiamond/workspace/ees_buildroot_Conc
    405x/output/host/usr/sbin:/usr/krb5/bin:/usr/lib/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/h
    ome/jdiamond/bin" /home/jdiamond/workspace/ees_buildroot_Conc405x/support/scripts/mkusers /home/jdiamond/workspace/ees_buil
    droot_Conc405x/output/build/_users_table.txt /home/jdiamond/workspace/ees_buildroot_Conc405x/output/target >> /home/jdiamon
    d/workspace/ees_buildroot_Conc405x/output/build/_fakeroot.fs
    echo "  tar -cf /home/jdiamond/workspace/ees_buildroot_Conc405x/output/images/rootfs.tar -C /home/jdiamond/workspace/ees_bu
    ildroot_Conc405x/output/target ." >> /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/_fakeroot.fs
    chmod a+x /home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/_fakeroot.fs
    PATH="/home/jdiamond/workspace/ees_buildroot_Conc405x/output/host/bin:/home/jdiamond/workspace/ees_buildroot_Conc405x/outpu
    t/host/sbin:/home/jdiamond/workspace/ees_buildroot_Conc405x/output/host/usr/bin:/home/jdiamond/workspace/ees_buildroot_Conc
    405x/output/host/usr/sbin:/usr/krb5/bin:/usr/lib/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/h
    ome/jdiamond/bin" /home/jdiamond/workspace/ees_buildroot_Conc405x/output/host/usr/bin/fakeroot -- /home/jdiamond/workspace/
    ees_buildroot_Conc405x/output/build/_fakeroot.fs
    rootdir=/home/jdiamond/workspace/ees_buildroot_Conc405x/output/target
    table='/home/jdiamond/workspace/ees_buildroot_Conc405x/output/build/_device_table.txt'
    /usr/bin/install -m 0644 support/misc/target-dir-warning.txt /home/jdiamond/workspace/ees_buildroot_Conc405x/output/target/
    THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
    

    [jdiamond@adlinuxdev ees_buildroot_Conc405x]$ ls output/images/ -lh
    total 205M
    -rw-r--r--. 1 jdiamond bdmicrop 26M Jun  8 11:22 bzImage
    -rw-r--r--. 1 jdiamond bdmicrop 52M Jun  8 11:22 rootfs.cpio
    -rw-r--r--. 1 jdiamond bdmicrop 22M Jun  8 11:22 rootfs.cpio.gz
    -rw-r--r--. 1 jdiamond bdmicrop 60M Jun  8 11:22 rootfs.ext2
    -rw-r--r--. 1 jdiamond bdmicrop 53M Jun  8 11:22 rootfs.tar
    
  8. The cross-compile tools are in the output/host/usr/bin directory -
    [jdiamond@adlinuxdev adinstbpm]$ ls ~/workspace/ees_buildroot_Conc405x/output/host/usr/bin/
    aclocal                                i686-buildroot-linux-uclibc-ar          i686-linux-ar          infocmp
    aclocal-1.14                           i686-buildroot-linux-uclibc-as          i686-linux-as          infotocap
    autoconf                               i686-buildroot-linux-uclibc-c++         i686-linux-c++         kmod
    autoheader                             i686-buildroot-linux-uclibc-cc          i686-linux-cc          ldconfig
    autom4te                               i686-buildroot-linux-uclibc-c++filt     i686-linux-c++filt     ldd
    automake                               i686-buildroot-linux-uclibc-cpp         i686-linux-cpp         libtool
    automake-1.14                          i686-buildroot-linux-uclibc-elfedit     i686-linux-elfedit     libtoolize
    autoreconf                             i686-buildroot-linux-uclibc-g++         i686-linux-g++         lsattr
    autoscan                               i686-buildroot-linux-uclibc-gcc         i686-linux-gcc         lzop
    autoupdate                             i686-buildroot-linux-uclibc-gcc-4.9.2   i686-linux-gcc-4.9.2   m4
    bison                                  i686-buildroot-linux-uclibc-gcc-ar      i686-linux-gcc-ar      makedevs
    captoinfo                              i686-buildroot-linux-uclibc-gcc-nm      i686-linux-gcc-nm      mk_cmds
    chattr                                 i686-buildroot-linux-uclibc-gcc-ranlib  i686-linux-gcc-ranlib  mkpasswd
    clear                                  i686-buildroot-linux-uclibc-gcov        i686-linux-gcov        ncurses5-config
    compile_et                             i686-buildroot-linux-uclibc-gprof       i686-linux-gprof       openssl
    c_rehash                               i686-buildroot-linux-uclibc-ld          i686-linux-ld          pkgconf
    ct_run                                 i686-buildroot-linux-uclibc-ld.bfd      i686-linux-ld.bfd      pkg-config
    dialyzer                               i686-buildroot-linux-uclibc-ldconfig    i686-linux-ldconfig    reset
    epmd                                   i686-buildroot-linux-uclibc-ldd         i686-linux-ldd         run_erl
    erl                                    i686-buildroot-linux-uclibc-nm          i686-linux-nm          tabs
    erlc                                   i686-buildroot-linux-uclibc-objcopy     i686-linux-objcopy     tic
    escript                                i686-buildroot-linux-uclibc-objdump     i686-linux-objdump     toe
    faked                                  i686-buildroot-linux-uclibc-ranlib      i686-linux-ranlib      to_erl
    fakeroot                               i686-buildroot-linux-uclibc-readelf     i686-linux-readelf     tput
    flex                                   i686-buildroot-linux-uclibc-size        i686-linux-size        tset
    flex++                                 i686-buildroot-linux-uclibc-strings     i686-linux-strings     typer
    genext2fs                              i686-buildroot-linux-uclibc-strip       i686-linux-strip       uuidgen
    i686-buildroot-linux-uclibc-addr2line  i686-linux-addr2line                    ifnames                yacc
    
  9. We've developed a Makefile include for utilizing a Buildroot tool chain called ees.mk located in /usr/local/products/includes. To use it, simply include it at the top of your project's Makefile and redefine a couple of important variables (the most important is EES_BR_BASE which should point at the Buildroot environment you just built) -
    EES_PREFIX      = $(prefix)
    EES_PROJECT     = bpmd
    EES_BR_BASE     ?= /home/jdiamond/workspace/ees-buildroot
    
    include $(EES_PREFIX)/usr/local/products/include/ees.mk
    
    EES_CFLAGS      = -I$(EES_ERL_LIBS)/cdev-1.2/include -I$(EES_ERL_LIBS)/acnet-2.1/include $(EES_PREF_CFLAGS)     $(EES_PREF_LXRT_CFLAGS) -fno-strict-aliasing
    EES_CPPFLAGS    = -I$(EES_ERL_LIBS)/cdev-1.2/include -I$(EES_ERL_LIBS)/acnet-2.1/include $(EES_PREF_CPPFLAGS)   $(EES_PREF_LXRT_CPPFLAGS) -fno-strict-aliasing -std=c++0x -I$(EES_INC) -I$(EES_ERL_LIBS)/cdev-1.2/include -I$(EES_ERL_LIBS)/acnet-2.1
    EES_LDFLAGS     = $(EES_PREF_LDFLAGS)   $(EES_PREF_LXRT_LDFLAGS) -lbbpm250x12 -lbtime -lnl-genl-3 -lnl-3 -lrt -lconfig++
    ERLANG_INT      = erl_interface-3.8.2
    MYLIBS          = $(EES_ERLANG_LIBDIR)/lib/$(ERLANG_INT)/lib
    
  10. To be able to access nova from adlinuxdev you will need to configure ssh to tunnel through outland. Add the following to your ~/.ssh/config file -
    Host nova
            ProxyCommand ssh your-username@outland.fnal.gov nc %h %p
    
  11. Then use scp to copy your products to nova where the target can access them via NFS. On the target, the default is to mount vxworks_write/fe/ees to /fecode-bd.
    scp -q bpmd nova:/fecode-bd/vxworks_write/fe/ees/bbpmts
    

Using someone else's tool-chain