39_memtest86+ 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/sh
  2. . /usr/share/grub/grub-mkconfig_lib
  3. memtest=/boot/memtest86plus/memtest
  4. memtestbsd=/boot/memtest86plus/memtest.netbsd
  5. if [ -f "${memtest}" ] && [ -f "${memtestbsd}" ]; then
  6. multiple_memtest=true
  7. fi
  8. submenu_indentation=""
  9. if [ "${multiple_memtest}" = "true" ] && [ "${GRUB_DISABLE_SUBMENU}" != "y" ]; then
  10. submenu_indentation="${grub_tab}"
  11. cat <<EOF
  12. submenu 'Memtest86+' {
  13. EOF
  14. fi
  15. if [ -f "${memtest}" ]; then
  16. gettext_printf "Found memtest image: %s\n" "${memtest}" >&2
  17. device="$("${grub_probe}" --target=device "${memtest}")"
  18. path="$(make_system_path_relative_to_its_root "${memtest}")"
  19. cat <<EOF
  20. ${submenu_indentation}menuentry 'Memtest86+' {
  21. EOF
  22. if [ -n "{submenu_indentation}" ]; then
  23. prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
  24. else
  25. prepare_grub_to_access_device "${device}" | grub_add_tab
  26. fi
  27. cat <<EOF
  28. ${submenu_indentation}linux16 "${path}"
  29. ${submenu_indentation}}
  30. EOF
  31. fi
  32. if [ -f "${memtestbsd}" ]; then
  33. gettext_printf "Found memtest image: %s\n" "${memtestbsd}" >&2
  34. device="$("${grub_probe}" --target=device "${memtestbsd}")"
  35. path="$(make_system_path_relative_to_its_root "${memtestbsd}")"
  36. cat <<EOF
  37. ${submenu_indentation}menuentry 'Memtest86+ (netbsd)' {
  38. EOF
  39. if [ -n "${submenu_indentation}" ]; then
  40. prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab
  41. else
  42. prepare_grub_to_access_device "${device}" | grub_add_tab
  43. fi
  44. cat <<EOF
  45. ${submenu_indentation}knetbsd "${path}"
  46. ${submenu_indentation}}
  47. EOF
  48. fi
  49. if [ "${multiple_memtest}" = "true" ] && [ "${GRUB_DISABLE_SUBMENU}" != "y" ]; then
  50. cat <<EOF
  51. }
  52. EOF
  53. fi