summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--initramfs14
2 files changed, 7 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index f94113a..8042c5d 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ install: make-bcache probe-bcache
install -m0755 make-bcache $(DESTDIR)${PREFIX}/sbin/
install -m0755 probe-bcache $(DESTDIR)/sbin/
install -m0644 61-bcache.rules $(DESTDIR)/lib/udev/rules.d/
- install -m0755 initramfs $(DESTDIR)/usr/share/initramfs-tools/hooks/bcache
+ install -m0755 initramfs $(DESTDIR)/etc/initramfs-tools/scripts/local-premount/bcache-probe
install -m0644 *.8 $(DESTDIR)${PREFIX}/share/man/man8
# install -m0755 bcache-test $(DESTDIR)${PREFIX}/sbin/
diff --git a/initramfs b/initramfs
index 3815dc9..af191cd 100644
--- a/initramfs
+++ b/initramfs
@@ -1,11 +1,9 @@
#!/bin/sh -e
-case "$1" in
-prereqs)
- echo "udev"
- exit 0
- ;;
-esac
+for i in `ls /sys/dev/block/`; do
+ DEV=/tmp/bcache_dev
-cp -p /lib/udev/rules.d/61-bcache.rules $DESTDIR/lib/udev/rules.d/
-cp -p /sbin/probe-bcache $DESTDIR/sbin
+ mknod $DEV b `echo $i|sed -e 's/:/ /'`
+ echo $DEV > /sys/fs/bcache/register_quiet
+ rm $DEV
+done