]>
Commit | Line | Data |
---|---|---|
2d769917 ER |
1 | #!/bin/sh |
2 | # geninitrd mod: bcache | |
3 | # requires 3.10 kernel | |
4 | # http://bcache.evilpiepirate.org/ | |
5 | USE_BCACHE=${USE_BCACHE:-yes} | |
6 | ||
7 | # setup geninitrd module | |
8 | # @access public | |
9 | setup_mod_bcache() { | |
10 | if [ ! -d /sys/fs/bcache ]; then | |
11 | USE_BCACHE=no | |
12 | fi | |
13 | ||
14 | if [ ! -x /lib/udev/bcache-register ]; then | |
15 | USE_BCACHE=no | |
16 | fi | |
17 | } | |
18 | ||
19 | # find modules for for bcache | |
20 | # @access public | |
21 | find_modules_bcache() { | |
22 | if ! is_yes "$USE_BCACHE"; then | |
23 | return | |
24 | fi | |
25 | ||
26 | find_module "-bcache" | |
27 | } | |
28 | ||
29 | ||
30 | # generate initrd fragment | |
31 | # @access public | |
32 | initrd_gen_bcache() { | |
33 | if ! is_yes "$USE_BCACHE"; then | |
34 | return | |
35 | fi | |
36 | ||
37 | verbose "Adding bcache support to initrd" | |
38 | ||
39 | inst_rules 69-bcache.rules | |
40 | inst_exec /lib/udev/bcache-register /lib/udev | |
41 | } |