btrfs-progs: mkfs: precreate the uuid tree
[platform/upstream/btrfs-progs.git] / INSTALL
1 Installation instructions
2 =========================
3
4 The Btrfs utility programs require the following libraries/tools to build:
5
6 - libuuid - provided by util-linux, e2fsprogs/e2fslibs or libuuid
7 - libblkid - block device id library
8 - liblzo2 - LZO data compression library
9 - zlib - ZLIB data compression library
10 - libzstd - ZSTD data compression library version >= 1.0.0
11
12 For the btrfs-convert utility:
13
14 - e2fsprogs - ext2/ext3/ext4 file system libraries, or called e2fslibs
15 - libreiserfscore - reiserfs file system library version >= 3.6.27
16
17 Generating documentation:
18
19 - asciidoc - text document format tool
20 - xmlto - text document format tool
21
22 XATTR library should be provided by the standard C library or by
23
24 - libattr - extended attribute library
25
26 Please note that the package names may differ according to the distribution.
27 See https://btrfs.wiki.kernel.org/index.php/Btrfs_source_repositories#Dependencies .
28
29
30 Building from sources
31 ---------------------
32
33 To build from git sources you need to generate the configure script using the
34 autotools:
35
36     $ ./autogen.sh
37
38 To build from the released tarballs:
39
40     $ ./configure
41     $ make
42     $ make install
43
44 To install the libbtrfsutil Python bindings:
45
46     $ make install_python
47
48 You may disable building some parts like documentation, btrfs-convert or
49 backtrace support. See ./configure --help for more.
50
51 Specific CFLAGS or LDFLAGS should be set like
52
53     $ CFLAGS=... LDFLAGS=... ./configure --prefix=/usr
54
55 and not as arguments to make. You can specify additional flags to build via
56 variables EXTRA_CFLAGS and EXTRA_LDFLAGS that get appended to the predefined
57 values of the respective variables. There are further build tuning options
58 documented in the Makefile.
59
60     $ make EXTRA_CFLAGS=-ggdb3
61
62 The build utilizes autotools, dependencies for generating the configure
63 scripts are:
64
65 * autconf, autoheader
66 * automake, aclocal
67 * pkg-config
68
69
70 Statically built binaries
71 -------------------------
72
73 The makefiles are ready to let you build static binaries of the utilities. This
74 may be handy in rescue environments. Your system has to provide static version
75 of the libraries.
76
77     $ make static
78     $ make btrfs.static
79     $ make btrfs-convert.static
80
81 The resulting binaries have the '.static' suffix, the intermediate object
82 files do not conflict with the normal (dynamic) build.
83
84
85 References:
86 * https://btrfs.wiki.kernel.org