Explorar el Código

Use Docker to build firmware and scsi2sd-util6

Michael McMaster hace 3 años
padre
commit
aac833f779

+ 1 - 0
lib/SCSI2SD/.gitattributes

@@ -0,0 +1 @@
+* text=auto

+ 2 - 0
lib/SCSI2SD/.gitignore

@@ -2,3 +2,5 @@
 *.c~
 *.h.un~
 *.h~
+build/
+src/scsi2sd-util6/build

+ 6 - 0
lib/SCSI2SD/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

+ 1 - 1
lib/SCSI2SD/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

+ 0 - 21
lib/SCSI2SD/src/scsi2sd-util6/ConfigUtil.cc

@@ -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());

+ 20 - 0
lib/SCSI2SD/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

+ 1 - 0
lib/SCSI2SD/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