From 7ee21e9eadc5e0054e07a95af87d134950081bcb Mon Sep 17 00:00:00 2001 From: Sergio Visinoni Date: Sun, 11 Feb 2018 21:39:29 +0100 Subject: [PATCH 1/9] Add script for docker build This script uses a pre-made Docker container to run the build process for Volumio images. See https://github.com/piffio/volumio-docker-build for building the container. --- docker-run.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 docker-run.sh diff --git a/docker-run.sh b/docker-run.sh new file mode 100755 index 000000000..57a5a5d14 --- /dev/null +++ b/docker-run.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run --privileged --tty -v ${PWD}:/build piffio/volumio-build -d pi -b arm -v 3.001 From 5751a3358ba1136679bf2a2301ddfb400ddef425 Mon Sep 17 00:00:00 2001 From: Sergio Visinoni Date: Fri, 6 Apr 2018 23:52:12 +0200 Subject: [PATCH 2/9] Add an initial version of a docker build script --- docker-build.sh | 34 ++++++++++++++++++++++++++++++++++ docker-run.sh | 3 --- 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100755 docker-build.sh delete mode 100755 docker-run.sh diff --git a/docker-build.sh b/docker-build.sh new file mode 100755 index 000000000..104ec9e01 --- /dev/null +++ b/docker-build.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Docker based image builder +# +# This is an alternative method for building a volumio image that does not +# require the user to have a debian system with specific packages versions. +# +# This method relies on a pre-built docker container that will perform the +# whole build process and generate the required image in the local directory. + +DOCKER="docker" + +DPATH=$(which "${DOCKER}" 2> /dev/null) +FOUND=$? +RUNDATE=$(date -I) + +if [ "${FOUND}" != "0" ]; then + echo "You need to have ${DOCKER} installed to be able to perform a Docker based build" + exit 1 +fi + +if [ $# -lt 2 ]; then + echo "Missign build parameters!" + echo + echo "This script is a wrapper around the main ./build.sh script, and as such it requires specific parameters" + echo "to be passed over to build.sh." + echo + echo "Please run the command ./build.sh without parameters for a full help." + exit 2 +fi + +${DOCKER} run --name=volumio-build --privileged --tty \ + -v ${PWD}:/build piffio/volumio-build \ + $@ | tee docker-build-${RUNDATE}.log diff --git a/docker-run.sh b/docker-run.sh deleted file mode 100755 index 57a5a5d14..000000000 --- a/docker-run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -docker run --privileged --tty -v ${PWD}:/build piffio/volumio-build -d pi -b arm -v 3.001 From fd704ccbb3f4f22cc66d51c2d7661f797e921ec6 Mon Sep 17 00:00:00 2001 From: Sergio Visinoni Date: Sat, 7 Apr 2018 00:11:11 +0200 Subject: [PATCH 3/9] Use a date format compatible with OSX --- docker-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-build.sh b/docker-build.sh index 104ec9e01..874c6ef01 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -12,7 +12,7 @@ DOCKER="docker" DPATH=$(which "${DOCKER}" 2> /dev/null) FOUND=$? -RUNDATE=$(date -I) +RUNDATE=$(date "+%Y-%m-%d") if [ "${FOUND}" != "0" ]; then echo "You need to have ${DOCKER} installed to be able to perform a Docker based build" From 85c6a5a5bf4e41179028713b8f962c619ba32ba1 Mon Sep 17 00:00:00 2001 From: Sergio Visinoni Date: Sat, 7 Apr 2018 00:11:31 +0200 Subject: [PATCH 4/9] Remove the container upon exit --- docker-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-build.sh b/docker-build.sh index 874c6ef01..45239fd02 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -29,6 +29,6 @@ if [ $# -lt 2 ]; then exit 2 fi -${DOCKER} run --name=volumio-build --privileged --tty \ +${DOCKER} run -it --rm --name=volumio-build --privileged \ -v ${PWD}:/build piffio/volumio-build \ $@ | tee docker-build-${RUNDATE}.log From e7d9714b28d1b7c155f1e2cfb5fe0fdac08c8a37 Mon Sep 17 00:00:00 2001 From: Sergio Visinoni Date: Sat, 7 Apr 2018 00:34:10 +0200 Subject: [PATCH 5/9] Build a Raspi image as part of the travis build --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b65264ff9..d5b8a3bff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: bash -sudo: false +sudo: required addons: apt: @@ -9,8 +9,12 @@ addons: packages: - shellcheck +services: + - docker + script: - find . -iname "*.sh" -exec shellcheck "{}" \; + - ./docker-build.sh -b arm -d pi -v 2.$(git rev-list HEAD --count) matrix: fast_finish: true From e27f9687b3a067f9b23afdded411a6eab22ee96a Mon Sep 17 00:00:00 2001 From: Sergio Visinoni Date: Sat, 7 Apr 2018 13:52:11 +0200 Subject: [PATCH 6/9] Use text matrix to build multiple images Test the setup with a Pi and an x86 build --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d5b8a3bff..19d1f82ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,13 @@ addons: services: - docker +env: + - ARCH=arm BOARD=pi + - ARCH=x86 BOARD=x86 + script: - find . -iname "*.sh" -exec shellcheck "{}" \; - - ./docker-build.sh -b arm -d pi -v 2.$(git rev-list HEAD --count) + - ./docker-build.sh -b ${ARCH} -d ${BOARD} -v 2.$(git rev-list HEAD --count) matrix: fast_finish: true From 65e85ca826820b8a2df5c3c897c1ca7f4865ddde Mon Sep 17 00:00:00 2001 From: Sergio Visinoni Date: Sat, 7 Apr 2018 16:00:59 +0200 Subject: [PATCH 7/9] Add all the major combinations --- .travis.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.travis.yml b/.travis.yml index 19d1f82ec..62d500a30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,25 @@ services: env: - ARCH=arm BOARD=pi + - ARCH=arm BOARD=sparky + - ARCH=arm BOARD=bbb + - ARCH=arm BOARD=bpim2u + - ARCH=armv7 BOARD=cuboxi + - ARCH=armv7 BOARD=odroidc1 + - ARCH=armv7 BOARD=odroidc2 + - ARCH=armv7 BOARD=odroidxu4 + - ARCH=armv7 BOARD=odroidx2 + - ARCH=armv7 BOARD=udooneo + - ARCH=armv7 BOARD=udooqdl + - ARCH=armv7 BOARD=pine64 + - ARCH=armv7 BOARD=nanopi64 + - ARCH=armv7 BOARD=bpipro + - ARCH=armv7 BOARD=tinkerboard + - ARCH=armv7 BOARD=sopine64 + - ARCH=armv7 BOARD=rock64 + - ARCH=armv7 BOARD=voltastream0 + - ARCH=armv7 BOARD=nanopineo + - ARCH=armv7 BOARD=nanopineo2 - ARCH=x86 BOARD=x86 script: From 8ec2177d9e2fde0160cc2cd1e89ad3311fb29a05 Mon Sep 17 00:00:00 2001 From: Sergio Visinoni Date: Sat, 7 Apr 2018 19:26:42 +0200 Subject: [PATCH 8/9] Use qemu-arm-static for arm files --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 62d500a30..3fed146f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,10 @@ addons: packages: - shellcheck +before_script: + - sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static + - echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' | sudo tee -a /proc/sys/fs/binfmt_misc/register + services: - docker From 5c8ae7bafecf440c152f36fc359938bfddfee27d Mon Sep 17 00:00:00 2001 From: Sergio Visinoni Date: Sat, 7 Apr 2018 22:57:33 +0200 Subject: [PATCH 9/9] Try a workaround for the 'control.tar.xz' issue --- .travis.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3fed146f0..c77ac6657 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,16 +2,14 @@ language: bash sudo: required -addons: - apt: - sources: - - debian-sid - packages: - - shellcheck - before_script: - sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static - echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' | sudo tee -a /proc/sys/fs/binfmt_misc/register + # Install shellcheck. Workaround for this issue: https://github.com/travis-ci/travis-ci/issues/8823 + - curl -sSL "https://ftp-master.debian.org/keys/archive-key-7.0.asc" | sudo -E apt-key add - + - echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" | sudo tee -a /etc/apt/sources.list > /dev/null + - sudo apt-get update + - sudo apt-get install -y shellcheck services: - docker