diff -urN multipath-tools-0.1.7/ChangeLog multipath-tools-0.1.8/ChangeLog
--- multipath-tools-0.1.7/ChangeLog	2004-05-10 09:58:44.000000000 +0200
+++ multipath-tools-0.1.8/ChangeLog	2004-05-13 18:55:29.000000000 +0200
@@ -1,9 +1,14 @@
+2004-05-15 multipath-tools-0.1.8
+	* Makefiles cleanup and factorisation
+	* Compilation fixes for non-ix86 archs, tested on x86_64
+	* strip execs harder for a 10% size reduction
+	* blacklist /dev/fd* and /dev/loop*
+	* dmadm works with sysfs nodes with '!' (cciss for ex)
 2004-05-10 multipath-tools-0.1.7
 	* bugfixes from	Andy <genanr@emsphone.com> :
 		* read the last line of the config file
 		* add an entry for the 3PARData storage ctlrs
 		* read the last char of vendor and model strings
-	* dmadm exits cleanly when it has nothing to do
 2004-04-25 multipath-tools-0.1.6
 	* add the dmadm WIP tool (read MD superblocks and create
 	  corresponding devmaps when possible)
diff -urN multipath-tools-0.1.7/Makefile.inc multipath-tools-0.1.8/Makefile.inc
--- multipath-tools-0.1.7/Makefile.inc	1970-01-01 01:00:00.000000000 +0100
+++ multipath-tools-0.1.8/Makefile.inc	2004-05-13 18:21:46.000000000 +0200
@@ -0,0 +1,43 @@
+# Makefile.inc
+#
+# Copyright (C) 2004 Christophe Varoqui, <christophe.varoqui@free.fr>
+
+# directories
+prefix      = 
+exec_prefix = ${prefix}
+bindir      = ${exec_prefix}/sbin
+udevdir	    = ../../..
+libdmdir    = ../libdevmapper
+klibcdir    = $(udevdir)/klibc
+sysfsdir    = $(udevdir)/libsysfs
+mandir      = /usr/share/man/man8
+arch        = ${shell $(CC) -dumpmachine | sed \
+              -e s'/-.*//' -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \
+              -e 's/arm.*/arm/g' -e 's/m68k.*/m68k/' -e 's/powerpc/ppc/g'}
+
+# tools
+CC          = gcc
+GZIP        = /bin/gzip -9 -c
+STRIP       = strip --strip-all -R .comment -R .note
+
+# arch specific stuff
+include $(klibcdir)/klibc/arch/$(arch)/MCONFIG
+
+# compilation params
+GCCINCDIR := ${shell unset LANG;$(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
+KERNEL_DIR = /lib/modules/${shell uname -r}/build
+CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
+         -I$(klibcdir)/klibc/include \
+	 -I$(klibcdir)/klibc/include/bits$(BITSIZE) \
+         -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I$(sysfsdir) -I.
+
+CRT0 = $(klibcdir)/klibc/crt0.o
+LIB = $(klibcdir)/klibc/libc.a
+LIBGCC := $(shell $(CC) -print-libgcc-file-name )
+
+DMOBJS = $(libdmdir)/libdm-common.o $(libdmdir)/ioctl/libdevmapper.o
+SYSFSOBJS = $(sysfsdir)/dlist.o $(sysfsdir)/sysfs_bus.o \
+            $(sysfsdir)/sysfs_class.o $(sysfsdir)/sysfs_device.o \
+            $(sysfsdir)/sysfs_dir.o $(sysfsdir)/sysfs_driver.o \
+            $(sysfsdir)/sysfs_utils.o
+
diff -urN multipath-tools-0.1.7/devmap_name/Makefile multipath-tools-0.1.8/devmap_name/Makefile
--- multipath-tools-0.1.7/devmap_name/Makefile	2004-03-06 19:27:03.000000000 +0100
+++ multipath-tools-0.1.8/devmap_name/Makefile	2004-05-13 18:16:42.000000000 +0200
@@ -4,33 +4,13 @@
 
 EXEC = devmap_name
 
-prefix      = 
-exec_prefix = ${prefix}
-bindir      = ${exec_prefix}/sbin
-udevdir	    = ../../..
-klibcdir    = $(udevdir)/klibc
-mandir      = /usr/share/man/man8
-libdmdir    = ../libdevmapper
-
-CC = gcc
-GZIP = /bin/gzip -9 -c
-
-GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
-KERNEL_DIR = /lib/modules/${shell uname -r}/build
-CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
-         -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
-         -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I$(sysfsdir) -I.
+include ../Makefile.inc
 
 OBJS = devmap_name.o
-CRT0 = $(klibcdir)/klibc/crt0.o
-LIB = $(klibcdir)/klibc/libc.a
-LIBGCC := $(shell $(CC) -print-libgcc-file-name )
-
-DMOBJS = $(libdmdir)/libdm-common.o $(libdmdir)/ioctl/libdevmapper.o
 
 $(EXEC): $(OBJS)
 	$(LD) -o $(EXEC) $(CRT0) $(OBJS) $(DMOBJS) $(LIB) $(LIBGCC)
-	strip $(EXEC)
+	$(STRIP) $(EXEC)
 	$(GZIP) $(EXEC).8 > $(EXEC).8.gz
 
 clean:
diff -urN multipath-tools-0.1.7/dmadm/Makefile multipath-tools-0.1.8/dmadm/Makefile
--- multipath-tools-0.1.7/dmadm/Makefile	2004-03-29 15:47:29.000000000 +0200
+++ multipath-tools-0.1.8/dmadm/Makefile	2004-05-13 18:16:43.000000000 +0200
@@ -1,37 +1,12 @@
 EXEC        = dmadm
 
-prefix      =
-exec_prefix = ${prefix}
-bindir      = ${exec_prefix}/sbin
-udevdir     = ../../..
-klibcdir    = $(udevdir)/klibc
-sysfsdir    = $(udevdir)/libsysfs
-arch        = i386
-klibcarch   = $(klibcdir)/klibc/arch/$(arch)/include
-
-CC = gcc
-GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
-KERNEL_DIR = /lib/modules/${shell uname -r}/build
-CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
-	 -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
-	 -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I. -I$(klibcarch) -I$(sysfsdir)
-
 OBJS = util.o dmadm.o
-CRT0 = $(udevdir)/klibc/klibc/crt0.o
-LIB = $(udevdir)/klibc/klibc/libc.a
-LIBGCC := $(shell $(CC) -print-libgcc-file-name )
-
-SYSFSOBJS = $(sysfsdir)/dlist.o $(sysfsdir)/sysfs_bus.o \
-	    $(sysfsdir)/sysfs_class.o $(sysfsdir)/sysfs_device.o \
-	    $(sysfsdir)/sysfs_dir.o $(sysfsdir)/sysfs_driver.o \
-	    $(sysfsdir)/sysfs_utils.o
 
-DMOBJS = ../libdevmapper/libdm-common.o \
-	 ../libdevmapper/ioctl/libdevmapper.o
+include ../Makefile.inc
 
 $(EXEC): $(OBJS)
 	$(LD) -o $(EXEC) $(CRT0) $(OBJS) $(SYSFSOBJS) $(DMOBJS) $(LIB) $(LIBGCC)
-	strip $(EXEC)
+	$(STRIP) $(EXEC)
 
 clean:
 	rm -f $(OBJS) *.o $(EXEC) *~
diff -urN multipath-tools-0.1.7/dmadm/dmadm.c multipath-tools-0.1.8/dmadm/dmadm.c
--- multipath-tools-0.1.7/dmadm/dmadm.c	2004-04-27 15:17:15.000000000 +0200
+++ multipath-tools-0.1.8/dmadm/dmadm.c	2004-05-13 18:47:44.000000000 +0200
@@ -82,6 +82,18 @@
 	return (a->super.this_disk.number < b->super.this_disk.number ? a : b);
 }
 
+static void
+format_devname (char * devname)
+{
+	char * p = devname;
+
+	while (*p) {
+		if (*p == '!')
+			*p = '/';
+		p++;
+	}
+}
+
 unsigned long long
 get_disk_size (char * sysfs_path, char * devname) {
 	unsigned long long size;
@@ -277,7 +289,8 @@
 	sysfs_read_directory (sdir);
 
 	dlist_for_each_data (sdir->subdirs, devp, struct sysfs_directory) {
-
+		format_devname (devp->name);
+		
 		if (blacklist (devp->name))
 			continue;
 
diff -urN multipath-tools-0.1.7/kpartx/Makefile multipath-tools-0.1.8/kpartx/Makefile
--- multipath-tools-0.1.7/kpartx/Makefile	2004-03-23 11:30:07.000000000 +0100
+++ multipath-tools-0.1.8/kpartx/Makefile	2004-05-13 18:17:09.000000000 +0200
@@ -1,31 +1,14 @@
 EXEC        = kpartx
 
-prefix      =
-exec_prefix = ${prefix}
-bindir      = ${exec_prefix}/sbin
-udevdir     = ../../..
-klibcdir    = $(udevdir)/klibc
-arch        = i386
-klibcarch   = $(klibcdir)/klibc/arch/$(arch)/include
-
-CC = gcc
-GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
-KERNEL_DIR = /lib/modules/${shell uname -r}/build
-CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
-	 -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
-	 -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I. -I$(klibcarch)
+#klibcarch   = $(klibcdir)/klibc/arch/$(arch)/include
 
-OBJ = bsd.o dos.o kpartx.o solaris.o unixware.o gpt.o crc32.o lopart.o xstrncpy.o
-CRT0 = $(udevdir)/klibc/klibc/crt0.o
-LIB = $(udevdir)/klibc/klibc/libc.a
-LIBGCC := $(shell $(CC) -print-libgcc-file-name )
+include ../Makefile.inc
 
-DMOBJS = ../libdevmapper/libdm-common.o \
-	 ../libdevmapper/ioctl/libdevmapper.o
+OBJ = bsd.o dos.o kpartx.o solaris.o unixware.o gpt.o crc32.o lopart.o xstrncpy.o
 
 $(EXEC): $(OBJ)
 	$(LD) -o $(EXEC) $(CRT0) $(OBJ) $(DMOBJS) $(LIB) $(LIBGCC)
-	strip $(EXEC)
+	$(STRIP) $(EXEC)
 
 clean:
 	rm -f $(OBJ) *.o $(EXEC) *~
diff -urN multipath-tools-0.1.7/kpartx/kpartx.c multipath-tools-0.1.8/kpartx/kpartx.c
--- multipath-tools-0.1.7/kpartx/kpartx.c	2004-03-25 17:41:08.000000000 +0100
+++ multipath-tools-0.1.8/kpartx/kpartx.c	2004-05-13 18:17:18.000000000 +0200
@@ -445,7 +445,7 @@
 /*
  * sseek: seek to specified sector
  */
-#if !defined (__alpha__) && !defined (__ia64__)
+#if !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__)
 #include <linux/unistd.h>       /* _syscall */
 static
 _syscall5(int,  _llseek,  uint,  fd, ulong, hi, ulong, lo,
@@ -458,7 +458,7 @@
 	in = ((long long) secnr << 9);
 	out = 1;
 
-#if !defined (__alpha__) && !defined (__ia64__)
+#if !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__)
 	if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0
 	    || out != in)
 #else
diff -urN multipath-tools-0.1.7/libdevmapper/Makefile multipath-tools-0.1.8/libdevmapper/Makefile
--- multipath-tools-0.1.7/libdevmapper/Makefile	2004-03-03 16:10:43.000000000 +0100
+++ multipath-tools-0.1.8/libdevmapper/Makefile	2004-05-13 18:16:32.000000000 +0200
@@ -2,17 +2,9 @@
 #
 # Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@free.fr>
 
-CC = gcc
-udevdir     = ../../..
-klibcdir    = $(udevdir)/klibc
+include ../Makefile.inc
 
-CC = gcc
-GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
-KERNEL_DIR = /lib/modules/${shell uname -r}/build
-
-CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
-         -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
-         -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I. -Iioctl
+CFLAGS += -Iioctl
 
 OBJS = ioctl/libdevmapper.o libdm-common.o
 
@@ -22,7 +14,3 @@
 
 clean:
 	rm -f core *.o ioctl/*.o ioctl/*.so
-
-install:
-
-uninstall:
diff -urN multipath-tools-0.1.7/multipath/Makefile multipath-tools-0.1.8/multipath/Makefile
--- multipath-tools-0.1.7/multipath/Makefile	2004-03-16 17:16:47.000000000 +0100
+++ multipath-tools-0.1.8/multipath/Makefile	2004-05-13 18:16:19.000000000 +0200
@@ -4,41 +4,15 @@
 
 EXEC = multipath
 
-prefix      = 
-exec_prefix = ${prefix}
-bindir      = ${exec_prefix}/sbin
-udevdir	    = ../../..
-klibcdir    = $(udevdir)/klibc
-sysfsdir    = $(udevdir)/libsysfs
-mandir      = /usr/share/man/man8
-libdmdir    = ../libdevmapper
-arch        = i386
-klibcarch   = $(klibcdir)/klibc/arch/$(arch)/include
-
-CC = gcc
-GZIP = /bin/gzip -9 -c
-
-GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
-KERNEL_DIR = /lib/modules/${shell uname -r}/build
-CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
-         -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
-         -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I$(sysfsdir) -I. -I$(klibcarch)
+include ../Makefile.inc
 
-OBJS = pgpolicies.o configfile.o devinfo.o main.o
+CFLAGS += -I$(klibcdir)/klibc/arch/$(arch)/include
 
-CRT0 = $(klibcdir)/klibc/crt0.o
-LIB = $(klibcdir)/klibc/libc.a
-LIBGCC := $(shell $(CC) -print-libgcc-file-name )
-
-DMOBJS = $(libdmdir)/libdm-common.o $(libdmdir)/ioctl/libdevmapper.o
-SYSFSOBJS = $(sysfsdir)/dlist.o $(sysfsdir)/sysfs_bus.o \
-	    $(sysfsdir)/sysfs_class.o $(sysfsdir)/sysfs_device.o \
-	    $(sysfsdir)/sysfs_dir.o $(sysfsdir)/sysfs_driver.o \
-	    $(sysfsdir)/sysfs_utils.o
+OBJS = pgpolicies.o configfile.o devinfo.o main.o
 
 $(EXEC): $(OBJS)
 	$(LD) -o $(EXEC) $(CRT0) $(OBJS) $(SYSFSOBJS) $(DMOBJS) $(LIB) $(LIBGCC)
-	strip $(EXEC)
+	$(STRIP) $(EXEC)
 	$(GZIP) $(EXEC).8 > $(EXEC).8.gz
 
 clean:
diff -urN multipath-tools-0.1.7/multipath/main.c multipath-tools-0.1.8/multipath/main.c
--- multipath-tools-0.1.7/multipath/main.c	2004-05-06 09:59:45.000000000 +0200
+++ multipath-tools-0.1.8/multipath/main.c	2004-05-13 18:16:18.000000000 +0200
@@ -117,6 +117,7 @@
 		int lengh;
 	} blist[] = {
 		{"cciss", 5},
+		{"fd", 2},
 		{"hd", 2},
 		{"md", 2},
 		{"dm", 2},
@@ -124,6 +125,7 @@
 		{"scd", 3},
 		{"ram", 3},
 		{"raw", 3},
+		{"loop", 4},
 		{NULL, 0},
 	};
 
diff -urN multipath-tools-0.1.7/multipathd/main.c multipath-tools-0.1.8/multipathd/main.c
--- multipath-tools-0.1.7/multipathd/main.c	2004-03-12 23:14:21.000000000 +0100
+++ multipath-tools-0.1.8/multipathd/main.c	2004-05-13 18:16:39.000000000 +0200
@@ -135,7 +135,7 @@
 	unsigned next = 0;
 	void *nexttgt;
 	int r = 0;
-	long long start, length;
+	uint64_t start, length;
 	char *target_type = NULL;
 	char *params;
 
@@ -257,7 +257,7 @@
 	struct devmap *devmaps_p;
 	void *next;
 	struct dm_task *dmt;
-	long long start, length;
+	uint64_t start, length;
 	char *target_type = NULL;
 	char *params, *p1, *p2;
 	char word[6];
