summaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAge
* btrfs-progs: add prerequisite btrfs-convert for test-miscGu Jinxiang2018-02-13
| | | | | | | | Since tests/misc-tests/005-convert-progress-thread-crash/test.sh need the btrfs-convert for prerequisite. So add the dependency in Makefile. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add prerequisite btrfs-image for test-fuzzGu Jinxiang2018-02-13
| | | | | | | | Since tests/fuzz-tests/002-simple-image/test.sh need the btrfs-image for prerequisite. So add the dependency in Makefile. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add prerequisite mkfs.btrfs for test-cliGu Jinxiang2018-02-13
| | | | | | | | | Since tests/cli-tests/002-balance-full-no-filters/test.sh need the mkfs.btrfs for prerequisite. So add the dependency in Makefile. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: rename files after moving codeDavid Sterba2018-02-02
| | | | | | Add prefixes to the files so it's clear they belong to the mode group. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: Move lowmem check code to its own check/lowmem.[ch]Qu Wenruo2018-02-02
| | | | | | | | | | | | | Since lowmem mode code is highly internally connected, it's pretty hard to move them piece by piece. In theory it's possible to move part of the functions and temporarily export them, but it will just cause extra temporarily modifications. So this patch moves the whole lowmem check part into its own check/lowmem.[ch]. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: Move count_csum_range function to check/common.cQu Wenruo2018-02-02
| | | | | | | | | | | | Despite of moving it to check/common.c, also: 1) Add extra comment of the function 2) Change @root parameter to @fs_info Since @root is never used, csum_root is picked from fs_info anyway. Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Move cmds-check.c to check/main.cQu Wenruo2018-02-02
| | | | | | Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: simplify version trackingDavid Sterba2018-01-31
| | | | | | | | | | | | There will be a plain file tracking the last released version. The rest will be simplified to print it where needed. The version augmented by the current git status was not working anyway since we've switched to autoconf. The result of version.h with the potential git status was generated at configure time, which does not mean it's accurate regarding the git status. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: Remove unused variable TESTSGu Jinxiang2018-01-08
| | | | | | | Variable is never used. Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Fix progs_extra build dependenciesHans van Kranenburg2018-01-08
| | | | | | | | | | | | | The Makefile does not have a dependency path that builds dependencies for tools listed in progs_extra. E.g. doing make btrfs-show-super in a clean build environment results in: gcc: error: cmds-inspect-dump-super.o: No such file or directory Makefile:389: recipe for target 'btrfs-show-super' failed Signed-off-by: Hans van Kranenburg <hans@knorrie.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: move image creation of rootdir to its own filesQu Wenruo2018-01-08
| | | | | | | | | | | | In fact, --rootdir option is getting more and more independent from normal mkfs code. So move image creation function, make_image() and its related code to mkfs/rootdir.[ch], and rename the function to btrfs_mkfs_fill_dir(). Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: image: move sanitization to new fileDavid Sterba2017-11-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: use variables for btrfs-image imagesDavid Sterba2017-11-14
| | | | | | More separate sources will be created for btrfs-image. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: set include path relativelyNaohiro Aota2017-10-13
| | | | | | | | | | | | | | | | | | | | Currently, gcc is passed the include directory with full path. As a result, dependency files (*.o.d) also record the full path at the build time. Such full path dependency is annoying for sharing the source between multiple machines, containers, or anything the path differ. And this is the same way what other program using autotools e.g. e2fsprogs is doing: $ grep top_builddir Makefile top_builddir = . CPPFLAGS = -I. -I$(top_builddir)/lib -I$(top_srcdir)/lib BUILD_CFLAGS = -g -O2 -I. -I$(top_builddir)/lib -I$(top_srcdir)/lib -DHAVE_CONFIG_H <snip> Signed-off-by: Naohiro Aota <naota@elisp.net> [ set TOPDIR=. instead of -I as discussed, does not harm linker ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: add absolute path for topdirDavid Sterba2017-10-13
| | | | | | | We'll need TOPDIR to be ./ but library-test is intentionally built outside of the git repository so we need to make them separate. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: add more sparse warning checksDavid Sterba2017-09-25
| | | | | | | - declarations after statements (style issue) - bitfields without defined signedness Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: use -std=gnu89 for sparseDavid Sterba2017-09-25
| | | | | | | Sparse does not seem to support gnu90 that we'd like to keep for the regular build. Use gnu89 for C=1 build. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: add missing defines for the C=1 buildDavid Sterba2017-09-25
| | | | | | | | Sparse complains that BTRFSCONVERT_EXT2 and _RESIERFS are not defined. The per-target options are missing from the default CFLAGS and only added in the specific rule. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: omit unnecessary -MD flagNaohiro Aota2017-09-25
| | | | | | | | | | | According to gcc(1), "-MD is equivalent to -M -MF file, except that -E is not implied." Since the rule in the Makefile is just generating dependency file and not building object file, it is no use to have "-MD" here. Also, it's overridden and conflicting with the following "-MM" flag. I guess we can drop it. Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: generate all dependency filesNaohiro Aota2017-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're missing several dependency files like: $ diff -u <(find -name '*.o'|cut -d. -f2|sort) <(find -name '*.o.d'|cut -d. -f2|sort) @@ -3,7 +3,6 @@ /btrfs-corrupt-block /btrfs-debug-tree /btrfs-find-root -/btrfs-list /btrfs-map-logical /btrfs-select-super /btrfstune @@ -29,11 +28,6 @@ /cmds-scrub /cmds-send /cmds-subvolume -/convert/common -/convert/main -/convert/source-ext2 -/convert/source-fs -/convert/source-reiserfs /ctree /dir-item /disk-io <snip> This is due to moving things out of objects and cmds_objects variables. Such missing dependency files cause mis-building of some source files (try touch utils.h; make mkfs/main.o). This patch introduce a new variable "all_objects" to keep all the objects and use the variable to generate proper dependency file building rules. Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: whitespace adjustment of [LD] fssumDavid Sterba2017-09-25
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Add zstd supportNick Terrell2017-09-25
| | | | | | | | | | | | | | | | Adds zstd support to the btrfs program. An optional dependency on libzstd >= 1.0.0 is added. Autoconf accepts `--enable-zstd' or `--disable-zstd' and defaults to detecting if libzstd is present using `pkg-config'. The patch is also available in my fork of btrfs-progs [1], which passes Travis-CI with the new tests. The prebuilt binary is available there. I haven't updated Android.mk. [1] https://github.com/terrelln/btrfs-progs/tree/devel Signed-off-by: Nick Terrell <terrelln@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move transaction implementation out of headerDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: fix asan and ubsan buildDavid Sterba2017-09-08
| | | | | | | Probably with a new gcc (7.1.1) I started to see asan/ubsan link failures. Fixed by explicitly linking the libraries. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: fix building libbtrfs.so with tsanDavid Sterba2017-09-08
| | | | | | | | | | | | Except libbtrfs.so object, all other tools compile fine. The error is: ld: send-stream.o: relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC Compiling with -fPIC fixes the problem. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: properly pass the LDFLAGS during tsan buildDavid Sterba2017-09-08
| | | | | | | The variable LD_FLAGS does not exist and the flags are not used, we need to use the newly added internal debugging linker flags. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: add internal LDFLAGS for the D= featuresDavid Sterba2017-09-08
| | | | | | | We might want to pass additional linker flags for various sanitization features. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: fix PIE buildDavid Sterba2017-09-08
| | | | | | | Patch from Marcus Meissner <meissner@suse.com>. The CFLAGS are passed to the linker and mix up the compilation and linker flags for PIE support. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: add support for converting reiserfsJeff Mahoney2017-09-08
| | | | | | | | | | | | | This patch adds support to convert reiserfs file systems in-place to btrfs. It will convert extended attribute files to btrfs extended attributes, translate ACLs, coalesce tails that consist of multiple items into one item, and convert tails that are too big into indirect files. This requires that libreiserfscore 3.6.27 be available. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Specify C standard to gnu90 explicitlyQu Wenruo2017-08-24
| | | | | | | | | | | | | | | | | | Different C compilers have different default language standard. This sometimes causes problem on different system. For distribution like CentOS/RHEL7, its gcc is still 4.8 and will report error for c90 style declaration, while most developers are using newer gcc which will just ignore it. This makes us hard to detect such language standard problem. This patch will specify standard to gnu90 explicitly to avoid such problem. Gnu90 is a good mix of c90 while provide a lot of useful gnu extension, and is supported by all modern gcc and clang. Reported-by: Marco Lorenzo Crociani <marcoc@prismatelecomtesting.com> Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: do not regenerate kernel-lib/tables.cDavid Sterba2017-08-24
| | | | | | | | | As reported in https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg66765.html cross-compilation does not work very well with current tables.c. We can simpy keep the pergenerated file in the repository and update if needed. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: Enable ThreadSanitizer, using D=tsanAdam Buchbinder2017-07-20
| | | | | | | | Tested with clang-3.9. We have to enable PIE, (https://clang.llvm.org/docs/ThreadSanitizer.html) Signed-off-by: Adam Buchbinder <abuchbinder@google.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: Fix missing internal deps in check and misc testsAdam Buchbinder2017-07-20
| | | | | | | | | Doing a straight 'make test' would fail because some misc and fsck tests require particular tools to already be built. Add dependencies at the Makefile and shell-script level. Signed-off-by: Adam Buchbinder <abuchbinder@google.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: raid56: Allow raid6 to recover 2 data stripesQu Wenruo2017-07-03
| | | | | | | | | | Copied from kernel lib/raid6/recov.c raid6_2data_recov_intx1() function. With the following modification: - Rename to raid6_recov_data2() for shorter name - s/kfree/free/g modification Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: raid56: Introduce tables for RAID6 recoveryQu Wenruo2017-07-03
| | | | | | | | | | | | | | | | | Use kernel RAID6 galois tables for later RAID6 recovery. Galois tables file, kernel-lib/tables.c is generated by user space program, mktable. Galois field tables declaration, in kernel-lib/raid56.h, is completely copied from kernel. The mktables.c is copied from kernel with minor header/macro modification, to ensure the generated tables.c works well in btrfs-progs. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: raid56: Introduce raid56 header for later recovery usageQu Wenruo2017-07-03
| | | | | | | | | | | | | | | Introduce a new header, kernel-lib/raid56.h, for later raid56 works. It contains 2 functions, from original btrfs-progs code: void raid6_gen_syndrome(int disks, size_t bytes, void **ptrs); int raid5_gen_result(int nr_devs, size_t stripe_len, int dest, void **data); Will be expanded later and some part of it(RAID6 recover part) may keep sync with kernel later. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ unify gpl header, rename header macro ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fix missing __error symbol in libbtrfs.so.0Sergei Trofimovich2017-03-31
| | | | | | | | | | | | | | | | | | | | | | | | | The easiest way to reproduce the error is to try to build btrfs-progs with $ make LDFLAGS=-Wl,--no-undefined btrfs-list.o: In function `lookup_ino_path': btrfs-list.c:(.text+0x7d2): undefined reference to `__error' Noticed by Denis Descheneaux when snapper tool stopped working after upgrade to btrfs-progs-4.10. As soname didn't change in 4.9 -> 4.10 release I assume it's just an object file omission in library depends and not the API/ABI change of the library error printing. Cc: linux-btrfs@vger.kernel.org Cc: Mike Gilbert <floppym@gentoo.org> Reported-by: Denis Descheneaux Bug: https://bugs.gentoo.org/show_bug.cgi?id=613890 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Cleanup kernel-shared dir when execute make cleanQu Wenruo2017-03-31
| | | | | | Reported-by: Chris <coderight@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: misc/019, use fssumDavid Sterba2017-03-16
| | | | | | The fssum utility is now ready to use, test still passes. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, switch from MD5 to SHA256David Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, drop unnecessray build definesDavid Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add fssum utilityDavid Sterba2017-03-16
| | | | | | | | | | Copy from fstests, originally from git://git.kernel.org/pub/scm/linux/kernel/git/arne/far-progs.git Needs libcrypto to link but this check is now missing in configure. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: library-test: update test to build outside of topdirDavid Sterba2017-03-16
| | | | | | | | | | | | We need to build outside of the topdir so we can use the "btrfs/" prefix for includes and not accidentally include other files. Make magic is simple: - build dependencies inside TOPDIR - build inside temporary directory, link back to TOPDIR - library-test.o not built anymore obviously Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: library: distribute sizes.h, fix buildDavid Sterba2017-03-16
| | | | | | | | | | | | | The patch "btrfs-progs: Introduce kernel sizes to cleanup large intermediate number" (a2203246ae483d09) was taken from kernel but not properly ported so the build breaks because the header linux/sizes.h is not exported. The build tests of library do not cover the case when the macro BTRFS_FLAT_INCLUDES is not defined (ie. an external build). Reported-by: Holger Hoffstätte <holger@applied-asynchrony.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix library-test rules and depsDavid Sterba2017-03-08
| | | | | | | The symbol __error was undefined and the rule did not use the dependencies from the rule definiton, like the rest. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move ulist.[ch] to kernel-sharedDavid Sterba2017-03-08
| | | | | | | The implementation of ulist_* is same for kernel and userspace, without dependencies, so we can keep it separately for code sync. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move message helpers implementation out of headerDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: use MAKEOPTS where missingDavid Sterba2017-03-08
| | | | | | $(MAKE) should also use MAKEOPTS. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: drop deprecated utility from test dependenciesDavid Sterba2017-03-08
| | | | | | | Standalone btrfs-debug-tree has been superseded by 'btrfs inspect-internal dump-tree'. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move mkfs helper implementation out of utilsDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>