10filesystems 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. # Make sure filesystems are available.
  3. set +e # ignore errors from modprobe
  4. FILESYSTEMS='ext2 ext3 ext4 xfs jfs msdos vfat ntfs minix hfs hfsplus qnx4 ufs btrfs'
  5. # fuse is needed to make grub-mount work.
  6. FILESYSTEMS="$FILESYSTEMS fuse"
  7. # The Ubuntu kernel udebs put a number of filesystem modules in
  8. # fs-{core,secondary}-modules. It's fairly cheap to check for these too.
  9. FILESYSTEMS="$FILESYSTEMS fs-core fs-secondary"
  10. if [ ! -e /var/lib/os-prober/modules ]; then
  11. # Check for anna-install to make it easier to use os-prober outside
  12. # d-i.
  13. if type anna-install >/dev/null 2>&1 && [ -d /lib/debian-installer ]; then
  14. for fs in $FILESYSTEMS; do
  15. ANNA_QUIET=1 DEBIAN_FRONTEND=none \
  16. log-output -t os-prober \
  17. anna-install "$fs-modules" || true
  18. done
  19. depmod -a >/dev/null 2>&1 || true
  20. fi
  21. for fs in $FILESYSTEMS; do
  22. case "$fs" in
  23. fs-*)
  24. ;;
  25. *)
  26. modprobe "$fs" 2>/dev/null | logger -t os-prober
  27. ;;
  28. esac
  29. done
  30. # We only want to keep this state inside d-i, so this is as good a
  31. # check as any.
  32. if type anna-install >/dev/null 2>&1 && [ -d /lib/debian-installer ]; then
  33. touch /var/lib/os-prober/modules
  34. fi
  35. fi