diff --git a/.docker-config/.token_seed b/.docker-config/.token_seed new file mode 100644 index 0000000..55146e9 --- /dev/null +++ b/.docker-config/.token_seed @@ -0,0 +1,5 @@ +{ + "registry-1.docker.io": { + "Seed": "K73vbuVEDOtCvIpjBAexOQ==" + } +} \ No newline at end of file diff --git a/.docker-config/.token_seed.lock b/.docker-config/.token_seed.lock new file mode 100644 index 0000000..e69de29 diff --git a/.docker-config/buildx/.buildNodeID b/.docker-config/buildx/.buildNodeID new file mode 100644 index 0000000..75a8dbd --- /dev/null +++ b/.docker-config/buildx/.buildNodeID @@ -0,0 +1 @@ +ff9a8f4ec9f93f93 \ No newline at end of file diff --git a/.docker-config/buildx/.lock b/.docker-config/buildx/.lock new file mode 100644 index 0000000..e69de29 diff --git a/.docker-config/buildx/activity/default b/.docker-config/buildx/activity/default new file mode 100644 index 0000000..407d367 --- /dev/null +++ b/.docker-config/buildx/activity/default @@ -0,0 +1 @@ +2026-06-21T11:55:15Z \ No newline at end of file diff --git a/.docker-config/buildx/current b/.docker-config/buildx/current new file mode 100644 index 0000000..76bc956 --- /dev/null +++ b/.docker-config/buildx/current @@ -0,0 +1 @@ +{"Key":"npipe:////./pipe/docker_engine","Name":"","Global":false} \ No newline at end of file diff --git a/.docker-config/buildx/refs/__group__/p04sc8qv9tuhvduacrzlgtscu b/.docker-config/buildx/refs/__group__/p04sc8qv9tuhvduacrzlgtscu new file mode 100644 index 0000000..7d22bc6 --- /dev/null +++ b/.docker-config/buildx/refs/__group__/p04sc8qv9tuhvduacrzlgtscu @@ -0,0 +1 @@ +{"Targets":["default"],"Refs":["o50poj56b489c14lapyb6cbmp","kjmy6s49acz1rv3g1c6h37ug9"]} \ No newline at end of file diff --git a/.docker-config/buildx/refs/__group__/q2bw6zhatajxcxsgt3j3ik766 b/.docker-config/buildx/refs/__group__/q2bw6zhatajxcxsgt3j3ik766 new file mode 100644 index 0000000..1fb1ecd --- /dev/null +++ b/.docker-config/buildx/refs/__group__/q2bw6zhatajxcxsgt3j3ik766 @@ -0,0 +1 @@ +{"Targets":["default"],"Refs":["ij03t2w0kk3dmtak1enbhe5ej","totfwrcgcwsp003suc1ffykxc"]} \ No newline at end of file diff --git a/.docker-config/buildx/refs/__group__/w9223d3305etoekws8vdlja83 b/.docker-config/buildx/refs/__group__/w9223d3305etoekws8vdlja83 new file mode 100644 index 0000000..06fe1f5 --- /dev/null +++ b/.docker-config/buildx/refs/__group__/w9223d3305etoekws8vdlja83 @@ -0,0 +1 @@ +{"Targets":["default"],"Refs":["jdxewd9dkqe9dykn73zjxe1wr","b6km8htguq65azhdau5l1netr"]} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/b6km8htguq65azhdau5l1netr b/.docker-config/buildx/refs/default/default/b6km8htguq65azhdau5l1netr new file mode 100644 index 0000000..1b07852 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/b6km8htguq65azhdau5l1netr @@ -0,0 +1 @@ +{"Target":"tera-web","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204840\\docker-context\\web","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204840\\docker-context\\web\\Dockerfile","GroupRef":"w9223d3305etoekws8vdlja83"} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/bxdmol9q89kjhrgqpa9bo9mya b/.docker-config/buildx/refs/default/default/bxdmol9q89kjhrgqpa9bo9mya new file mode 100644 index 0000000..a36d2f5 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/bxdmol9q89kjhrgqpa9bo9mya @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\docker\\forlinx-ok3568","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/ij03t2w0kk3dmtak1enbhe5ej b/.docker-config/buildx/refs/default/default/ij03t2w0kk3dmtak1enbhe5ej new file mode 100644 index 0000000..4134b27 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/ij03t2w0kk3dmtak1enbhe5ej @@ -0,0 +1 @@ +{"Target":"tera-web","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-205510\\docker-context\\web","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-205510\\docker-context\\web\\Dockerfile","GroupRef":"q2bw6zhatajxcxsgt3j3ik766"} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/jc4ax7kyh76lfy020a4q0x3st b/.docker-config/buildx/refs/default/default/jc4ax7kyh76lfy020a4q0x3st new file mode 100644 index 0000000..7a287b4 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/jc4ax7kyh76lfy020a4q0x3st @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182009\\docker-context","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/jdxewd9dkqe9dykn73zjxe1wr b/.docker-config/buildx/refs/default/default/jdxewd9dkqe9dykn73zjxe1wr new file mode 100644 index 0000000..f53be49 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/jdxewd9dkqe9dykn73zjxe1wr @@ -0,0 +1 @@ +{"Target":"tera-api","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204840\\docker-context\\api","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204840\\docker-context\\api\\Dockerfile","GroupRef":"w9223d3305etoekws8vdlja83"} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/kjmy6s49acz1rv3g1c6h37ug9 b/.docker-config/buildx/refs/default/default/kjmy6s49acz1rv3g1c6h37ug9 new file mode 100644 index 0000000..8dfb6b7 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/kjmy6s49acz1rv3g1c6h37ug9 @@ -0,0 +1 @@ +{"Target":"tera-web","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204759\\docker-context\\web","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204759\\docker-context\\web\\Dockerfile","GroupRef":"p04sc8qv9tuhvduacrzlgtscu"} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/o50poj56b489c14lapyb6cbmp b/.docker-config/buildx/refs/default/default/o50poj56b489c14lapyb6cbmp new file mode 100644 index 0000000..5dd1a6f --- /dev/null +++ b/.docker-config/buildx/refs/default/default/o50poj56b489c14lapyb6cbmp @@ -0,0 +1 @@ +{"Target":"tera-api","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204759\\docker-context\\api","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204759\\docker-context\\api\\Dockerfile","GroupRef":"p04sc8qv9tuhvduacrzlgtscu"} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/p3fe6vu5pwqdegpwg6eoif2kz b/.docker-config/buildx/refs/default/default/p3fe6vu5pwqdegpwg6eoif2kz new file mode 100644 index 0000000..49aea9e --- /dev/null +++ b/.docker-config/buildx/refs/default/default/p3fe6vu5pwqdegpwg6eoif2kz @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182137\\docker-context","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/q86h312waewztwptdodk3fmp1 b/.docker-config/buildx/refs/default/default/q86h312waewztwptdodk3fmp1 new file mode 100644 index 0000000..a36d2f5 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/q86h312waewztwptdodk3fmp1 @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\docker\\forlinx-ok3568","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/riinugza0fe1spfwa6s3l6baj b/.docker-config/buildx/refs/default/default/riinugza0fe1spfwa6s3l6baj new file mode 100644 index 0000000..e93e709 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/riinugza0fe1spfwa6s3l6baj @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182258\\docker-context","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/tez6a6wahy96ohcdeuo8k9kgn b/.docker-config/buildx/refs/default/default/tez6a6wahy96ohcdeuo8k9kgn new file mode 100644 index 0000000..b8cca94 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/tez6a6wahy96ohcdeuo8k9kgn @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-205504\\docker-context","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/totfwrcgcwsp003suc1ffykxc b/.docker-config/buildx/refs/default/default/totfwrcgcwsp003suc1ffykxc new file mode 100644 index 0000000..815f82f --- /dev/null +++ b/.docker-config/buildx/refs/default/default/totfwrcgcwsp003suc1ffykxc @@ -0,0 +1 @@ +{"Target":"tera-api","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-205510\\docker-context\\api","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-205510\\docker-context\\api\\Dockerfile","GroupRef":"q2bw6zhatajxcxsgt3j3ik766"} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/u1sr5hv7j4247kny45dr3bcgu b/.docker-config/buildx/refs/default/default/u1sr5hv7j4247kny45dr3bcgu new file mode 100644 index 0000000..e63b5a1 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/u1sr5hv7j4247kny45dr3bcgu @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-190043\\docker-context","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/ul4s19dulv4dgfqnt3q1sackm b/.docker-config/buildx/refs/default/default/ul4s19dulv4dgfqnt3q1sackm new file mode 100644 index 0000000..a361b6b --- /dev/null +++ b/.docker-config/buildx/refs/default/default/ul4s19dulv4dgfqnt3q1sackm @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182056\\docker-context","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/wwhna43n77t92x57mk7yhp1oq b/.docker-config/buildx/refs/default/default/wwhna43n77t92x57mk7yhp1oq new file mode 100644 index 0000000..9c55710 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/wwhna43n77t92x57mk7yhp1oq @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182422\\docker-context","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/z47p3a2kh40gzfzx1nr1rruou b/.docker-config/buildx/refs/default/default/z47p3a2kh40gzfzx1nr1rruou new file mode 100644 index 0000000..a36d2f5 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/z47p3a2kh40gzfzx1nr1rruou @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\docker\\forlinx-ok3568","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/default/default/zzyk0dvl686izwuenwkb5tsxm b/.docker-config/buildx/refs/default/default/zzyk0dvl686izwuenwkb5tsxm new file mode 100644 index 0000000..7be7645 --- /dev/null +++ b/.docker-config/buildx/refs/default/default/zzyk0dvl686izwuenwkb5tsxm @@ -0,0 +1 @@ +{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182333\\docker-context","DockerfilePath":""} \ No newline at end of file diff --git a/.docker-config/buildx/refs/version b/.docker-config/buildx/refs/version new file mode 100644 index 0000000..d8263ee --- /dev/null +++ b/.docker-config/buildx/refs/version @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/README.md b/README.md index 06c2a7f..11448e6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,96 @@ -# docker +# OK3568 Docker Development Environment -docker configuration \ No newline at end of file +This folder contains the Docker-based replacement for the vendor VM described in +`docs/build/ok3568-multi-som-build-deploy-strategy.md`. + +## Scope + +- Host OS: Windows with Docker Desktop using Linux containers +- Container OS: Ubuntu 22.04 +- Container user: `forlinx` +- SDK mount: `/work/OK3568_Linux_fs` +- Vendor SDK source: + `bsp/OK3568-C&FET3568-C/OK3568-C&FET3568-C/OK3568-C&OK3568J-C&OK3568J-C21_Forlinx Desktop 22.04_R1/OS image and source code/1-Source_Code/OK3568_Linux_fs/OK3568_Linux_fs` + +The container is for build and packaging work. Keep Windows Rockchip tools +(`RKDevTool`, `FactoryTool`, `DriverAssitant`) as the default flashing path. + +## Docker Config Access + +If Docker reports that `C:\Users\\.docker\config.json` is not accessible, +run the helper scripts below. They set `DOCKER_CONFIG` to `docker/.docker-config` +inside this repo. + +## Commands + +Check host prerequisites: + +```powershell +.\docker\scripts\check-host.ps1 +``` + +Build the image: + +```powershell +.\docker\scripts\build-image.ps1 +``` + +Open an interactive SDK shell: + +```powershell +.\docker\scripts\shell.ps1 +``` + +Run an SDK build target: + +```powershell +.\docker\scripts\build-source.ps1 -BuildTarget help +.\docker\scripts\build-source.ps1 -BuildTarget kernel +``` + +Multi-SoM target names are accepted by the wrapper for future use: + +```powershell +.\docker\scripts\build-source.ps1 -Target fet3568-c -BuildTarget kernel +``` + +The current vendor SDK still controls its active defconfig through its own +`output/.config` and `device/rockchip/.chip` links. The `-Target` value is +recorded in the container environment as `TERA_TARGET`, but target-specific +defconfig switching should be added only after the second SoM profile is known. + +## Direct Compose Usage + +```powershell +$env:DOCKER_CONFIG = "$PWD\docker\.docker-config" +docker compose -f docker\docker-compose.yml build ok3568-dev +docker compose -f docker\docker-compose.yml run --rm -e TERA_TARGET=fet3568-c ok3568-dev make help +``` + +## Notes + +- The SDK path includes spaces and `&`; use the provided compose file or scripts + instead of hand-typing long volume paths. +- The vendor SDK contains Windows-created symlinks at the source root. The + container entrypoint checks that `Makefile` and `build.sh` are readable before + running commands. +- Docker must be running before build or shell commands can execute. + +## Docker Desktop Virtualization Error + +If Docker Desktop reports: + +```text +Hardware assisted virtualization and data execution protection must be enabled in the BIOS +``` + +check these host settings: + +- BIOS/UEFI: enable Intel VT-x / Intel Virtualization Technology, or AMD-V / SVM. +- BIOS/UEFI: enable Execute Disable Bit / XD / NX / Data Execution Prevention. +- Windows features: enable Windows Subsystem for Linux, Virtual Machine Platform, + and, when available on the Windows edition, Hyper-V. +- Reboot after changing BIOS or Windows feature settings. + +Run `.\docker\scripts\check-host.ps1` from an elevated PowerShell prompt to see +the current Windows optional feature states. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..41878fb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +version: "3.8" + +services: + ok3568-dev: + build: + context: ./forlinx-ok3568 + image: tera/forlinx-ok3568-dev:ubuntu22.04 + container_name: tera-ok3568-dev + working_dir: /work/OK3568_Linux_fs + environment: + SDK_ROOT: /work/OK3568_Linux_fs + DEBIAN_FRONTEND: noninteractive + volumes: + - type: bind + source: ${TERA_SDK_HOST_PATH:-../bsp/OK3568-C&FET3568-C/OK3568-C&FET3568-C/OK3568-C&OK3568J-C&OK3568J-C21_Forlinx Desktop 22.04_R1/OS image and source code/1-Source_Code/OK3568_Linux_fs/OK3568_Linux_fs} + target: /work/OK3568_Linux_fs + - type: bind + source: ../output + target: /repo-output + - ok3568-ccache:/home/forlinx/.ccache + stdin_open: true + tty: true + +volumes: + ok3568-ccache: diff --git a/forlinx-ok3568/Dockerfile b/forlinx-ok3568/Dockerfile new file mode 100644 index 0000000..2f2fce5 --- /dev/null +++ b/forlinx-ok3568/Dockerfile @@ -0,0 +1,105 @@ +FROM ubuntu:22.04 + +ARG USERNAME=forlinx +ARG USER_UID=1000 +ARG USER_GID=1000 + +ENV DEBIAN_FRONTEND=noninteractive +ENV SDK_ROOT=/work/OK3568_Linux_fs +ENV PATH="${SDK_ROOT}/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin:${SDK_ROOT}/prebuilts/gcc/linux-x86/arm/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin:${PATH}" + +RUN apt-get update && apt-get install -y --no-install-recommends \ + acl \ + autoconf \ + automake \ + bc \ + binutils \ + bison \ + bsdmainutils \ + build-essential \ + bzip2 \ + ca-certificates \ + ccache \ + chrpath \ + cmake \ + cpio \ + curl \ + device-tree-compiler \ + default-jdk \ + diffstat \ + dwarves \ + fakeroot \ + file \ + flex \ + g++-aarch64-linux-gnu \ + g++-arm-linux-gnueabihf \ + gcc-aarch64-linux-gnu \ + gcc-arm-linux-gnueabihf \ + git \ + gnupg \ + gperf \ + gawk \ + kmod \ + lib32stdc++6 \ + lib32z1 \ + libelf-dev \ + libgmp-dev \ + libglib2.0-dev \ + libmpc-dev \ + libmpfr-dev \ + libncurses-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libssl-dev \ + libtool \ + libudev-dev \ + libusb-1.0-0-dev \ + libxml2-utils \ + locales \ + lz4 \ + lzop \ + make \ + maven \ + ninja-build \ + nodejs \ + npm \ + openssh-client \ + patch \ + python-is-python3 \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + qemu-user-static \ + repo \ + rsync \ + sudo \ + swig \ + texinfo \ + unzip \ + u-boot-tools \ + vim-tiny \ + wget \ + xz-utils \ + zip \ + zstd \ + && rm -rf /var/lib/apt/lists/* + +RUN locale-gen en_US.UTF-8 ko_KR.UTF-8 +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 + +RUN groupadd --gid ${USER_GID} ${USERNAME} \ + && useradd --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME} \ + && echo "${USERNAME}:${USERNAME}" | chpasswd \ + && echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \ + && chmod 0440 /etc/sudoers.d/${USERNAME} + +COPY entrypoint.sh /usr/local/bin/ok3568-entrypoint +RUN chmod +x /usr/local/bin/ok3568-entrypoint + +USER ${USERNAME} +WORKDIR /work/OK3568_Linux_fs +ENTRYPOINT ["/usr/local/bin/ok3568-entrypoint"] +CMD ["/bin/bash"] diff --git a/forlinx-ok3568/entrypoint.sh b/forlinx-ok3568/entrypoint.sh new file mode 100644 index 0000000..99565de --- /dev/null +++ b/forlinx-ok3568/entrypoint.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +SDK_ROOT="${SDK_ROOT:-/work/OK3568_Linux_fs}" + +if [ ! -d "$SDK_ROOT" ]; then + echo "SDK root not mounted: $SDK_ROOT" >&2 + exit 2 +fi + +if [ ! -r "$SDK_ROOT/device/rockchip/common/Makefile" ]; then + echo "Vendor SDK common Makefile is missing under $SDK_ROOT." >&2 + exit 2 +fi + +if [ ! -s "$SDK_ROOT/Makefile" ] && [ ! -L "$SDK_ROOT/Makefile" ]; then + echo "SDK root Makefile is not readable as a file or symlink." >&2 + echo "Expected it to resolve to device/rockchip/common/Makefile." >&2 + exit 2 +fi + +if [ ! -x "$SDK_ROOT/build.sh" ]; then + chmod +x "$SDK_ROOT/build.sh" 2>/dev/null || true +fi + +mkdir -p /home/forlinx/.ccache "$SDK_ROOT/output" + +export USE_CCACHE=1 +export CCACHE_DIR=/home/forlinx/.ccache + +cd "$SDK_ROOT" +exec "$@" diff --git a/scripts/build-image.ps1 b/scripts/build-image.ps1 new file mode 100644 index 0000000..8176cbc --- /dev/null +++ b/scripts/build-image.ps1 @@ -0,0 +1,10 @@ +[CmdletBinding()] +param() + +$ErrorActionPreference = 'Stop' +$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') +$DockerConfig = Join-Path $RepoRoot 'docker\.docker-config' +New-Item -ItemType Directory -Force $DockerConfig | Out-Null +$env:DOCKER_CONFIG = $DockerConfig + +docker compose -f (Join-Path $RepoRoot 'docker\docker-compose.yml') build ok3568-dev diff --git a/scripts/build-source.ps1 b/scripts/build-source.ps1 new file mode 100644 index 0000000..7debe69 --- /dev/null +++ b/scripts/build-source.ps1 @@ -0,0 +1,19 @@ +[CmdletBinding()] +param( + [string]$Target = 'fet3568-c', + [string]$BuildTarget = 'help', + [switch]$UseBuildScript +) + +$ErrorActionPreference = 'Stop' +$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') +$DockerConfig = Join-Path $RepoRoot 'docker\.docker-config' +New-Item -ItemType Directory -Force $DockerConfig | Out-Null +$env:DOCKER_CONFIG = $DockerConfig +$env:TERA_TARGET = $Target + +if ($UseBuildScript) { + docker compose -f (Join-Path $RepoRoot 'docker\docker-compose.yml') run --rm -e TERA_TARGET=$Target ok3568-dev ./build.sh $BuildTarget +} else { + docker compose -f (Join-Path $RepoRoot 'docker\docker-compose.yml') run --rm -e TERA_TARGET=$Target ok3568-dev make $BuildTarget +} diff --git a/scripts/check-host.ps1 b/scripts/check-host.ps1 new file mode 100644 index 0000000..bfc3bdc --- /dev/null +++ b/scripts/check-host.ps1 @@ -0,0 +1,44 @@ +[CmdletBinding()] +param() + +$ErrorActionPreference = 'Continue' + +Write-Host '[host] CPU virtualization / DEP' +try { + Get-CimInstance Win32_Processor | + Select-Object Name, + VirtualizationFirmwareEnabled, + SecondLevelAddressTranslationExtensions, + DataExecutionPrevention_Available | + Format-Table -AutoSize +} catch { + Write-Warning "Unable to query CPU virtualization state: $($_.Exception.Message)" +} + +Write-Host '' +Write-Host '[host] Required Windows optional features' +$features = @( + 'Microsoft-Windows-Subsystem-Linux', + 'VirtualMachinePlatform', + 'Microsoft-Hyper-V-All', + 'HypervisorPlatform' +) + +foreach ($feature in $features) { + try { + Get-WindowsOptionalFeature -Online -FeatureName $feature | + Select-Object FeatureName,State | + Format-Table -AutoSize + } catch { + Write-Warning "Unable to query ${feature}. Run this script from an elevated PowerShell prompt to inspect Windows optional features." + } +} + +Write-Host '' +Write-Host '[host] Docker daemon' +$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') +$DockerConfig = Join-Path $RepoRoot 'docker\.docker-config' +New-Item -ItemType Directory -Force $DockerConfig | Out-Null +$env:DOCKER_CONFIG = $DockerConfig + +docker version diff --git a/scripts/shell.ps1 b/scripts/shell.ps1 new file mode 100644 index 0000000..85488a3 --- /dev/null +++ b/scripts/shell.ps1 @@ -0,0 +1,13 @@ +[CmdletBinding()] +param( + [string]$Target = 'fet3568-c' +) + +$ErrorActionPreference = 'Stop' +$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') +$DockerConfig = Join-Path $RepoRoot 'docker\.docker-config' +New-Item -ItemType Directory -Force $DockerConfig | Out-Null +$env:DOCKER_CONFIG = $DockerConfig +$env:TERA_TARGET = $Target + +docker compose -f (Join-Path $RepoRoot 'docker\docker-compose.yml') run --rm -e TERA_TARGET=$Target ok3568-dev /bin/bash