diff --git a/os/imagezip/Makefile-linux.sa b/os/imagezip/Makefile-linux.sa index 107e13b0d961251957666be337e30063704a0769..c2b6e1a8f0ce1ab3e122dda96992c59aa62659a4 100644 --- a/os/imagezip/Makefile-linux.sa +++ b/os/imagezip/Makefile-linux.sa @@ -1,6 +1,6 @@ # # EMULAB-COPYRIGHT -# Copyright (c) 2000-2004 University of Utah and the Flux Group. +# Copyright (c) 2000-2005 University of Utah and the Flux Group. # All rights reserved. # @@ -16,7 +16,7 @@ BINDIR= /usr/local/bin WITH_EXTFS = 1 WITH_FFS = 1 WITH_FAT = 0 -WITH_NTFS = 0 # needs work +WITH_NTFS = 0 PTHREADCFLAGS = -D_THREAD_SAFE -pthread #PTHREADLIBS = -L/usr/local/lib -llgcc_r @@ -45,10 +45,16 @@ FSOBJS += fat/fat_fat.o fat/fat_boot.o fat/fat_glue.o CFLAGS += -DWITH_FAT -Ifat endif +ifdef WITH_NTFS +FSOBJS += ntfs/ntfs_glue.o +FSLIBS += ntfs/libntfs/libntfs.a +CFLAGS += -DWITH_NTFS -Intfs/libntfs/ntfsprogs-1.7.1.linux/include +endif + all: imagezip imageunzip imagedump -imagezip: imagezip.o version.o $(FSOBJS) - $(CC) $(CFLAGS) imagezip.o version.o $(FSOBJS) $(LIBS) -o imagezip +imagezip: imagezip.o version.o $(FSOBJS) $(FSLIBS) + $(CC) $(CFLAGS) imagezip.o version.o $(FSOBJS) $(FSLIBS) $(LIBS) -o imagezip imageunzip: imageunzip.o crc.o version.o $(CC) $(CFLAGS) imageunzip.o crc.o version.o $(UNZIPLIBS) -o imageunzip @@ -62,6 +68,11 @@ imagedump: imagedump.o version.o version.c: imagezip.c imageunzip.c imagedump.c echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";" +ntfs/libntfs/libntfs.a: + (cd ntfs/libntfs; make -f Makefile-linux.sa) + +ntfs/ntfs_glue.o: ntfs/libntfs/libntfs.a + install: $(INSTALL) imagezip $(DESTDIR)$(BINDIR)/imagezip $(INSTALL) imageunzip $(DESTDIR)$(BINDIR)/imageunzip diff --git a/os/imagezip/ntfs/libntfs/Makefile-linux.sa b/os/imagezip/ntfs/libntfs/Makefile-linux.sa new file mode 100644 index 0000000000000000000000000000000000000000..9a974b3800c4ae8dbb078fc48dff932593dedbaa --- /dev/null +++ b/os/imagezip/ntfs/libntfs/Makefile-linux.sa @@ -0,0 +1,45 @@ +# +# EMULAB-COPYRIGHT +# Copyright (c) 2000-2005 University of Utah and the Flux Group. +# All rights reserved. +# + +all: libntfs.a + +NTFSDIR = ntfsprogs-1.7.1.linux +INCLUDES = -I${NTFSDIR}/include +CFLAGS = -O2 -g -static -Wall $(INCLUDES) + +OBJS= attrib.o \ + bitmap.o \ + bootsect.o \ + compat.o \ + debug.o \ + dir.o \ + disk_io.o \ + inode.o \ + lcnalloc.o \ + mft.o \ + mst.o \ + runlist.o \ + unistr.o \ + volume.o + +%.o: $(NTFSDIR)/libntfs/%.c + $(CC) $(CFLAGS) -c -o $@ $< + +libntfs.a: configureit $(OBJS) + ar crv $@ $(OBJS) + ranlib $@ + +configureit: + wget -q -N http://www.emulab.net/ntfsprogs-1.7.1.tar.gz + tar zxf ntfsprogs-1.7.1.tar.gz + mv ntfsprogs-1.7.1 $(NTFSDIR) + patch -sN -d $(NTFSDIR) -p1 < ntfs.linuxpatch + $(NTFSDIR)/configure + mv config.h $(NTFSDIR)/include + touch configureit + +clean: + rm -f $(OBJS) libntfs.a