From b18448190a5982e2b460cfeb2623fce8fa71c1f0 Mon Sep 17 00:00:00 2001 From: saifullah-N Date: Sun, 29 Jan 2023 23:35:30 +0530 Subject: [PATCH 1/2] added .devcontainer and .vscode configurations --- .devcontainer/Dockerfile | 7 +++++ .devcontainer/devcontainer.json | 36 +++++++++++++++++++++++++ .devcontainer/install_tools.sh | 47 +++++++++++++++++++++++++++++++++ .vscode/settings.json | 31 ++++++++++++++++++++++ 4 files changed, 121 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/install_tools.sh create mode 100644 .vscode/settings.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..f2f6d9b --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,7 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/v0.241.1/containers/debian/.devcontainer/base.Dockerfile + +# [Choice] Debian version (use bullseye on local arm64/Apple Silicon): bullseye, buster +ARG VARIANT=bullseye +FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT} +COPY ./install_tools.sh /tmp/install_tools.sh +RUN /tmp/install_tools.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f5b5287 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,36 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/blob/v0.241.1/containers/debian +{ + "name": "Debian", + "build": { + "dockerfile": "Dockerfile", + // Update 'VARIANT' to pick an Debian version: bullseye, buster + // Use bullseye on local arm64/Apple Silicon. + "args": { + "VARIANT": "bullseye" + } + }, + "runArgs": [ + // The primary reason this is here is to enable loopback devices, + // which are used for mounting disk images during builds, etc. + "--privileged" + ], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // + // Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. + // "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], + "features": { + "sshd": "latest" + }, + "extensions": [ + "ms-azuretools.vscode-docker", + "dbaeumer.vscode-eslint", + "eamodio.gitlens", + "ms-vscode.makefile-tools", + "ms-python.python", + "svelte.svelte-vscode", + "redhat.vscode-yaml", + "ryu1kn.partial-diff" + ] +} \ No newline at end of file diff --git a/.devcontainer/install_tools.sh b/.devcontainer/install_tools.sh new file mode 100644 index 0000000..8ffc901 --- /dev/null +++ b/.devcontainer/install_tools.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env -S bash -e + +APT_PACKAGES=( + "build-essential" + "git" + "wget" + "binfmt-support" + "qemu" + "gcc-9" + "parted" + "udev" + "zerofree" + "gcc-avr" + "avr-libc" + "avrdude" + "python3" + "python3-pip" + "python3-tornado" + "inetutils-ping" + "curl" + "unzip" + "python3-setuptools" + "gcc-arm-linux-gnueabihf" + "bc" + "vim" + "locate" + "sudo" + "sshpass" +) + +apt-get update +apt-get upgrade -y + +apt-get install -y "${APT_PACKAGES[@]}" + +update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 + +/usr/bin/python3 -m pip install -U yapf + +curl -fsSL https://deb.nodesource.com/setup_18.x | bash - +apt-get install -y nodejs + +mkdir -p /root/.ssh +cat > /root/.ssh/config <<- END +Host onefinity + User bbmc +END diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..427acba --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,31 @@ +{ + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "**/Thumbs.db": true, + "**/node_modules": true, + "**/build": true, + "**/dist": true, + "**/rpi-share": true, + "**/rpi-root": true + }, + "search.exclude": { + "**/bower_components": true, + "**/*.code-search": true, + "**/node_modules": true, + "**/build": true, + "**/dist": true, + "**/rpi-share": true, + "**/rpi-root": true + }, + "explorer.excludeGitIgnore": true, + "git.ignoredRepositories": [ + "rpi-share/camotics", + "rpi-share/cbang" + ], + "git.autofetch": false, + "git.confirmSync": false +} \ No newline at end of file From 8115ceac4519dbaaf1f2a9971df50deb332b975c Mon Sep 17 00:00:00 2001 From: saifullah-N Date: Mon, 6 Feb 2023 11:09:37 +0530 Subject: [PATCH 2/2] Fix SSL certificate issue with mirror --- scripts/gplan-init-dev-img.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/gplan-init-dev-img.sh b/scripts/gplan-init-dev-img.sh index cfa9d4e..4eb4d7e 100755 --- a/scripts/gplan-init-dev-img.sh +++ b/scripts/gplan-init-dev-img.sh @@ -4,8 +4,6 @@ export LC_ALL=C cd /mnt/host # Update the system -apt-get update -#apt-get dist-upgrade -y - +apt -o "Acquire::https::Verify-Peer=false" update # Install packages -apt-get install -y scons build-essential libssl-dev python3-dev +apt -o "Acquire::https::Verify-Peer=false" install -y scons build-essential libssl-dev python3-dev