diff --git a/.gitmodules b/.gitmodules index 7b23ded..57c5575 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "firmware/stm32f0xx-hal"] path = firmware/stm32f0xx-hal url = https://github.com/stm32-rs/stm32f0xx-hal.git +[submodule "image/yocto/poky"] + path = image/yocto/poky + url = https://git.yoctoproject.org/poky diff --git a/image/docker-compose.yml b/image/docker-compose.yml index c515265..4a00939 100644 --- a/image/docker-compose.yml +++ b/image/docker-compose.yml @@ -3,9 +3,12 @@ services: build: . container_name: fcb-looper-yocto working_dir: /workspace + user: "${HOST_UID:-1000}:${HOST_GID:-1000}" volumes: # Mount workspace for persistent development - ./workspace:/workspace + # Mount Poky submodule for Yocto source + - ./yocto/poky:/yocto/poky # Mount downloads cache to avoid re-downloading sources - ./yocto-downloads:/workspace/downloads # Mount sstate cache for faster builds @@ -14,6 +17,8 @@ services: - ./output:/workspace/output environment: - TERM=xterm-256color + - UID=${HOST_UID:-1000} + - GID=${HOST_GID:-1000} stdin_open: true tty: true command: /bin/bash \ No newline at end of file diff --git a/image/run b/image/run new file mode 100755 index 0000000..c16029f --- /dev/null +++ b/image/run @@ -0,0 +1,23 @@ +#!/bin/bash + +# FCB Looper Docker Launcher Script +# Usage: ./run [additional args...] + +set -e + +# Get current user's UID and GID +export HOST_UID=$(id -u) +export HOST_GID=$(id -g) + +# Check if service name is provided +if [ $# -eq 0 ]; then + echo "Usage: $0 [additional args...]" + echo "Available services:" + echo " yocto - Interactive Yocto development environment" + exit 1 +fi + +SERVICE=$1 +shift + +docker compose run --remove-orphans --rm "$SERVICE" "$@" \ No newline at end of file diff --git a/image/yocto/poky b/image/yocto/poky new file mode 160000 index 0000000..243d54f --- /dev/null +++ b/image/yocto/poky @@ -0,0 +1 @@ +Subproject commit 243d54fd466f5f852cc0fdcce57997918ce35f32