Use Docker to build firmware and scsi2sd-util6 master
authorMichael McMaster <michael@codesrc.com>
Mon, 20 Jun 2022 04:07:04 +0000 (14:07 +1000)
committerMichael McMaster <michael@codesrc.com>
Mon, 20 Jun 2022 04:07:04 +0000 (14:07 +1000)
.gitattributes [new file with mode: 0644]
.gitignore
Dockerfile [new file with mode: 0644]
include/scsi2sd.h
src/scsi2sd-util6/ConfigUtil.cc
src/scsi2sd-util6/Dockerfile-linux [new file with mode: 0644]
src/scsi2sd-util6/Makefile

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..176a458
--- /dev/null
@@ -0,0 +1 @@
+* text=auto
index 103fb01d084e3b60cc48d07c39af2f38f749c07a..7fcf003482616450747f9fbd824eee81ebb1aa2e 100644 (file)
@@ -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 (file)
index 0000000..b452829
--- /dev/null
@@ -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
index 9a988bf07e9e87a62fba7b2b074b448c9ef609f7..8c18907d1a8b8a15543c95c3ac37490a1f4271f4 100755 (executable)
@@ -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
index 26acaa79a8770c7f81143043e12e1b80fadcc540..3080c3327e0c776a6d56f3b5953797295250ad1d 100755 (executable)
@@ -384,15 +384,6 @@ ConfigUtil::toXML(const S2S_BoardCfg& config)
                "       ********************************************************* -->\n" <<
                "       <scsiSpeed>" << static_cast<int>(config.scsiSpeed) << "</scsiSpeed>\n" <<
 
-               "       <!-- ********************************************************\n" <<
-               "       Enable SD card blind writes, which starts writing to the SD\n"
-               "       card before all the SCSI data has been received. Can cause problems\n" <<
-               "       with some SCSI hosts\n" <<
-               "       ********************************************************* -->\n" <<
-               "       <blindWrites>" <<
-                       (config.flags6 & S2S_CFG_ENABLE_BLIND_WRITES ? "true" : "false") <<
-                       "</blindWrites>\n" <<
-
                "</S2S_BoardCfg>\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 (file)
index 0000000..5d38420
--- /dev/null
@@ -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
index 76ac02342a493a1e533790d2ce35e4be08fe1d85..b7fa70c1965474117b0ce6764201dc548b6175b9 100755 (executable)
@@ -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