module-setup.sh 696 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
  3. # ex: ts=8 sw=4 sts=4 et filetype=sh
  4. #
  5. # At some point (util-linux v2.24) blkid will be able to identify bcache
  6. # but until every system has this version of util-linux, probe-bcache is
  7. # provided as an alternative.
  8. #
  9. check() {
  10. if [[ $hostonly ]] || [[ $mount_needs ]]
  11. then
  12. for fs in "${host_fs_types[@]}"; do
  13. [[ $fs = "bcache" ]] && return 0
  14. done
  15. return 255
  16. fi
  17. return 0
  18. }
  19. depends() {
  20. return 0
  21. }
  22. installkernel() {
  23. instmods bcache
  24. }
  25. install() {
  26. inst_multiple ${udevdir}/probe-bcache ${udevdir}/bcache-register
  27. inst_rules 69-bcache.rules
  28. }