X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=INSTALL;h=24d6e24f71b5e26eda7af0cc52c364206cdbff6d;hb=6cedd688115d85e6f14a43f7653378749ef31624;hp=e83ff6e8c8d590d6b051bf1ab162a8f0e026828d;hpb=65a545ff84b1b066616724fea95747edc4130111;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/INSTALL b/INSTALL index e83ff6e..24d6e24 100644 --- a/INSTALL +++ b/INSTALL @@ -1,51 +1,86 @@ -Install Instructions +Installation instructions +========================= -Btrfs puts snapshots and subvolumes into the root directory of the FS. This -directory can only be changed by btrfsctl right now, and normal filesystem -operations do not work on it. The default subvolume is called 'default', -and you can create files and directories in mount_point/default +The Btrfs utility programs require the following libraries/tools to build: -Btrfs uses the crypto manager interface in the kernel for file and -metadata checksums. You need to compile the kernel with: +- 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 -CONFIG_CRYPTO=y -CONFIG_CRYPTO_MANAGER=m -CONFIG_CRYPTO_CRC32C=m +For the btrfs-convert utility: -cryptomanager and crc32c 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: +- e2fsprogs - ext2/ext3/ext4 file system libraries, or called e2fslibs +- libreiserfscore - reiserfs file system library version >= 3.6.27 -modprobe crc32c -modprobe cryptomgr -insmod btrfs.ko +Generating documentation: -The Btrfs utility programs require libuuid to build. This can be found -in the e2fsprogs sources, and is usually available as libuuid or -e2fsprogs-devel from various distros. +- asciidoc - text document format tool +- xmlto - text document format tool -Building the utilities is just make ; make install. The programs go -into /usr/local/bin. The commands available are: +XATTR library should be provided by the standard C library or by -mkfs.btrfs: create a filesystem +- libattr - extended attribute library -btrfsctl: control program to create snapshots and subvolumes: +Please note that the package names may differ according to the distribution. +See https://btrfs.wiki.kernel.org/index.php/Btrfs_source_repositories#Dependencies . - mount /dev/sda2 /mnt - btrfsctl -s new_subvol_name /mnt - btrfsctl -s snapshot_of_default /mnt/default - btrfsctl -s snapshot_of_new_subvol /mnt/new_subvol_name - btrfsctl -s snapshot_of_a_snapshot /mnt/snapshot_of_new_subvol - ls /mnt - default snapshot_of_a_snapshot snapshot_of_new_subvol - new_subvol_name snapshot_of_default - Snapshots and subvolumes cannot be deleted right now, but you can - rm -rf all the files and directories inside them. +Building from sources +--------------------- -btrfsck: do a limited check of the FS extent trees. +To build from git sources you need to generate the configure script using the +autotools: -debug-tree: print all of the FS metadata in text form. Example: + $ ./autogen.sh - debug-tree /dev/sda2 >& big_output_file +To build from the released tarballs: + $ ./configure + $ make + $ make install + +To install the libbtrfsutil Python bindings: + + $ make install_python + +You may disable building some parts like documentation, btrfs-convert or +backtrace support. See ./configure --help for more. + +Specific CFLAGS or LDFLAGS should be set like + + $ CFLAGS=... LDFLAGS=... ./configure --prefix=/usr + +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. + + $ make EXTRA_CFLAGS=-ggdb3 + +The build utilizes autotools, dependencies for generating the configure +scripts are: + +* autconf, autoheader +* automake, aclocal +* pkg-config + + +Statically built binaries +------------------------- + +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. + + $ 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