1 This patch does two things:
2 1) Drops probe-bcache, so now new util-linux detecting functionality is used.
3 2) Drops bcache-register, using kmod (built in udev) and moving registering device
5 This reduces things that need to be present in initrd, replacing them with already
6 existing functionality and reducing overall initrd size.
8 diff --git a/69-bcache.rules b/69-bcache.rules
9 index 5d28e70..6a52893 100644
12 @@ -10,15 +10,11 @@ KERNEL=="fd*|sr*", GOTO="bcache_end"
13 # It recognised bcache (util-linux 2.24+)
14 ENV{ID_FS_TYPE}=="bcache", GOTO="bcache_backing_found"
15 # It recognised something else; bail
16 -ENV{ID_FS_TYPE}=="?*", GOTO="bcache_backing_end"
18 -# Backing devices: scan, symlink, register
19 -IMPORT{program}="probe-bcache -o udev $tempnode"
20 -ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end"
21 -ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
22 +GOTO="bcache_backing_end"
24 LABEL="bcache_backing_found"
25 -RUN+="bcache-register $tempnode"
26 +RUN{builtin}+="kmod load bcache"
27 +RUN+="/bin/sh -c 'echo $tempnode > /sys/fs/bcache/register_quiet'"
28 LABEL="bcache_backing_end"
30 # Cached devices: symlink
31 diff --git a/Makefile b/Makefile
32 index 3f8d87b..15638a7 100644
35 @@ -9,7 +9,7 @@ all: make-bcache probe-bcache bcache-super-show
37 install: make-bcache probe-bcache bcache-super-show
38 $(INSTALL) -m0755 make-bcache bcache-super-show $(DESTDIR)${PREFIX}/sbin/
39 - $(INSTALL) -m0755 probe-bcache bcache-register $(DESTDIR)$(UDEVLIBDIR)/
40 +# $(INSTALL) -m0755 probe-bcache bcache-register $(DESTDIR)$(UDEVLIBDIR)/
41 $(INSTALL) -m0644 69-bcache.rules $(DESTDIR)$(UDEVLIBDIR)/rules.d/
42 $(INSTALL) -m0644 -- *.8 $(DESTDIR)${PREFIX}/share/man/man8/
43 $(INSTALL) -D -m0755 initramfs/hook $(DESTDIR)/usr/share/initramfs-tools/hooks/bcache
44 diff --git a/bcache-register b/bcache-register
45 index 9b592bc..75b4faf 100755
50 -/sbin/modprobe -qba bcache
51 test -f /sys/fs/bcache/register_quiet && echo "$1" > /sys/fs/bcache/register_quiet