From b5ca2e68ed1b516d912062a69e4228efbcf92b5a Mon Sep 17 00:00:00 2001 From: Daniel Kennedy Date: Tue, 24 May 2022 18:42:55 -0400 Subject: [PATCH] added script to run commands in a temp docker container --- OSEK_C_Project_Template/runcmd.sh | 12 ++++++++++++ nxtosek/ecrobot/ecrobot++.mak | 6 +++++- nxtosek/ecrobot/ecrobot.mak | 6 +++++- nxtosek/ecrobot/scripts/flash-bios-firmware.sh | 2 +- ...{nxt_bios_rom_3.00.rfw => nxt_bios_rom_1.04.rfw} | Bin scripts/build_nxt_tools.sh | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) create mode 100755 OSEK_C_Project_Template/runcmd.sh rename nxtosek/firmware/{nxt_bios_rom_3.00.rfw => nxt_bios_rom_1.04.rfw} (100%) diff --git a/OSEK_C_Project_Template/runcmd.sh b/OSEK_C_Project_Template/runcmd.sh new file mode 100755 index 0000000..82b21ff --- /dev/null +++ b/OSEK_C_Project_Template/runcmd.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +PROJECT_LOCAL_PATH=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +PROJECT_NAME="$(basename "$PROJECT_LOCAL_PATH")" + +docker run --rm \ + --interactive \ + --tty \ + --privileged \ + --mount type=bind,source="$PROJECT_LOCAL_PATH",target="/home/nxtosek/projects/$PROJECT_NAME" \ + --workdir "/home/nxtosek/projects/$PROJECT_NAME" \ + nxtosek:latest \ + "$@" \ No newline at end of file diff --git a/nxtosek/ecrobot/ecrobot++.mak b/nxtosek/ecrobot/ecrobot++.mak index 8438dfa..0f275b8 100755 --- a/nxtosek/ecrobot/ecrobot++.mak +++ b/nxtosek/ecrobot/ecrobot++.mak @@ -358,7 +358,11 @@ endif @echo "Removing map files" @rm -f *.map @echo "Removing upload scripts" - @rm -f *.sh + @rm -f ./$(BIOSFLASH) + @rm -f ./$(APPFLASH) + @rm -f ./$(RAMBOOT) + @rm -f ./$(RXEFLASH) + @rm -f ./$(RXEFWFLASH) ifneq "$(MAKECMDGOALS)" "clean" -include $(dependencies) diff --git a/nxtosek/ecrobot/ecrobot.mak b/nxtosek/ecrobot/ecrobot.mak index 3515cc5..4c0b9a5 100755 --- a/nxtosek/ecrobot/ecrobot.mak +++ b/nxtosek/ecrobot/ecrobot.mak @@ -351,7 +351,11 @@ endif @echo "Removing map files" @rm -f *.map @echo "Removing upload scripts" - @rm -f *.sh + @rm -f ./$(BIOSFLASH) + @rm -f ./$(APPFLASH) + @rm -f ./$(RAMBOOT) + @rm -f ./$(RXEFLASH) + @rm -f ./$(RXEFWFLASH) ifneq "$(MAKECMDGOALS)" "clean" -include $(dependencies) diff --git a/nxtosek/ecrobot/scripts/flash-bios-firmware.sh b/nxtosek/ecrobot/scripts/flash-bios-firmware.sh index 3d82dfb..9953dfa 100755 --- a/nxtosek/ecrobot/scripts/flash-bios-firmware.sh +++ b/nxtosek/ecrobot/scripts/flash-bios-firmware.sh @@ -6,7 +6,7 @@ echo "Usage: flash-bios-firmware.sh [COM] - COM is either 'usb' (default) or another valid nexttool alias " -FIRMWARE="$NXTOSEK/firmware/nxt_bios_rom_3.00.rfw" +FIRMWARE="$NXTOSEK/firmware/nxt_bios_rom_1.04.rfw" if (( $# == 0 )); then COM=usb elif (( $# == 1 )); then diff --git a/nxtosek/firmware/nxt_bios_rom_3.00.rfw b/nxtosek/firmware/nxt_bios_rom_1.04.rfw similarity index 100% rename from nxtosek/firmware/nxt_bios_rom_3.00.rfw rename to nxtosek/firmware/nxt_bios_rom_1.04.rfw diff --git a/scripts/build_nxt_tools.sh b/scripts/build_nxt_tools.sh index 5971dea..7675245 100755 --- a/scripts/build_nxt_tools.sh +++ b/scripts/build_nxt_tools.sh @@ -6,7 +6,7 @@ VERSION=$(cat "$PROJECT_ROOT/VERSION") WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) INSTALL_DIR="/usr/local/bin" -sudo apt-get install --no-install-recommends gcc g++ build-essential fpc libusb-0.1-4 libusb-dev scons python +sudo apt-get install --no-install-recommends git subversion gcc g++ build-essential fpc libusb-0.1-4 libusb-dev scons python # Download BricxCC, build NeXTTool, install mkdir -p "/tmp/bricxcc"