1 # Copyright (C) 2001 Cluster File Systems, Inc.
3 # This code is issued under the GNU General Public License.
4 # See the file COPYING in this distribution
11 # NOTE: if you are not using a RedHat 12.5 or later kernel, then you need to
12 # apply the following patch first, as it fixes a number of bugs in ext3.
13 # EXTNP = ext3-2.4.18-fixes.diff
14 EXTNP+= htree-ext3-2.4.18.diff linux-2.4.18ea-0.8.26.diff
15 EXTNP+= ext3-2.4.18-ino_sb_macro.diff extN-misc-fixup.diff
16 EXTNC = balloc.c bitmap.c dir.c file.c fsync.c ialloc.c inode.c ioctl.c
17 EXTNC+= namei.c super.c symlink.c
18 EXTNI = extN_fs.h extN_fs_i.h extN_fs_sb.h extN_jbd.h
19 EXTN_EXTRA = include/linux/xattr.h include/linux/extN_xattr.h fs/extN/xattr.c fs/extN/hash.c include/linux/extN_fs.h
20 extN_SOURCES = $(EXTNC) xattr.c # punch.c
21 extN_DEPENDENCIES = patch-stamp
22 EXTRA_DIST = $(EXTNP) extN-2.4.18-ino_sb_fixup.diff extN-2.4.18-exports.diff
23 DISTCLEANFILES = $(extN_SOURCES) patch-stamp *.orig *.rej
24 SUB=-e "s/ext3/extN/g" -e "s/EXT3/EXTN/g"
26 include $(top_srcdir)/Rules
28 # Create a fresh ext2 patch.
31 for f in $(EXTNC); do diff -u $(top_srcdir)/fs/extN/$$f $$f >> extN.patchT ; done
32 mv -f ext2.patchT $(srcdir)/ext2.patch-$(RELEASE)
35 # Patch the kernel files with our ext3 patches. We need to go through some
36 # extra hoops because the include files are in a different tree and because
37 # patch likes to make local copies of files with (sym)links when it is patching
38 # them. To avoid this, we copy/patch in the source dir instead of the build
39 # dir (if they are different).
42 test -e $(top_srcdir)/fs || ln -sf . $(top_srcdir)/fs
44 list='$(EXTN_EXTRA)'; for f in $$list; do $(RM) $(top_srcdir)/$$f; done
46 list='$(EXTNC)'; for f in $$list; do \
47 sed $(SUB) $(LINUX)/fs/ext3/$$f > $(top_srcdir)/fs/extN/$$f; \
50 list='$(EXTNI)'; for i in $$list; do \
51 s=`echo $$i | sed "s/extN/ext3/"`; \
52 sed $(SUB) $(LINUX)/include/linux/$$s > \
53 $(top_srcdir)/include/linux/$$i; \
56 if [ -f $(srcdir)/extN.patch-$(RELEASE) ]; then \
57 patch -p0 < $(srcdir)/extN.patch-$(RELEASE); \
59 list='$(EXTNP)'; for p in $$list; do \
60 sed $(SUB) $(srcdir)/$$p|(cd $(top_srcdir);patch -p1)||exit -1;\
62 echo "It is OK if the following patch fails"; \
63 (cd $(top_srcdir); patch -N -p1) < $(srcdir)/extN-2.4.18-exports.diff; \
64 (cd $(top_srcdir); patch -p1) < $(srcdir)/extN-2.4.18-ino_sb_fixup.diff; \
68 $(extN_SOURCES) $(EXTNI) $(EXTN_EXTRA): patch-stamp
70 # Don't distribute any patched files.
72 $(RM) $(top_srcdir)/fs
73 list='$(EXTNC)'; for f in $$list; do $(RM) $(distdir)/$$f; done
74 list='$(EXTNI)'; for i in $$list; do \
75 $(RM) $(distdir)/../include/linux/$$i; \
77 list='$(EXTN_EXTRA)'; for f in $$list; do $(RM) $(distdir)/../$$f; done