summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-08-28 18:00:50 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2016-08-28 18:00:54 -0800
commitbca2b16e55bb1f5ac1894b97332d8b637c941123 (patch)
treefb34a88774664434d99b91db24e150114e7a7519
parent97de91cb580a2e31352860dfc0642579d21d3b7a (diff)
Documentation/makefile work
-rw-r--r--INSTALL14
-rw-r--r--Makefile25
-rw-r--r--README33
-rw-r--r--bcache.874
-rw-r--r--debian/control3
-rwxr-xr-xdebian/rules3
-rwxr-xr-xmkfs.bcache3
7 files changed, 82 insertions, 73 deletions
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..ea21297
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,14 @@
+
+Dependencies:
+
+ * libblkid
+ * libuuid
+ * libnih
+ * libscrypt
+ * libsodium
+ * libkeyutils
+
+On debian, you can install these with
+ apt install -y libblkid-dev uuid-dev libnih-dev libscrypt-dev libsodium-dev libkeyutils-dev
+
+Then, just make && make install
diff --git a/Makefile b/Makefile
index facdf68..9f2773e 100644
--- a/Makefile
+++ b/Makefile
@@ -8,21 +8,15 @@ PKGCONFIG_LIBS="blkid uuid libnih"
CFLAGS+=`pkg-config --cflags ${PKGCONFIG_LIBS}`
LDLIBS+=`pkg-config --libs ${PKGCONFIG_LIBS}` -lscrypt -lsodium -lkeyutils
-ifeq ($(PREFIX), "/usr")
+ifeq ($(PREFIX),/usr)
ROOT_SBINDIR=/sbin
else
ROOT_SBINDIR=$(PREFIX)/sbin
endif
+.PHONY: all
all: bcache
-install: bcache
- $(INSTALL) -m0755 bcache $(DESTDIR)$(ROOT_SBINDIR)
- $(INSTALL) -m0644 -- bcache.8 $(DESTDIR)$(PREFIX)/share/man/man8/
-
-clean:
- $(RM) bcache *.o *.a
-
CCANSRCS=$(wildcard ccan/*/*.c)
CCANOBJS=$(patsubst %.c,%.o,$(CCANSRCS))
@@ -34,5 +28,18 @@ bcache-objs = bcache.o bcache-assemble.o bcache-device.o bcache-format.o\
bcache: $(bcache-objs) libccan.a
-deb:
+.PHONY: install
+install: bcache
+ mkdir -p $(DESTDIR)$(ROOT_SBINDIR)
+ mkdir -p $(DESTDIR)$(PREFIX)/share/man/man8/
+ $(INSTALL) -m0755 bcache $(DESTDIR)$(ROOT_SBINDIR)
+ $(INSTALL) -m0755 mkfs.bcache $(DESTDIR)$(ROOT_SBINDIR)
+ $(INSTALL) -m0644 bcache.8 $(DESTDIR)$(PREFIX)/share/man/man8/
+
+.PHONY: clean
+clean:
+ $(RM) bcache *.o *.a
+
+.PHONY: deb
+deb: all
debuild -nc -us -uc -i -I
diff --git a/README b/README
index 4a13db6..56a26b0 100644
--- a/README
+++ b/README
@@ -1,27 +1,12 @@
-These are the userspace tools required for bcache.
+Userspace tools for bcache-dev/bcachefs
-Bcache is a patch for the Linux kernel to use SSDs to cache other block
-devices. For more information, see http://bcache.evilpiepirate.org.
-Documentation for the run time interface is included in the kernel tree, in
-Documentantion/bcache.txt.
+This builds the bcache tool, which has a number of subcommands for formatting
+and managing bcachefs filesystems:
-Included tools:
+bcache format
+bcache unlock
+bcache assemble
+bcache incremental
+etc.
-make-bcache
-Formats a block device for use with bcache. A device can be formatted for use
-as a cache or as a backing device (requires yet to be implemented kernel
-support). The most important option is for specifying the bucket size.
-Allocation is done in terms of buckets, and cache hits are counted per bucket;
-thus a smaller bucket size will give better cache utilization, but poorer write
-performance. The bucket size is intended to be equal to the size of your SSD's
-erase blocks, which seems to be 128k-512k for most SSDs; feel free to
-experiment.
-
-probe-bcache
-Only necessary until support for the bcache superblock is included
-in blkid; in the meantime, provides just enough functionality for a udev script
-to create the /dev/disk/by-uuid symlink. The arguments it does support are the
-same as for blkid.
-
-bcache-super-show
-Prints the bcache superblock of a cache device or a backing device.
+Run bcache --help for full list of commands.
diff --git a/bcache.8 b/bcache.8
index 52c5fe7..7671cf3 100644
--- a/bcache.8
+++ b/bcache.8
@@ -1,9 +1,9 @@
-.TH bcacheadm 8
+.TH bcache 8
.SH NAME
-bcacheadm \- manage bcache devices
+bcache \- manage bcache filesystems/devices
.SH SYNOPSIS
-.B bcacheadm
+.B bcache
[\fIoptions\fR]
.B COMMAND
[\fIoptions\fR]
@@ -51,61 +51,63 @@ to create the /dev/disk/by-uuid symlink.
.BR help
.RS
-List the bcacheadm commands
+List the bcache commands
.RE
.SH OPTIONS
-.SH Options for bcacheadm
+.SH Options for bcache
.TP
.BR \--help
.SH Options for format
+.SH Global options:
.TP
-.BR \-C
-Create a cache
+.BR \-w,\ --block=
+block size, in bytes (e.g. 4k)
.TP
-.BR \-B
-Create a backing device
+.BR \-w,\ --btree_node_size=
+btree node size in bytes - default 256k
.TP
-.BR \-b\ --bucket-size=
-Specifies the bucket size.
+.BR \--metadata_checksum_type=TYPE
.TP
-.BR \-l\ --label=
-label
+.BR \--data_checksum_type=TYPE
+where TYPE is one of none, crc32c (default), or crc64
.TP
-.BR \-w,\ --block=
-block size (hard sector size of SSD, often 2k
+.BR \--compression_type=TYPE
+where TYPE is one of none (default), lz4 or gzip
.TP
-.BR \-t,\ --tier=
-tier of subsequent devices
+.BR \--encrypted
+Enable encryption; passphrase will be prompted for
.TP
-.BR \--cache-replacement-policy=
-one of lru, fifo, or random
+.BR \--error_action=TYPE
+where TYPE is one of continue, readonly (default) or panic
.TP
-.BR \-o,\ --data_offset=
-data offset in sectors
+.BR \-l\ --label=LABEL
+Create the filesystem with the specified label
.TP
-.BR \--cset-uuid=
-Create a cache device with the specified UUID
+.BR \--uuid=UUID
+Create the filesystem with the specified UUID
.TP
-.BR \--csum_type=
-One of none, csc32c, or csc64
+.BR \--force
+Force the filesystem to be created, even if the device already contains a
+filesystem
+
+.SH Options that apply to subsequent devices:
.TP
-.BR \--meta-replicas=
-Number of metadata replicas
+.BR \--fs_size=SIZE
+Create the filesystem using SIZE bytes on the subsequent device
.TP
-.BR \--data-replicas=
-Number of data replicas
+.BR \-b\ --bucket-size=SIZE
+Specifies the bucket size - must be greater than the btree node size
.TP
-.BR \--wipe-bcache
-Destroy existing bcache data if present
+.BR \-t,\ --tier=INDEX
+Specifies the tier of subsequent devices, where INDEX is a small integer and a
+smaller index indicates a faster tier - tier 0 being the fastest. Currently only
+two tiers are supported.
.TP
.BR \--discard
-Enable discards
-.TP
-.BR \--writeback
-Enable writeback
+Enable discards on subsequent devices
.SH Options for register
@@ -117,7 +119,7 @@ Provide a directory other than /sys/fs/bcache
.SH Options for query-devs
.TP
.BR \-f,\ --force-csum
-Enables bcacheadm to going even if the superblock crc is invalid
+Enables bcache to going even if the superblock crc is invalid
.SH Options for status
diff --git a/debian/control b/debian/control
index 4a138f6..3e9b294 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,8 @@ Uploaders: Robie Basak <robie@justgohome.co.uk>
Section: utils
Priority: optional
Standards-Version: 3.9.5
-Build-Depends: debhelper (>= 9), pkg-config, uuid-dev, libblkid-dev
+Build-Depends: debhelper (>= 9), pkg-config, libblkid-dev, uuid-dev, libnih-dev,
+ libscrypt-dev, libsodium-dev, libkeyutils-dev
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/bcache-tools.git
Vcs-Git: git://anonscm.debian.org/collab-maint/bcache-tools.git
Homepage: http://bcache.evilpiepirate.org/
diff --git a/debian/rules b/debian/rules
index 61f3011..4f2c774 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,6 +2,3 @@
%:
dh $@
-override_dh_auto_install:
- dh_auto_install -- DRACUTLIBDIR=/usr/lib/dracut
-
diff --git a/mkfs.bcache b/mkfs.bcache
new file mode 100755
index 0000000..411c151
--- /dev/null
+++ b/mkfs.bcache
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec bcache format "$@"