2020-04-24 23:36:52 +00:00
|
|
|
This patch does two things:
|
2024-04-21 15:54:59 +00:00
|
|
|
1) Drops probe-bcache, so now util-linux detecting functionality is used.
|
|
|
|
2) Drops bcache-register, moving registering device functionality into rule
|
|
|
|
using 'sh'.
|
|
|
|
This reduces things that need to be present in initrd, replacing them with
|
|
|
|
already existing functionality and reducing overall initrd size.
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
diff --git a/69-bcache.rules b/69-bcache.rules
|
2024-04-21 15:54:59 +00:00
|
|
|
index 9cc7f0d..6a52893 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/69-bcache.rules
|
|
|
|
+++ b/69-bcache.rules
|
2024-04-21 15:54:59 +00:00
|
|
|
@@ -10,16 +10,11 @@ KERNEL=="fd*|sr*", GOTO="bcache_end"
|
2020-04-24 23:36:52 +00:00
|
|
|
# It recognised bcache (util-linux 2.24+)
|
|
|
|
ENV{ID_FS_TYPE}=="bcache", GOTO="bcache_backing_found"
|
|
|
|
# It recognised something else; bail
|
|
|
|
-ENV{ID_FS_TYPE}=="?*", GOTO="bcache_backing_end"
|
|
|
|
-
|
|
|
|
-# Backing devices: scan, symlink, register
|
|
|
|
-IMPORT{program}="probe-bcache -o udev $tempnode"
|
|
|
|
-ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end"
|
|
|
|
-ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
|
|
|
|
+GOTO="bcache_backing_end"
|
|
|
|
|
|
|
|
LABEL="bcache_backing_found"
|
2024-04-21 15:54:59 +00:00
|
|
|
RUN{builtin}+="kmod load bcache"
|
2020-04-24 23:36:52 +00:00
|
|
|
-RUN+="bcache-register $tempnode"
|
2024-10-23 06:41:50 +00:00
|
|
|
+RUN+="@shell@ -c 'echo $tempnode > /sys/fs/bcache/register_quiet'"
|
2020-04-24 23:36:52 +00:00
|
|
|
LABEL="bcache_backing_end"
|
|
|
|
|
|
|
|
# Cached devices: symlink
|
|
|
|
diff --git a/Makefile b/Makefile
|
2024-04-21 15:54:59 +00:00
|
|
|
index c824ae3..c5f7309 100644
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/Makefile
|
|
|
|
+++ b/Makefile
|
2024-04-21 15:54:59 +00:00
|
|
|
@@ -9,7 +9,6 @@ all: make-bcache probe-bcache bcache-super-show bcache-register
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
install: make-bcache probe-bcache bcache-super-show
|
|
|
|
$(INSTALL) -m0755 make-bcache bcache-super-show $(DESTDIR)${PREFIX}/sbin/
|
|
|
|
- $(INSTALL) -m0755 probe-bcache bcache-register $(DESTDIR)$(UDEVLIBDIR)/
|
|
|
|
$(INSTALL) -m0644 69-bcache.rules $(DESTDIR)$(UDEVLIBDIR)/rules.d/
|
|
|
|
$(INSTALL) -m0644 -- *.8 $(DESTDIR)${PREFIX}/share/man/man8/
|
|
|
|
$(INSTALL) -D -m0755 initramfs/hook $(DESTDIR)/usr/share/initramfs-tools/hooks/bcache
|