summaryrefslogtreecommitdiffstats
path: root/.devcontainer
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-08-03 10:57:39 -0700
committerJoey Castillo <joeycastillo@utexas.edu>2022-08-03 10:57:39 -0700
commit0c8a81bb5df099210c531bb793479403fab319b9 (patch)
tree9364ed8102f6f25c4447fdbc1260717c27f23a65 /.devcontainer
parentcc4275694be97f365096eefb9b7513b41bcfdcd4 (diff)
parente790a025787e0e1aa59b98b95e194cf4318d1578 (diff)
downloadSensor-Watch-0c8a81bb5df099210c531bb793479403fab319b9.tar.gz
Sensor-Watch-0c8a81bb5df099210c531bb793479403fab319b9.tar.bz2
Sensor-Watch-0c8a81bb5df099210c531bb793479403fab319b9.zip
Merge branch 'main' of github.com:joeycastillo/Sensor-Watch into totp-lfstotp-lfs
Diffstat (limited to '.devcontainer')
-rw-r--r--.devcontainer/Dockerfile50
-rw-r--r--.devcontainer/devcontainer.json17
2 files changed, 67 insertions, 0 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 00000000..55565a07
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,50 @@
+FROM ubuntu:22.10
+
+# TODO: install emscripten (https://emscripten.org/docs/getting_started/downloads.html)
+
+# TODO: Clean this up once buildkit is supported gracefully in devcontainers
+# https://github.com/microsoft/vscode-remote-release/issues/1409
+
+ARG X86_64_TOOLCHAIN_FILENAME="gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2"
+ARG X86_64_TOOLCHAIN="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2"
+ARG X86_64_TOOLCHAIN_CHECKSUM="b56ae639d9183c340f065ae114a30202"
+
+ARG AARCH64_TOOLCHAIN_FILENAME="gcc-arm-none-eabi-10.3-2021.07-aarch64-linux.tar.bz2"
+ARG AARCH64_TOOLCHAIN="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-aarch64-linux.tar.bz2"
+ARG AARCH64_TOOLCHAIN_CHECKSUM="c20b0535d01f8d4418341d893c62a782"
+
+WORKDIR /setup
+
+# Install required packages
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends \
+ # make is used as the build system
+ make \
+ # git is used for fetching submodules & interactive development
+ git \
+ # bzip2 is required to extract the Arm toolchain
+ bzip2 \
+ # ca certs need to be available for fetching git submodules
+ ca-certificates \
+ # python is used to convert binaries to uf2 files
+ python3 python-is-python3
+
+# Download and verify both x86-64 and aarch64 toolchains. This is unfortunate and
+# slows down the build, but it's a clean-ish option until buildkit can be used.
+ADD $X86_64_TOOLCHAIN $X86_64_TOOLCHAIN_FILENAME
+ADD $AARCH64_TOOLCHAIN $AARCH64_TOOLCHAIN_FILENAME
+
+RUN echo "${X86_64_TOOLCHAIN_CHECKSUM} ${X86_64_TOOLCHAIN_FILENAME}" | md5sum --check
+RUN echo "${AARCH64_TOOLCHAIN_CHECKSUM} ${AARCH64_TOOLCHAIN_FILENAME}" | md5sum --check
+
+# Extract toolchain directly into /usr
+RUN /bin/sh -c 'set -ex && \
+ ARCH=`uname -m` && \
+ if [ "$ARCH" = "x86_64" ]; then \
+ tar --strip-components=1 -C /usr -xjf $X86_64_TOOLCHAIN_FILENAME ; \
+ else \
+ tar --strip-components=1 -C /usr -xjf $AARCH64_TOOLCHAIN_FILENAME ; \
+ fi'
+
+RUN rm $X86_64_TOOLCHAIN_FILENAME
+RUN rm $AARCH64_TOOLCHAIN_FILENAME \ No newline at end of file
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 00000000..a71a0f22
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,17 @@
+// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
+// https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/docker-existing-dockerfile
+{
+ "name": "GNU Arm Embedded Environment",
+ // Sets the run context to one level up instead of the .devcontainer folder.
+ "context": "..",
+ // Set the location of the dockerfile to use
+ "dockerFile": "Dockerfile",
+ // Set *default* container specific settings.json values on container create.
+ "settings": {},
+ // Add the IDs of extensions you want installed when the container is created.
+ "extensions": [
+ "ms-vscode.cpptools"
+ ]
+ // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
+ // "remoteUser": "vscode"
+} \ No newline at end of file