Skip to content

Commit

Permalink
Auto-build docker-mount.sh base image, allow passing mount path
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Jul 8, 2024
1 parent b242b03 commit c2c4e09
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
4 changes: 3 additions & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ ${BR2_MAKE} ${BR2_PLATFORM}_defconfig

if [ "${BUILDTARGET}" = "blackmirror" ]; then
${BR2_MAKE} host-cmake
${BR2_MAKE} lv2
${BR2_MAKE} libdrm
${BR2_MAKE} libinput
${BR2_MAKE} lilv
${BR2_MAKE} kxstudio-lv2-extensions
${BR2_MAKE} mod-lv2-extensions
${BR2_MAKE} sdl2
Expand Down
27 changes: 23 additions & 4 deletions docker-mount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ cd $(dirname ${0})
# check arguments

PLATFORM="${1}"
DOCKER_IMAGE="${2}"
EXTRA_MOUNT_PATH="${2}"

if [ -z "${PLATFORM}" ] || [ -z "${DOCKER_IMAGE}" ] || [ ! -e "plugins-dep/configs/${PLATFORM}_defconfig" ]; then
echo "Usage: $0 <platform> <docker-image>"
if [ -z "${PLATFORM}" ] || [ ! -e "plugins-dep/configs/${PLATFORM}_defconfig" ]; then
echo "Usage: $0 <platform> <extra-mount-path>"
echo " Where platform can be one of: $(echo $(ls plugins-dep/configs | grep _defconfig | sed 's/_defconfig//g' | sort))"
exit 1
fi
Expand All @@ -21,11 +21,30 @@ fi

source .common

#######################################################################################################################
# Build docker image first if needed

if ! docker images | grep -q "mpbi_${PLATFORM}"; then
docker buildx build \
--build-arg platform="${PLATFORM}" \
--build-arg target=toolchain \
--tag "mpbi_${PLATFORM}" \
"$(pwd)/docker"
fi

#######################################################################################################################
# Now setup docker mountpoints (or run it if already exists)

if docker ps -a | grep -q "mpb_${PLATFORM}"; then
docker start -i "mpb_${PLATFORM}"
elif [ -n "${EXTRA_MOUNT_PATH}" ]; then
docker run --name "mpb_${PLATFORM}" -ti \
-v "$(pwd)":"/home/builder/mod-plugin-builder" \
-v "${EXTRA_MOUNT_PATH}":"/mnt" \
"mpbi_${PLATFORM}"
else
docker run --name "mpb_${PLATFORM}" -ti -v $(pwd):/home/builder/mod-plugin-builder -v ${PLUGINS_DIR}:/home/builder/mod-workdir/${PLATFORM}/plugins "${DOCKER_IMAGE}"
docker run --name "mpb_${PLATFORM}" -ti \
-v "$(pwd)":"/home/builder/mod-plugin-builder" \
-v "${PLUGINS_DIR}":"/home/builder/mod-workdir/${PLATFORM}/plugins" \
"mpbi_${PLATFORM}"
fi
2 changes: 1 addition & 1 deletion plugins-dep/configs/generic-aarch64-debug_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BR2_FORTIFY_SOURCE_NONE=y
BR2_TARGET_GENERIC_HOSTNAME=""
BR2_TARGET_GENERIC_ISSUE=""
BR2_INIT_NONE=y
BR2_ROOTFS_DEVICE_CREATION_STATIC=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE=""
BR2_ROOTFS_MERGED_USR=y
BR2_GENERATE_LOCALE="en_US.UTF-8"
Expand Down

0 comments on commit c2c4e09

Please sign in to comment.