thie enables building it in a different directory, more
flexible install and configure options, and should make it
easier to eventualy create deb and rpm packages. Additionally
this makes it much easier to build and test this package
as it now behaves the same way as others we are using.
Move the rule to run a bit later, after
the standard udev rules have called blkid.
Don't run blkid manually, and run probe-bcache
as a fallback which can be patched out in a
package that depends on util-linux 2.24+.
probe-bcache: bail if libblkid finds anything
Preserve our last-resort safety check here
in case earlier rules fail to call blkid.
Fail if the device has any leftover superblock or partition table label.
Add a --wipe-bcache flag to overwrite bcache superblocks and recommend
wipefs for non-bcache superblocks.
Once the device is safe to write, always zero immediately before the
bcache superblock.
Make sure errors go to stderr. Use pkg-config.
As discussed on irc yesterday.
Cheers,
Lars
From 791a4b7b2c25e21ffeb4184da5e61f18cde86246 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars@linbit.com>
Date: Wed, 17 Jul 2013 11:49:12 +0200
Subject: [PATCH] make-bcache: fix guessing of "block_size" to use BLKSSZGET
Using stat.st_blocksize is wrong:
that is the linux buffer cache granularity,
it is tunable, and defaults to 4k.
This caused bcache to default to create devices with
logical_block_size = 4k, potentially breaking otherwise healthy disk
or file system images unnecessarily.
e.g. some xfs image previously created with 512 byte "sector size"
would, once bcache'd, refuse to mount with
mount: function not implemented
device supports 4096 byte sectors (not 512)
We want the logical_block_size here.
Only show nbuckets and nr_this_dev on cache devices;
explain nbuckets' relation to device size by printing
both total_sectors (superblock included) and
cache_sectors (superblock excluded).
This means bcache devices will be registered earlier and in all
cases, not just when the rootfs fails to mount.
The initramfs hook is still there to ensure the bcache module
and udev rules are shipped if an initramfs is used.