30utility 863 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. # Detects utility (hw vendor recovery) partitions.
  3. . /usr/share/os-prober/common.sh
  4. partition="$1"
  5. mpoint="$2"
  6. type="$3"
  7. # Weed out stuff that doesn't apply to us
  8. case "$type" in
  9. vfat) debug "$1 is a FAT32 partition" ;;
  10. msdos) debug "$1 is a FAT16 partition" ;;
  11. fat) debug "$1 is a FAT partition (mounted by GRUB)" ;;
  12. *) debug "$1 is not a FAT partition: exiting"; exit 1 ;;
  13. esac
  14. # Dell Utility partitions have partition type 0xde, but no idea how to
  15. # cleanly detect that from shell
  16. if item_in_dir -q dellbio.bin "$2" && \
  17. (item_in_dir -q delldiag.exe "$2" || item_in_dir -q delldiag.com "$2"); then
  18. long="Dell Utility Partition"
  19. short=DellUtility
  20. elif item_in_dir -q f11.sys "$2"; then
  21. long="Acronis Secure Zone"
  22. short=AcroneZone
  23. else
  24. exit 1
  25. fi
  26. label="$(count_next_label "$short")"
  27. result "${partition}:${long}:${label}:chain"
  28. exit 0