From 351beb96f38db46c0f92bb01e5800b32daa0217b Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 29 Apr 2011 22:07:50 +0200 Subject: [PATCH] Adds initial support for Windows x64. --- Makefile.am | 16 +++++++- configure.windows-x64 | 3 ++ configure.windows => configure.windows-x86 | 0 portable.h | 2 +- snapraid.conf.example.windows | 44 ++++++++++++++++++++++ 5 files changed, 63 insertions(+), 2 deletions(-) create mode 100755 configure.windows-x64 rename configure.windows => configure.windows-x86 (100%) create mode 100644 snapraid.conf.example.windows diff --git a/Makefile.am b/Makefile.am index e00e41dd..3762274e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -299,7 +299,7 @@ DISTWIN = \ snapraid.txt \ snapraid.exe -distwindows: $(DISTWIN) +distwindows-x86: $(DISTWIN) rm -f $(PACKAGE)-$(VERSION)-windows-x86.zip mkdir tmp cp $(DISTWIN) tmp @@ -313,3 +313,17 @@ distwindows: $(DISTWIN) cd tmp && zip -r ../$(PACKAGE)-$(VERSION)-windows-x86.zip * rm -r tmp +distwindows-x64: $(DISTWIN) + rm -f $(PACKAGE)-$(VERSION)-windows-x64.zip + mkdir tmp + cp $(DISTWIN) tmp + cp snapraid.conf.example.windows tmp/snapraid.conf.example + cp INSTALL.windows tmp/install.txt + cp README tmp/readme.txt + cp AUTHORS tmp/authors.txt + cp HISTORY tmp/history.txt + cp COPYING tmp/copying.txt + cp TODO tmp/todo.txt + cd tmp && zip -r ../$(PACKAGE)-$(VERSION)-windows-x64.zip * + rm -r tmp + diff --git a/configure.windows-x64 b/configure.windows-x64 new file mode 100755 index 00000000..126271e5 --- /dev/null +++ b/configure.windows-x64 @@ -0,0 +1,3 @@ +./configure --host=x86_64-w64-mingw32 --build=`./config.guess` $@ + + diff --git a/configure.windows b/configure.windows-x86 similarity index 100% rename from configure.windows rename to configure.windows-x86 diff --git a/portable.h b/portable.h index fbc07772..44428a68 100644 --- a/portable.h +++ b/portable.h @@ -142,7 +142,7 @@ struct windows_stat { static inline void windows_info2stat(const BY_HANDLE_FILE_INFORMATION* info, struct windows_stat* st) { /* Convert special attributes to a char device */ - if ((info->dwFileAttributes & (FILE_ATTRIBUTE_DEVICE | FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_VIRTUAL | FILE_ATTRIBUTE_REPARSE_POINT)) != 0) { + if ((info->dwFileAttributes & (FILE_ATTRIBUTE_DEVICE | FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_REPARSE_POINT)) != 0) { st->st_mode = S_IFCHR; } else if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) { st->st_mode = S_IFDIR; diff --git a/snapraid.conf.example.windows b/snapraid.conf.example.windows new file mode 100644 index 00000000..3f85b878 --- /dev/null +++ b/snapraid.conf.example.windows @@ -0,0 +1,44 @@ +# Example configuration for snapraid for Windows + +# Defines the file to use as Parity storage +# It must NOT be in a data disk +# Format: "parity FILE_PATH" +parity E:\par\parity + +# Defines the file to use as Q-Parity storage +# If specified, it enables a double failures protection like RAID6 +# It must NOT be in a data disk +# Format: "q-parity FILE_PATH" +#q-parity F:\qar\q-parity + +# Defines the file to use as content list +# You can use multiple specification to store more copies of the file +# It's suggested to have at least N+1 copies of the file, where N is the number of parity files. +# It must NOT be in a data disk +# It can be in the disks used for parity storage +# Format: "content FILE_PATH" +content E:\par\content +#content F:\qar\content +content C:\snapraid\content + +# Defines the data disks to use +# The order is relevant for parity, do not change it +# Format: "disk DISK_NAME DISK_MOUNT_POINT" +disk d1 G:\array\ +disk d2 H:\array\ +disk d3 I:\array\ + +# Defines files and directories to exclude +# Remember to use the forward slash -> / +# Format: "exclude FILE" +# Format: "exclude DIR/" +# Format: "exclude /PATH/FILE" +# Format: "exclude /PATH/DIR/" +exclude *.bak +exclude tmp/ + +# Defines the block size in kibi bytes (1024 bytes). +# Default value is 256 -> 256 kibi bytes -> 262144 bytes +# Format: "block_size SIZE_IN_KiB" +block_size 256 +