1 modulefs_DATA = ldiskfs$(KMODEXT)
3 ldiskfs_linux_headers := $(addprefix linux/,$(subst ext4,ldiskfs,$(notdir $(linux_headers))))
5 $(filter %.c,$(ldiskfs_patched_sources)): sources $(ldiskfs_linux_headers) $(filter %.h,$(ldiskfs_patched_sources))
8 -e "s/dx_hash_info/ext4_dx_hash_info/g" \
9 -e "s/DX_HASH/EXT4_DX_HASH/g" \
10 -e "s/EXT4/LDISKFS/g" -e "s/ext4/ldiskfs/g"
12 %.c: linux-stage/fs/ext4/%.c
13 sed $(strip $(ldiskfs_sed_flags)) $< > $@
15 %.h: linux-stage/fs/ext4/%.h
16 sed $(strip $(ldiskfs_sed_flags)) $< > $@
18 linux/ldiskfs%.h: linux-stage/include/linux/ext4%.h
19 sed $(strip $(ldiskfs_sed_flags)) $< > $@
21 series := @top_srcdir@/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES)
22 patches := @top_srcdir@/kernel_patches/patches
24 sources: $(backfs_sources) $(backfs_headers) $(linux_headers) $(series) $(trace_headers)
25 rm -rf linux-stage linux sources trace $(ldiskfs_SOURCES)
26 mkdir -p linux-stage/fs/ext4 linux-stage/include/linux \
27 linux-stage/include/trace/events
28 cp $(backfs_sources) $(backfs_headers) $(backfs_extra) linux-stage/fs/ext4
29 if test -n "$(linux_headers)" ; then \
30 cp $(linux_headers) linux-stage/include/linux; \
32 if test -n "$(trace_headers)" ; then \
33 cp $(trace_headers) linux-stage/include/trace/events; \
36 ln -s ../$(patches) linux-stage/patches
37 ln -s ../$(series) linux-stage/series
38 cd linux-stage && quilt push -a -q
40 @echo -n "Applying ext4 patches:"
41 @cd linux-stage && for i in $$(<../$(series)) ; do \
43 patch -s -p1 < ../$(patches)/$$i || exit 1 ; \
47 mkdir -p linux trace/events
48 @echo -n "Replacing 'ext4' with 'ldiskfs':"
49 for i in $(notdir $(backfs_headers) $(backfs_sources)) $(new_sources) ; do \
51 sed $(strip $(ldiskfs_sed_flags)) \
52 linux-stage/fs/ext4/$$i > $$i ; \
54 for i in $(subst ext4,,$(notdir $(backfs_headers))) ; do \
55 if test -f "ext4$$i" ; then \
56 echo -n " ext4$$i" ; \
57 mv ext4$$i ldiskfs$$i ; \
60 for i in $(subst ext4,,$(notdir $(linux_headers) $(new_headers))) ; do \
61 echo -n " ext4$$i" ; \
62 sed $(strip $(ldiskfs_sed_flags)) \
63 linux-stage/include/linux/ext4$$i \
64 > linux/ldiskfs$$i ; \
66 for i in $(subst ext4,,$(notdir $(trace_headers))) ; do \
68 sed $(strip $(ldiskfs_sed_flags)) \
69 linux-stage/include/trace/events/ext4$$i \
70 > trace/events/ldiskfs$$i ; \
72 for i in $(notdir $(linux_new_headers)) ; do \
74 sed $(strip $(ldiskfs_sed_flags)) \
75 linux-stage/include/linux/$$i \
83 @echo "ldiskfs_sources: $(ldiskfs_sources)"
84 @echo "ldiskfs_SOURCES: $(ldiskfs_SOURCES)"
85 @echo "ldiskfs_headers: $(ldiskfs_headers)"
86 @echo "ldiskfs_objects: $(ldiskfs_objects)"
87 @echo "ldiskfs_OBJECTS: $(ldiskfs_OBJECTS)"
88 @echo "ldiskfs_LDADD: $(ldiskfs_LDADD)"
90 MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
91 CLEANFILES = sources $(notdir $(linux_new_headers) $(linux_headers) $(backfs_headers) $(backfs_sources) $(new_sources) $(new_headers) $(trace_headers))
94 rm -rf linux linux-stage ldiskfs*.h trace