From bd80a3d2b97c0242bb43e9ed16e8cb3bc5d82519 Mon Sep 17 00:00:00 2001 From: Michael McMaster Date: Mon, 20 Jun 2022 14:07:04 +1000 Subject: [PATCH] Use Docker to build firmware and scsi2sd-util6 --- .gitattributes | 1 + .gitignore | 2 ++ Dockerfile | 6 ++++++ include/scsi2sd.h | 2 +- src/scsi2sd-util6/ConfigUtil.cc | 21 --------------------- src/scsi2sd-util6/Dockerfile-linux | 20 ++++++++++++++++++++ src/scsi2sd-util6/Makefile | 1 + 7 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 .gitattributes create mode 100644 Dockerfile create mode 100644 src/scsi2sd-util6/Dockerfile-linux diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..176a458f --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore index 103fb01d..7fcf0034 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ *.c~ *.h.un~ *.h~ +build/ +src/scsi2sd-util6/build \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..b452829e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +# Docker image used for building the firmware. +# docker build . -t scsi2sd-build +# docker run --rm -v ${PWD}:/src scsi2sd-build make -C src -f Makefile.2021 +FROM debian:bullseye-slim + +RUN apt update && apt install -y gcc-arm-none-eabi make python3 python-is-python3 \ No newline at end of file diff --git a/include/scsi2sd.h b/include/scsi2sd.h index 9a988bf0..8c18907d 100755 --- a/include/scsi2sd.h +++ b/include/scsi2sd.h @@ -63,7 +63,7 @@ typedef enum typedef enum { S2S_CFG_ENABLE_TERMINATOR = 1 - //S2S_CFG_ENABLE_BLIND_WRITES = 2, // Obosolete + //S2S_CFG_ENABLE_BLIND_WRITES = 2, // Obsolete } S2S_CFG_FLAGS6; typedef enum diff --git a/src/scsi2sd-util6/ConfigUtil.cc b/src/scsi2sd-util6/ConfigUtil.cc index 26acaa79..3080c332 100755 --- a/src/scsi2sd-util6/ConfigUtil.cc +++ b/src/scsi2sd-util6/ConfigUtil.cc @@ -384,15 +384,6 @@ ConfigUtil::toXML(const S2S_BoardCfg& config) " ********************************************************* -->\n" << " " << static_cast(config.scsiSpeed) << "\n" << - " \n" << - " " << - (config.flags6 & S2S_CFG_ENABLE_BLIND_WRITES ? "true" : "false") << - "\n" << - "\n"; return s.str(); @@ -612,18 +603,6 @@ parseBoardConfig(wxXmlNode* node) result.flags6 = result.flags & ~S2S_CFG_ENABLE_TERMINATOR; } } - else if (child->GetName() == "blindWrites") - { - std::string s(child->GetNodeContent().mb_str()); - if (s == "true") - { - result.flags6 |= S2S_CFG_ENABLE_BLIND_WRITES; - } - else - { - result.flags6 = result.flags & ~S2S_CFG_ENABLE_BLIND_WRITES; - } - } else if (child->GetName() == "selLatch") { std::string s(child->GetNodeContent().mb_str()); diff --git a/src/scsi2sd-util6/Dockerfile-linux b/src/scsi2sd-util6/Dockerfile-linux new file mode 100644 index 00000000..5d38420d --- /dev/null +++ b/src/scsi2sd-util6/Dockerfile-linux @@ -0,0 +1,20 @@ +# Docker image used for building scsi2sd-util6 for Windows and Linux. + +# Ensure git is using lf line endings on windows. Anything else breaks the autoconf scripts: +# git config --global core.eol lf +# git config --global core.autocrlf input + +# docker build -f Dockerfile-linux -t scsi2sd-util-build . +# +# One-off prep: (this could be added to the makefile !) +# docker run --rm -v ${PWD}:/src/scsi2sd-util6 -w /src/scsi2sd-util6/libusb-1.0.23 scsi2sd-util-build autoreconf -i +# docker run --rm -v ${PWD}:/src/scsi2sd-util6 -w /src/scsi2sd-util6/dfu-util scsi2sd-util-build sh -c ./autogen.sh +# +# Run make via "sh" to ensure $PWD is set correctly: +# docker run --rm -v ${PWD}/../../:/app -w /app/src/scsi2sd-util6/ scsi2sd-util-build sh -c "make -j" +# docker run --rm -v ${PWD}/../../:/app -w /app/src/scsi2sd-util6/ scsi2sd-util-build sh -c "make -j TARGET=Win32" +# docker run --rm -v ${PWD}/../../:/app -w /app/src/scsi2sd-util6/ scsi2sd-util-build sh -c "make -j TARGET=Win64" +FROM debian:bullseye-slim + +RUN apt update && apt install -y g++ g++-mingw-w64 make automake libtool pkg-config +RUN apt update && apt install -y libudev-dev libgtk2.0-dev libusb-1.0-0-dev \ No newline at end of file diff --git a/src/scsi2sd-util6/Makefile b/src/scsi2sd-util6/Makefile index 76ac0234..b7fa70c1 100755 --- a/src/scsi2sd-util6/Makefile +++ b/src/scsi2sd-util6/Makefile @@ -97,6 +97,7 @@ ifeq ($(TARGET),Linux) BUILD := $(PWD)/build/linux LIBUSB_CONFIG+=--disable-shared LDFLAGS_LIBUSB+= -ludev -lpthread + USE_SYSTEM_DFU_UTIL = Yes endif ifeq ($(TARGET),Darwin) # Should match OSX -- 2.26.2