Add build info for multi-arch (i386, armel, armv6, armv7hf)

This commit is contained in:
Trong Nghia Nguyen 2016-07-05 22:13:55 +07:00 committed by Petros Angelatos
parent 40d9a47a2e
commit 679691711d
9 changed files with 67 additions and 19 deletions

View File

@ -35,4 +35,4 @@ ENV SOURCE_DIR /source
ENV DEST_DIR /dest ENV DEST_DIR /dest
COPY build.sh / COPY build.sh /
CMD ./build.sh CMD bash -ex build.sh

View File

@ -5,21 +5,43 @@ set -o pipefail
date=$(date +'%Y%m%d' -u) date=$(date +'%Y%m%d' -u)
REPO='resin/amd64-supervisor-base' REPO='resin/amd64-supervisor-base'
# MACHINE_LIST: generic-x86-64 generic-x86 generic-armv6 generic-armv7hf generic-armv5
# MACHINE_LIST should be set in jenkins config
git submodule update --init --recursive git submodule update --init --recursive
rm -rf dest rm -rf dest
mkdir dest mkdir dest
docker build -t supervisor-base-builder . docker build -t supervisor-base-builder .
docker run --rm \ for machine in $MACHINE_LIST; do
case "$device" in
'generic-x86-64')
REPO='resin/amd64-supervisor-base'
;;
'generic-x86')
REPO='resin/i386-supervisor-base'
;;
'generic-armv6')
REPO='resin/armv6-supervisor-base'
;;
'generic-armv7hf')
REPO='resin/armv7hf-supervisor-base'
;;
'generic-armv5')
REPO='resin/armel-supervisor-base'
;;
esac
docker run --rm \
-e TARGET_MACHINE=$machine \
-v `pwd`:/source \ -v `pwd`:/source \
-v `pwd`/dest:/dest \ -v `pwd`/dest:/dest \
supervisor-base-builder supervisor-base-builder
if [ -f dest/rootfs.tar.gz ]; then if [ -f dest/rootfs.tar.gz ]; then
docker import dest/rootfs.tar.gz $REPO:$date docker import dest/rootfs.tar.gz $REPO:$date
docker tag -f $REPO:$date $REPO:latest docker tag -f $REPO:$date $REPO:latest
docker push $REPO docker push $REPO
else else
echo "rootfs is missing!" echo "rootfs is missing!"
exit 1 exit 1
fi fi
done

View File

@ -8,6 +8,5 @@ mkdir -p $BUILD_DIR
cp -r $SOURCE_DIR/* $BUILD_DIR/ cp -r $SOURCE_DIR/* $BUILD_DIR/
cd $BUILD_DIR cd $BUILD_DIR
source oe-core/oe-init-build-env build bitbake source oe-core/oe-init-build-env build bitbake
bitbake core-image-minimal MACHINE=$TARGET_MACHINE bitbake core-image-minimal
qemu=$(cat conf/local.conf | grep '^MACHINE ??= ' | grep -o '"[^"]\+"' | tr -d '"') cp --dereference tmp-glibc/deploy/images/$TARGET_MACHINE/core-image-minimal-$TARGET_MACHINE.tar.gz $DEST_DIR/rootfs.tar.gz
cp --dereference tmp/deploy/images/$qemu/core-image-minimal-$qemu.tar.gz $DEST_DIR/rootfs.tar.gz

View File

@ -29,7 +29,7 @@ PREFERRED_PROVIDER_virtual/kernel="linux-dummy"
#MACHINE ?= "qemux86-64" #MACHINE ?= "qemux86-64"
# #
# This sets the default machine to be qemux86 if no other machine is selected: # This sets the default machine to be qemux86 if no other machine is selected:
MACHINE ??= "qemux86" # MACHINE ??= ""
# #
# Where to place downloads # Where to place downloads
@ -220,5 +220,6 @@ PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
CONF_VERSION = "1" CONF_VERSION = "1"
IMAGE_INSTALL_append += " ca-certificates nodejs btrfs-tools rsync" IMAGE_INSTALL_append += " ca-certificates nodejs btrfs-tools rsync"
VIRTUAL-RUNTIME_init_manager = "busybox" VIRTUAL-RUNTIME_init_manager="busybox"
VIRTUAL-RUNTIME_dev_manager = "busybox-mdev" VIRTUAL-RUNTIME_dev_manager="busybox-mdev"
PREFERRED_VERSION_nodejs = "6.2.2"

View File

@ -0,0 +1,5 @@
#@TYPE: Machine
#@NAME: Generic armv5te machine
#@DESCRIPTION: Machine configuration for armv5te based boards
require conf/machine/include/arm/arch-armv5.inc

View File

@ -0,0 +1,5 @@
#@TYPE: Machine
#@NAME: Generic armv6 machine
#@DESCRIPTION: Machine configuration for armv6 based boards
require conf/machine/include/arm/arch-armv6.inc

View File

@ -0,0 +1,5 @@
#@TYPE: Machine
#@NAME: Generic armv7a hard float machine
#@DESCRIPTION: Machine configuration for armv7a based boards
require conf/machine/include/arm/arch-armv7a.inc

View File

@ -0,0 +1,6 @@
#@TYPE: Machine
#@NAME: common_pc
#@DESCRIPTION: Machine configuration for running a common x86
DEFAULTTUNE ?= "core2-64"
require conf/machine/include/tune-core2.inc

View File

@ -0,0 +1,5 @@
#@TYPE: Machine
#@NAME: common_pc
#@DESCRIPTION: Machine configuration for running a common x86
require conf/machine/include/tune-i586.inc