Kernel
Configuration
Enable the following option in the kernel configuration and
recompile the kernel:
File systems --->
<*/M> Btrfs filesystem support [CONFIG_BTRFS_FS]
Note
CONFIG_BTRFS_FS_POSIX_ACL and CONFIG_REISERFS_FS_XATTR are
required for some tests. Other Btrfs options in the kernel are
optional.
Installation of btrfs-progs
Install btrfs-progs by running the
following commands:
sed -i '40,107 s/\.gz//g' Documentation/Makefile.in &&
./configure --prefix=/usr \
--bindir=/bin \
--libdir=/lib \
--disable-zstd &&
make
Before running tests, build a support program and disable several
that fail:
make fssum &&
sed -i '/found/s/^/: #/' tests/convert-tests.sh &&
mv tests/mkfs-tests/013-reserved-1M-for-single/test.sh{,.broken} &&
mv tests/convert-tests/010-reiserfs-basic/test.sh{,.broken} &&
mv tests/convert-tests/011-reiserfs-delete-all-rollback/test.sh{,.broken} &&
mv tests/convert-tests/012-reiserfs-large-hole-extent/test.sh{,.broken} &&
mv tests/convert-tests/013-reiserfs-common-inode-flags/test.sh{,.broken} &&
mv tests/convert-tests/014-reiserfs-tail-handling/test.sh{,.broken} &&
mv tests/misc-tests/004-shrink-fs/test.sh{,.broken} &&
mv tests/misc-tests/013-subvolume-sync-crash/test.sh{,.broken} &&
mv tests/misc-tests/025-zstd-compression/test.sh{,.broken} &&
mv tests/fuzz-tests/003-multi-check-unmounted/test.sh{,.broken} &&
mv tests/fuzz-tests/009-simple-zero-log/test.sh{,.broken}
To test the results, issue (as the root
user):
pushd tests
./fsck-tests.sh
./mkfs-tests.sh
./cli-tests.sh
./convert-tests.sh
./misc-tests.sh
./fuzz-tests.sh
popd
Install the package as the root
user:
make install &&
ln -sfv ../../lib/$(readlink /lib/libbtrfs.so) /usr/lib/libbtrfs.so &&
ln -sfv ../../lib/$(readlink /lib/libbtrfsutil.so) /usr/lib/libbtrfsutil.so &&
rm -fv /lib/libbtrfs.{a,so} /lib/libbtrfsutil.{a,so} &&
mv -v /bin/{mkfs,fsck}.btrfs /sbin
Command Explanations
sed ...
Documentation/Makefile.in: Disables compressing man
pages to be consistent with the rest of BLFS.
--disable-documentation
: This option is
needed if the recommended dependencies are not installed.
mv
tests/{cli,convert,misc,fuzz}-tests/ ...: Disables
tests that fail and prevent tests from completing.
ln -s ...
/usr/lib/libbtrfs.so: Creates a symbolic link in
the directory where it is expected.
rm
/lib/libbtrfs.{a,so}: Removes unneeded library
entries.