Skip to content

Commit

Permalink
vscode: tasks: Adjust to flash from inside container
Browse files Browse the repository at this point in the history
Signed-off-by: Matheus Castello <[email protected]>
  • Loading branch information
microhobby committed Jul 29, 2023
1 parent a711234 commit 489fd2a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RUN apt-get -q -y update && \
gdb-multiarch \
libssl-dev \
bc \
bmap-tools \
docker-ce \
docker-ce-cli \
containerd.io \
Expand Down Expand Up @@ -58,6 +59,10 @@ RUN chmod +x /usr/bin/bitbakes.sh && \
# for the wsl docker socket
RUN groupadd -g 1001 dockerwsl && usermod -aG dockerwsl usersetup

## ⚠️⚠️ WARNING: This is a security risk ⚠️⚠️
## This is only for development purposes and should never be used in production!
RUN echo "usersetup ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

USER usersetup

CMD ["/bin/bash"]
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
"bitbake.distro": "torizon",
"bitbake.buildDir": "build-torizon",
"bitbake.setupScript": "startup-tdx.sh",
"flash_device": "/dev/sdb",
"notifyAddr": "192.168.0.51",
"notifyPort": "9000",
"machine": "beagleplay",
"machine": "raspberrypi4-64",
"image": "torizon-core-common-docker-dev",
"distro": "torizon",
"build_dir": "build-torizon",
"image_format": "wic.xz"
"image_format": "wic.bz2"
}
17 changes: 9 additions & 8 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,13 @@
"command": "sudo",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/../workdir/torizon"
"cwd": "/workdir/torizon"
},
"args": [
"bmaptool",
"copy",
"${workspaceFolder}/../workdir/torizon/build-${config:distro}/deploy/images/${config:machine}/${config:image}-${config:machine}.${config:image_format}",
"/dev/sdb"
"/workdir/torizon/build-${config:distro}/deploy/images/${config:machine}/${config:image}-${config:machine}.${config:image_format}",
"${config:flash_device}"
],
"problemMatcher": [
"$gcc"
Expand All @@ -337,14 +337,14 @@
"command": "sudo",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/../workdir/torizon"
"cwd": "/workdir/torizon"
},
"args": [
"bmaptool",
"copy",
"--nobmap",
"${workspaceFolder}/../workdir/torizon/build-${config:distro}/deploy/images/${config:machine}/${config:image}-${config:machine}.${config:image_format}",
"/dev/sdb"
"/workdir/torizon/build-${config:distro}/deploy/images/${config:machine}/${config:image}-${config:machine}.${config:image_format}",
"${config:flash_device}"
],
"problemMatcher": [
"$gcc"
Expand All @@ -363,10 +363,11 @@
"command": "sudo",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/.."
"cwd": "/workdir/"
},
"args": [
"mount", "/dev/sdb1", "./mount",
"mkdir", "-p", "./mount",
"mount", "${config:flash_device}1", "./mount",
"&&",
"sudo", "rm", "-rf", "./mount/*",
"&&",
Expand Down

0 comments on commit 489fd2a

Please sign in to comment.