summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2012-04-11 15:33:40 -0700
committerKent Overstreet <koverstreet@google.com>2012-04-11 15:33:40 -0700
commita3d0e5bafb42e42e16e00cd5e3d8522484d5d9de (patch)
tree05ced12ade662607dcfab8c5cf68cfb77a100b31
parentf4c09286dd3f761310b24bc03e5ce95793a9a30c (diff)
Update initramfs probe script
-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