Skip to content

Commit

Permalink
Build with docker sysroot lol
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Dec 18, 2023
1 parent 2efcd61 commit faf6f19
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
apt-get update
apt-get install -y libopencv-dev libegl1-mesa-dev libcamera-dev cmake build-essential libdrm-dev libgbm-dev default-jdk openjdk-17-jdk
cmake -B build-pi -DCMAKE_BUILD_TYPE=Release
cmake --build build-pi -j 4
cmake --build build-pi -- -j
- run: find .

Expand Down Expand Up @@ -54,3 +54,22 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-chroot:
runs-on: ubuntu-latest
container:
image: mcm001/photon-libcamera-builder-entry:latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- run: |
find .
uname -a
cat /etc/os-release
bash -c "cmake -B build-pi -DCMAKE_BUILD_TYPE=Release && cmake --build build-pi -- -j"
- uses: actions/upload-artifact@master
with:
name: libcamera-driver
path: build-pi/*.so
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.25.1)
cmake_minimum_required(VERSION 3.15)
project(libcamera_meme)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM photon-libcamera-builder

ENTRYPOINT ["/bin/bash", "/opt/start_chroot.sh"]
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@ This should spit out the shared library into the build directory.

Compile with `g++ -std=c++17 -o eglinfo eglinfo.c headless_opengl.cpp -lEGL -lGLESv2 -lgbm`, and then run with `./eglinfo`

## Chroot stuff

Using our docker image and run with --privileged

docker run -it --privileged --mount type=bind,source="$(pwd)",target=/opt/photon_sysroot_v2023.4.2/opt/photon-libcamera-gl-driver photon-libcamera-builder:latest
/opt/photon_sysroot_v2023.4.2/opt/photon-libcamera-gl-driver/start_chroot.sh

Or

docker run -it --privileged --mount type=bind,source="$(pwd)",target=/opt/photon_sysroot_v2023.4.2/opt/photon-libcamera-gl-driver photon-libcamera-builder-entry:latest

# git clone ${{ github.repositoryUrl }} && cd "$(basename "$_" .git)"

0 comments on commit faf6f19

Please sign in to comment.