X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=INSTALL;h=24d6e24f71b5e26eda7af0cc52c364206cdbff6d;hb=df9158f20d8950b996a3e9b5a4ac0f9b2ea034d3;hp=9a4ab649150548796b785f7d198c95c0db682ab6;hpb=7bf6343fa17f1dc37216a88f92a50127eaff514b;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/INSTALL b/INSTALL index 9a4ab64..24d6e24 100644 --- a/INSTALL +++ b/INSTALL @@ -1,61 +1,86 @@ -Install Instructions +Installation instructions +========================= -Btrfs uses libcrc32c in the kernel for file and metadata checksums. You need -to compile the kernel with: +The Btrfs utility programs require the following libraries/tools to build: -CONFIG_LIBCRC32C=m +- libuuid - provided by util-linux, e2fsprogs/e2fslibs or libuuid +- libblkid - block device id library +- liblzo2 - LZO data compression library +- zlib - ZLIB data compression library +- libzstd - ZSTD data compression library version >= 1.0.0 -libcrc32c can be static as well. Once your kernel is setup, typing make in the -btrfs module sources will build against the running kernel. When the build is -complete: +For the btrfs-convert utility: -modprobe libcrc32c -insmod btrfs.ko +- e2fsprogs - ext2/ext3/ext4 file system libraries, or called e2fslibs +- libreiserfscore - reiserfs file system library version >= 3.6.27 -The Btrfs utility programs require the following libraries/tools to build: +Generating documentation: + +- asciidoc - text document format tool +- xmlto - text document format tool + +XATTR library should be provided by the standard C library or by + +- libattr - extended attribute library + +Please note that the package names may differ according to the distribution. +See https://btrfs.wiki.kernel.org/index.php/Btrfs_source_repositories#Dependencies . + + +Building from sources +--------------------- + +To build from git sources you need to generate the configure script using the +autotools: + + $ ./autogen.sh + +To build from the released tarballs: + + $ ./configure + $ make + $ make install + +To install the libbtrfsutil Python bindings: -- libuuid (This can be found in the e2fsprogs sources, and is usually available - as libuuid or e2fsprogs-devel from various distros). -- libattr (Extended attribute library - Development files) -- libblkid (Block device id library - Development files) -- liblzo2 (LZO data compression library - Development files) -- libacl (Access control list library - Development files) -- e2fslibs (ext2/ext3/ext4 file system libraries - Development files) -- asciidoc (Text document format tool - For documentation) + $ make install_python -Building the utilities is just make ; make install. The programs go -into /usr/local/bin. The mains commands available are: +You may disable building some parts like documentation, btrfs-convert or +backtrace support. See ./configure --help for more. -mkfs.btrfs: create a filesystem +Specific CFLAGS or LDFLAGS should be set like -btrfs: control program to create snapshots and subvolumes: - # mount a btrfs filesystem - mount /dev/sda2 /mnt + $ CFLAGS=... LDFLAGS=... ./configure --prefix=/usr - # create a subvolume - btrfs subvolume create /mnt/new_subvol_name +and not as arguments to make. You can specify additional flags to build via +variables EXTRA_CFLAGS and EXTRA_LDFLAGS that get appended to the predefined +values of the respective variables. There are further build tuning options +documented in the Makefile. - # snapshot of a subvolume - btrfs subvolume snapshot /mnt/default /mnt/snapshot_of_default - btrfs subvolume snapshot /mnt/snapshot_of_default \ - /mnt/snapshot_of_a_snapshot + $ make EXTRA_CFLAGS=-ggdb3 - # list of the subvolumes - ls /mnt - default snapshot_of_a_snapshot snapshot_of_new_subvol - new_subvol_name snapshot_of_default +The build utilizes autotools, dependencies for generating the configure +scripts are: - # removal of a subvolume or a snapshot - btrfs subvolume delete /mn/snapshot_of_a_snapshot +* autconf, autoheader +* automake, aclocal +* pkg-config - # look a the btrfs man page for further information - man btrfs -btrfsck: do a limited check of the FS extent trees. +Statically built binaries +------------------------- -btrfs-debug-tree: print all of the FS metadata in text form. Example: +The makefiles are ready to let you build static binaries of the utilities. This +may be handy in rescue environments. Your system has to provide static version +of the libraries. - btrfs-debug-tree /dev/sda2 >& big_output_file + $ make static + $ make btrfs.static + $ make btrfs-convert.static +The resulting binaries have the '.static' suffix, the intermediate object +files do not conflict with the normal (dynamic) build. +References: +* https://btrfs.wiki.kernel.org