1000-am335x_bone--10_linux-20_linux_xen-detect-devicetree-file.patch 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. --- a/util/grub.d/10_linux.in 2021-06-17 03:06:45.912081000 -0500
  2. +++ b/util/grub.d/10_linux.in 2021-06-18 02:16:38.219592837 -0500
  3. @@ -155,6 +155,25 @@
  4. initrd $(echo $initrd_path)
  5. EOF
  6. fi
  7. + if [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BONE' ]; then
  8. + if test -f "${rel_dirname}/dtbs/${version}/am335x-bone.dtb" ; then
  9. + # TRANSLATORS: Device tree path isn't identifier. Should be translated.
  10. + message="$(gettext_printf "Loading devices tree file ...")"
  11. + sed "s/^/$submenu_indentation/" << EOF
  12. + echo '$(echo "$message" | grub_quote)'
  13. + devicetree ${rel_dirname}/dtbs/${version}/am335x-bone.dtb
  14. +EOF
  15. + fi
  16. + elif [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BNLT' ]; then
  17. + if test -f "${rel_dirname}/dtbs/${version}/am335x-boneblack.dtb" ; then
  18. + # TRANSLATORS: Device tree path isn't identifier. Should be translated.
  19. + message="$(gettext_printf "Loading devices tree file ...")"
  20. + sed "s/^/$submenu_indentation/" << EOF
  21. + echo '$(echo "$message" | grub_quote)'
  22. + devicetree ${rel_dirname}/dtbs/${version}/am335x-boneblack.dtb
  23. +EOF
  24. + fi
  25. + fi
  26. sed "s/^/$submenu_indentation/" << EOF
  27. }
  28. EOF
  29. @@ -261,6 +280,16 @@
  30. fi
  31. fi
  32. + if [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BONE' ]; then
  33. + if test -f "${dirname}/dtbs/${version}/am335x-bone.dtb" ; then
  34. + gettext_printf "Found device tree file: %s\n" "${dirname}/dtbs/${version}/am335x-bone.dtb" >&2
  35. + fi
  36. + elif [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BNLT' ]; then
  37. + if test -f "${dirname}/dtbs/${version}/am335x-boneblack.dtb" ; then
  38. + gettext_printf "Found device tree file: %s\n" "${dirname}/dtbs/${version}/am335x-boneblack.dtb" >&2
  39. + fi
  40. + fi
  41. +
  42. # The GRUB_DISABLE_SUBMENU option used to be different than others since it was
  43. # mentioned in the documentation that has to be set to 'y' instead of 'true' to
  44. # enable it. This caused a lot of confusion to users that set the option to 'y',
  45. --- a/util/grub.d/20_linux_xen.in 2021-06-17 03:06:56.202081000 -0500
  46. +++ b/util/grub.d/20_linux_xen.in 2021-06-18 02:23:54.679591971 -0500
  47. @@ -172,6 +172,25 @@
  48. ${module_loader} ${rel_dirname}/${xenpolicy}
  49. EOF
  50. fi
  51. + if [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BONE' ]; then
  52. + if test -f "${rel_dirname}/dtbs/${version}/am335x-bone.dtb" ; then
  53. + # TRANSLATORS: Device tree path isn't identifier. Should be translated.
  54. + message="$(gettext_printf "Loading devices tree file ...")"
  55. + sed "s/^/$submenu_indentation/" << EOF
  56. + echo '$(echo "$message" | grub_quote)'
  57. + devicetree ${rel_dirname}/dtbs/${version}/am335x-bone.dtb
  58. +EOF
  59. + fi
  60. + elif [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BNLT' ]; then
  61. + if test -f "${rel_dirname}/dtbs/${version}/am335x-boneblack.dtb" ; then
  62. + # TRANSLATORS: Device tree path isn't identifier. Should be translated.
  63. + message="$(gettext_printf "Loading devices tree file ...")"
  64. + sed "s/^/$submenu_indentation/" << EOF
  65. + echo '$(echo "$message" | grub_quote)'
  66. + devicetree ${rel_dirname}/dtbs/${version}/am335x-boneblack.dtb
  67. +EOF
  68. + fi
  69. + fi
  70. sed "s/^/$submenu_indentation/" << EOF
  71. }
  72. EOF
  73. @@ -316,6 +335,16 @@
  74. fi
  75. fi
  76. + if [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BONE' ]; then
  77. + if test -f "${dirname}/dtbs/${version}/am335x-bone.dtb" ; then
  78. + gettext_printf "Found device tree file: %s\n" "${dirname}/dtbs/${version}/am335x-bone.dtb" >&2
  79. + fi
  80. + elif [ "$(cat /sys/devices/platform/bone_capemgr/baseboard/board-name)" = 'A335BNLT' ]; then
  81. + if test -f "${dirname}/dtbs/${version}/am335x-boneblack.dtb" ; then
  82. + gettext_printf "Found device tree file: %s\n" "${dirname}/dtbs/${version}/am335x-boneblack.dtb" >&2
  83. + fi
  84. + fi
  85. +
  86. # The GRUB_DISABLE_SUBMENU option used to be different than others since it was
  87. # mentioned in the documentation that has to be set to 'y' instead of 'true' to
  88. # enable it. This caused a lot of confusion to users that set the option to 'y',