Firmware now builds in a VSCode "Remote Container"
This commit is contained in:
15
.devcontainer/Dockerfile
Normal file
15
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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}
|
||||
|
||||
RUN apt update \
|
||||
&& apt upgrade -y \
|
||||
&& apt install -y \
|
||||
build-essential git wget binfmt-support qemu gcc-9 \
|
||||
parted gcc-avr avr-libc avrdude python3 python3-tornado curl \
|
||||
unzip python3-setuptools gcc-arm-linux-gnueabihf bc sudo \
|
||||
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 \
|
||||
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
|
||||
&& apt install -y nodejs
|
||||
26
.devcontainer/devcontainer.json
Normal file
26
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,26 @@
|
||||
// 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": ["--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" ],
|
||||
|
||||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
// "remoteUser": "vscode",
|
||||
|
||||
"features": {
|
||||
"sshd": "latest"
|
||||
}
|
||||
}
|
||||
@@ -8,12 +8,18 @@ Debian Linux are not supported.
|
||||
|
||||
On a Debian Linux (9.6.0 stable) system install the required packages:
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential git wget binfmt-support qemu \
|
||||
parted gcc-avr avr-libc avrdude pylint3 python3 python3-tornado curl \
|
||||
unzip python3-setuptools gcc-arm-linux-gnueabihf bc sudo
|
||||
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
apt update
|
||||
apt upgrade -y
|
||||
apt install -y \
|
||||
build-essential git wget binfmt-support qemu gcc-9 \
|
||||
parted gcc-avr avr-libc avrdude python3 python3-tornado curl \
|
||||
unzip python3-setuptools gcc-arm-linux-gnueabihf bc sudo
|
||||
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
|
||||
|
||||
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
||||
|
||||
apt install -y nodejs
|
||||
|
||||
## Getting the Source Code
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
ROOT="$PWD/rpi-root"
|
||||
LOOP=12
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <image> <exec>"
|
||||
@@ -9,7 +8,8 @@ if [ $# -lt 1 ]; then
|
||||
fi
|
||||
|
||||
IMAGE="$1"
|
||||
LOOP_DEV=/dev/loop${LOOP}
|
||||
LOOP_BOOT=
|
||||
LOOP_ROOT=
|
||||
EXEC=
|
||||
|
||||
if [ $# -gt 1 ]; then
|
||||
@@ -26,25 +26,28 @@ fi
|
||||
# Clean up on EXIT
|
||||
function cleanup {
|
||||
umount "$ROOT"/{dev/pts,dev,sys,proc,boot,mnt/host,} 2>/dev/null || true
|
||||
losetup -d $LOOP_DEV 2>/dev/null || true
|
||||
losetup -d $LOOP_BOOT 2>/dev/null || true
|
||||
losetup -d $LOOP_ROOT 2>/dev/null || true
|
||||
rmdir "$ROOT" 2>/dev/null || true
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# set up image as loop device
|
||||
losetup $LOOP_DEV "$IMAGE"
|
||||
partprobe $LOOP_DEV
|
||||
LOOP_BOOT=`losetup -f`
|
||||
losetup -o 4194304 $LOOP_BOOT "$IMAGE"
|
||||
|
||||
LOOP_ROOT=`losetup -f`
|
||||
losetup -o 48234496 $LOOP_ROOT "$IMAGE"
|
||||
|
||||
# check and fix filesystems
|
||||
fsck -f ${LOOP_DEV}p1
|
||||
fsck -f ${LOOP_DEV}p2
|
||||
fsck -f $LOOP_BOOT
|
||||
fsck -f $LOOP_ROOT
|
||||
|
||||
# make dir
|
||||
mkdir -p "$ROOT"
|
||||
|
||||
# mount partition
|
||||
mount -o rw ${LOOP_DEV}p2 -t ext4 "$ROOT"
|
||||
mount -o rw ${LOOP_DEV}p1 "$ROOT/boot"
|
||||
mount -o rw $LOOP_ROOT -t ext4 "$ROOT"
|
||||
mount -o rw $LOOP_BOOT "$ROOT/boot"
|
||||
|
||||
# mount binds
|
||||
mount --bind /dev "$ROOT/dev/"
|
||||
|
||||
@@ -5,7 +5,7 @@ ccflags-y:=-std=gnu99 -Wno-declaration-after-statement
|
||||
|
||||
KPKG=raspberrypi-kernel_1.20171029-1.tar.gz
|
||||
KURL=https://github.com/dbrgn/linux-rpi/archive/$(KPKG)
|
||||
KDIR=linux-rpi-raspberrypi-kernel_1.20171029-1
|
||||
KDIR=/tmp/rpi-kernel
|
||||
export KERNEL=kernel7
|
||||
|
||||
KOPTS=ARCH=arm CROSS_COMPILE=$(CROSS) -C $(KDIR)
|
||||
@@ -14,7 +14,9 @@ all: $(KDIR)
|
||||
$(MAKE) $(KOPTS) M=$(DIR) modules
|
||||
|
||||
$(KDIR): $(KPKG)
|
||||
tar xf $(KPKG)
|
||||
rm -rf $(KDIR)
|
||||
mkdir -p $(KDIR)
|
||||
tar xf $(KPKG) -C $(KDIR) --strip-components 1
|
||||
$(MAKE) $(KOPTS) bcm2709_defconfig
|
||||
$(MAKE) $(KOPTS) modules_prepare
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
script#settings-view-template(type="text/x-template")
|
||||
#settings
|
||||
#settings
|
||||
|
||||
Reference in New Issue
Block a user