mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-22 16:46:29 +00:00
Update build script
This commit is contained in:
parent
cbaae1a46b
commit
142200ab9a
@ -25,5 +25,6 @@ RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubunt
|
|||||||
RUN apt-get update && apt-get install -y docker-ce && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y docker-ce && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY run-resinos.sh /
|
COPY run-resinos.sh /
|
||||||
|
COPY run-supervisor-base.sh /
|
||||||
|
|
||||||
WORKDIR /yocto/resin-board
|
WORKDIR /yocto/image
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -ev
|
set -ev
|
||||||
|
|
||||||
|
DOCKER_REPO=pvizeli
|
||||||
|
DOCKER_IMAGE=yocto-build-env
|
||||||
|
|
||||||
# Get the absolute script location
|
# Get the absolute script location
|
||||||
pushd `dirname $0` > /dev/null 2>&1
|
pushd `dirname $0` > /dev/null 2>&1
|
||||||
SCRIPTPATH=`pwd`
|
SCRIPTPATH=`pwd`
|
||||||
@ -13,11 +16,11 @@ if [ -z "${REVISION}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
docker build --pull --tag pvizeli/yocto-build-env:${REVISION} -f ${SCRIPTPATH}/Dockerfile ${SCRIPTPATH}
|
docker build --pull --tag ${DOCKER_REPO}/${DOCKER_IMAGE}:${REVISION} -f ${SCRIPTPATH}/Dockerfile ${SCRIPTPATH}
|
||||||
|
|
||||||
# Tag
|
# Tag
|
||||||
docker tag -f pvizeli/yocto-build-env:${REVISION} resin/yocto-build-env:latest
|
docker tag -f ${DOCKER_REPO}/${DOCKER_IMAGE}:${REVISION} ${DOCKER_REPO}/${DOCKER_IMAGE}:latest
|
||||||
|
|
||||||
# Push
|
# Push
|
||||||
docker push pvizeli/yocto-build-env:${REVISION}
|
docker push ${DOCKER_REPO}/${DOCKER_IMAGE}:${REVISION}
|
||||||
docker push pvizeli/yocto-build-env:latest
|
docker push ${DOCKER_REPO}/${DOCKER_IMAGE}:latest
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ echo "[INFO] Docker was initialized."
|
|||||||
|
|
||||||
# Start barys with all the arguments requested
|
# Start barys with all the arguments requested
|
||||||
echo "[INFO] Running build as builder user..."
|
echo "[INFO] Running build as builder user..."
|
||||||
sudo -H -u builder /yocto/resin-board/resin-yocto-scripts/build/barys $@ &
|
sudo -H -u builder /yocto/image/resin-yocto-scripts/build/barys $@ &
|
||||||
barys_pid=$!
|
barys_pid=$!
|
||||||
wait $barys_pid || true
|
wait $barys_pid || true
|
||||||
|
|
||||||
|
12
build-scripts/yocto-build-env/run-supervisor-base.sh
Normal file
12
build-scripts/yocto-build-env/run-supervisor-base.sh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
|
||||||
|
groupadd -g $BUILDER_GID builder
|
||||||
|
useradd -m -u $BUILDER_UID -g $BUILDER_GID builder
|
||||||
|
|
||||||
|
sudo -H -u builder /bin/bash -c "cd /yocto/image \
|
||||||
|
&& source oe-core/oe-init-build-env build bitbake \
|
||||||
|
&& DL_DIR=/yocto/shared-downloads SSTATE_DIR=/yocto/shared-sstate MACHINE=$TARGET_MACHINE /yocto/image/bitbake/bin/bitbake core-image-minimal"
|
||||||
|
|
||||||
|
cp --dereference /yocto/image/build/tmp-glibc/deploy/images/$TARGET_MACHINE/core-image-minimal-$TARGET_MACHINE.tar.gz /yocto/image/rootfs.tar.gz
|
Loading…
x
Reference in New Issue
Block a user