Documentation/makefile work

This commit is contained in:
Kent Overstreet 2016-08-28 18:00:50 -08:00
parent 97de91cb58
commit bca2b16e55
7 changed files with 85 additions and 76 deletions

14
INSTALL Normal file
View File

@ -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

View File

@ -8,21 +8,15 @@ PKGCONFIG_LIBS="blkid uuid libnih"
CFLAGS+=`pkg-config --cflags ${PKGCONFIG_LIBS}` CFLAGS+=`pkg-config --cflags ${PKGCONFIG_LIBS}`
LDLIBS+=`pkg-config --libs ${PKGCONFIG_LIBS}` -lscrypt -lsodium -lkeyutils LDLIBS+=`pkg-config --libs ${PKGCONFIG_LIBS}` -lscrypt -lsodium -lkeyutils
ifeq ($(PREFIX), "/usr") ifeq ($(PREFIX),/usr)
ROOT_SBINDIR=/sbin ROOT_SBINDIR=/sbin
else else
ROOT_SBINDIR=$(PREFIX)/sbin ROOT_SBINDIR=$(PREFIX)/sbin
endif endif
.PHONY: all
all: bcache 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) CCANSRCS=$(wildcard ccan/*/*.c)
CCANOBJS=$(patsubst %.c,%.o,$(CCANSRCS)) 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 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 debuild -nc -us -uc -i -I

33
README
View File

@ -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 This builds the bcache tool, which has a number of subcommands for formatting
devices. For more information, see http://bcache.evilpiepirate.org. and managing bcachefs filesystems:
Documentation for the run time interface is included in the kernel tree, in
Documentantion/bcache.txt.
Included tools: bcache format
bcache unlock
bcache assemble
bcache incremental
etc.
make-bcache Run bcache --help for full list of commands.
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.

View File

@ -1,9 +1,9 @@
.TH bcacheadm 8 .TH bcache 8
.SH NAME .SH NAME
bcacheadm \- manage bcache devices bcache \- manage bcache filesystems/devices
.SH SYNOPSIS .SH SYNOPSIS
.B bcacheadm .B bcache
[\fIoptions\fR] [\fIoptions\fR]
.B COMMAND .B COMMAND
[\fIoptions\fR] [\fIoptions\fR]
@ -51,61 +51,63 @@ to create the /dev/disk/by-uuid symlink.
.BR help .BR help
.RS .RS
List the bcacheadm commands List the bcache commands
.RE .RE
.SH OPTIONS .SH OPTIONS
.SH Options for bcacheadm .SH Options for bcache
.TP .TP
.BR \--help .BR \--help
.SH Options for format .SH Options for format
.TP .SH Global options:
.BR \-C
Create a cache
.TP
.BR \-B
Create a backing device
.TP
.BR \-b\ --bucket-size=
Specifies the bucket size.
.TP
.BR \-l\ --label=
label
.TP .TP
.BR \-w,\ --block= .BR \-w,\ --block=
block size (hard sector size of SSD, often 2k block size, in bytes (e.g. 4k)
.TP .TP
.BR \-t,\ --tier= .BR \-w,\ --btree_node_size=
tier of subsequent devices btree node size in bytes - default 256k
.TP .TP
.BR \--cache-replacement-policy= .BR \--metadata_checksum_type=TYPE
one of lru, fifo, or random
.TP .TP
.BR \-o,\ --data_offset= .BR \--data_checksum_type=TYPE
data offset in sectors where TYPE is one of none, crc32c (default), or crc64
.TP .TP
.BR \--cset-uuid= .BR \--compression_type=TYPE
Create a cache device with the specified UUID where TYPE is one of none (default), lz4 or gzip
.TP .TP
.BR \--csum_type= .BR \--encrypted
One of none, csc32c, or csc64 Enable encryption; passphrase will be prompted for
.TP .TP
.BR \--meta-replicas= .BR \--error_action=TYPE
Number of metadata replicas where TYPE is one of continue, readonly (default) or panic
.TP .TP
.BR \--data-replicas= .BR \-l\ --label=LABEL
Number of data replicas Create the filesystem with the specified label
.TP .TP
.BR \--wipe-bcache .BR \--uuid=UUID
Destroy existing bcache data if present Create the filesystem with the specified UUID
.TP
.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 \--fs_size=SIZE
Create the filesystem using SIZE bytes on the subsequent device
.TP
.BR \-b\ --bucket-size=SIZE
Specifies the bucket size - must be greater than the btree node size
.TP
.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 .TP
.BR \--discard .BR \--discard
Enable discards Enable discards on subsequent devices
.TP
.BR \--writeback
Enable writeback
.SH Options for register .SH Options for register
@ -117,7 +119,7 @@ Provide a directory other than /sys/fs/bcache
.SH Options for query-devs .SH Options for query-devs
.TP .TP
.BR \-f,\ --force-csum .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 .SH Options for status

3
debian/control vendored
View File

@ -4,7 +4,8 @@ Uploaders: Robie Basak <robie@justgohome.co.uk>
Section: utils Section: utils
Priority: optional Priority: optional
Standards-Version: 3.9.5 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-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/bcache-tools.git
Vcs-Git: git://anonscm.debian.org/collab-maint/bcache-tools.git Vcs-Git: git://anonscm.debian.org/collab-maint/bcache-tools.git
Homepage: http://bcache.evilpiepirate.org/ Homepage: http://bcache.evilpiepirate.org/

3
debian/rules vendored
View File

@ -2,6 +2,3 @@
%: %:
dh $@ dh $@
override_dh_auto_install:
dh_auto_install -- DRACUTLIBDIR=/usr/lib/dracut

3
mkfs.bcache Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec bcache format "$@"