Compare commits

...

2 commits

Author SHA1 Message Date
Sebastian Kuzminsky
44ac3694cb add run-remote: rsync an image to a target and run it 2025-09-04 16:08:40 -06:00
Sebastian Kuzminsky
41fc678b69 add inspect/serial-log container 2025-09-04 16:08:40 -06:00
5 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,19 @@
FROM debian:stable-slim
# set up base package requirements for can device
RUN ( \
set -e; \
apt-get --yes --quiet update; \
apt-get install --yes --quiet \
tio \
; \
apt-get --yes --quiet clean; \
)
# set workdir to /usr/src/env
WORKDIR /usr/src/env
# copy init.sh to workdir
COPY init.sh ./
ENTRYPOINT ["/bin/bash", "init.sh"]

2
inspect/serial-log/build.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
docker build --platform arm64 --tag inspect/serial-log .

6
inspect/serial-log/init.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
set -x
SERIAL_DEV=$1
DEV_NAME=$(basename "${SERIAL_DEV}")
tio -m INLCRNL --log --log-file "serial-log.${DEV_NAME}" "${SERIAL_DEV}"

6
inspect/serial-log/run.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
set -x
SERIAL_DEV="$1"
DEV="--device $1:$1"
docker run --rm -it --network=host --privileged ${DEV} -v $PWD:/usr/src/env/ext-dir inspect/serial-log $1

13
run-remote Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
IMAGE="$1"
shift
TARGET="$1"
shift
IMAGE_BASENAME=$(basename "${IMAGE}")
docker save -o "/tmp/${IMAGE_BASENAME}" "${IMAGE}"
rsync -av --progress "/tmp/${IMAGE_BASENAME}" "${IMAGE}/run.sh" "${TARGET}:/tmp"
ssh "${TARGET}" docker load -i "/tmp/${IMAGE_BASENAME}"
ssh -t "${TARGET}" /tmp/run.sh $@