Skip to content

Automate binary asset build

Douglas Raillard requested to merge github/fork/douglas-raillard-arm/_pr385 into master

Example:

# to build for all archs
lisa-build-asset all --arm64-toolchain aarch64-linux-gnu --armeabi-toolchain arm-none-eabi
# to build for arm64 only
lisa-build-asset all --arch arm64 --arm64-toolchain aarch64-linux-gnu
>>> lisa-build-asset --help
usage: lisa-build-asset [-h] [--arch {arm64,armeabi,x86_64,all}]
                        [--arm64-toolchain ARM64_TOOLCHAIN]
                        [--armeabi-toolchain ARMEABI_TOOLCHAIN]
                        [--x86_64-toolchain X86_64_TOOLCHAIN]
                        [--build-dir BUILD_DIR]
                        {all,rt-app,util-linux,trace-cmd,perf,sysbench}

Build LISA binary assets

positional arguments:
  {all,rt-app,util-linux,trace-cmd,perf,sysbench}
                        Asset to build

optional arguments:
  -h, --help            show this help message and exit
  --arch {arm64,armeabi,x86_64,all}
                        Architecture to build for
  --arm64-toolchain ARM64_TOOLCHAIN
                        Name of the toolchain for arm64 (CROSS_COMPILE without
                        trailing dash)
  --armeabi-toolchain ARMEABI_TOOLCHAIN
                        Name of the toolchain for armeabi (CROSS_COMPILE
                        without trailing dash)
  --x86_64-toolchain X86_64_TOOLCHAIN
                        Name of the toolchain for x86_64 (CROSS_COMPILE
                        without trailing dash)
  --build-dir BUILD_DIR
                        Build director. Defaults to temp folder

It also installs a README.foobar file that contains all the build info:

Sources of dmesg available at:
Git commit: d4319b91c9d7d69e7b954fc66819214f81501312
Git repository: git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git


Build recipe:

export ARCH=arm64
export CONFIGURE_HOST=aarch64-linux-gnu
export CROSS_COMPILE=/home/dourai01/bin/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu//bin/aarch64-linux-gnu-
export LISA_ARCH_ASSETS=/lisa/assets/binaries/arm64
export LISA_HOME=''
#! /bin/bash

download() {
    git clone git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
    git -C util-linux checkout 448e6c3567988492d8724f26950ff167ab58d22a
}

build() {
    cd util-linux

    ./autogen.sh
    ./configure --host=$CONFIGURE_HOST \
                --disable-shared \
                --without-tinfo \
                --without-ncurses \
                --without-ncursesw \
                --disable-widechar \
                --without-python \
                --enable-static-programs=dmesg,taskset
    make dmesg taskset

    ${CROSS_COMPILE}strip dmesg taskset
}

install() {
    cp -v util-linux/dmesg "$LISA_ARCH_ASSETS/dmesg"
    cp -v util-linux/taskset "$LISA_ARCH_ASSETS/taskset"

    source "$LISA_HOME/tools/recipes/utils.sh"
    install_git_src_loc dmesg util-linux
    install_git_src_loc taskset util-linux
}

note: the env var printing is not perfect but should be enough for anybody to be able to reproduce the build, which is the goal.

Merge request reports