0003-10_linux-20_linux_xen-detect-parabola-initramfs.patch 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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-17 13:39:03.509682976 -0500
  3. @@ -91,10 +91,14 @@
  4. fi
  5. if [ x$type != xsimple ] ; then
  6. case $type in
  7. + booster)
  8. + title="$(gettext_printf "%s, %s kernel (booster initramfs)" "${os}" "${version}")" ;;
  9. + fallback)
  10. + title="$(gettext_printf "%s, %s kernel (fallback initramfs)" "${os}" "${version}")" ;;
  11. recovery)
  12. - title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
  13. + title="$(gettext_printf "%s, %s kernel (recovery mode)" "${os}" "${version}")" ;;
  14. *)
  15. - title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
  16. + title="$(gettext_printf "%s, %s kernel" "${os}" "${version}")" ;;
  17. esac
  18. if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
  19. replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
  20. @@ -106,7 +110,7 @@
  21. else
  22. echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
  23. fi
  24. - if [ x$type != xrecovery ] ; then
  25. + if [ x$type != xrecovery ] && [ x$type != xfallback ] ; then
  26. save_default_entry | grub_add_tab
  27. fi
  28. @@ -138,7 +142,7 @@
  29. fi
  30. printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
  31. fi
  32. - message="$(gettext_printf "Loading Linux %s ..." ${version})"
  33. + message="$(gettext_printf "Loading %s kernel ..." ${version})"
  34. sed "s/^/$submenu_indentation/" << EOF
  35. echo '$(echo "$message" | grub_quote)'
  36. linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
  37. @@ -198,7 +202,7 @@
  38. basename=`basename $linux`
  39. dirname=`dirname $linux`
  40. rel_dirname=`make_system_path_relative_to_its_root $dirname`
  41. - version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
  42. + version=`echo $basename | sed -e "s,vmlinuz-,,g"`
  43. alt_version=`echo $version | sed -e "s,\.old$,,g"`
  44. linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
  45. @@ -285,6 +289,29 @@
  46. linux_entry "${OS}" "${version}" advanced \
  47. "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
  48. +
  49. + if test -e "${dirname}/initramfs-${version}-fallback.img" ; then
  50. + initrd="${initrd_early} initramfs-${version}-fallback.img"
  51. +
  52. + if test -n "${initrd}" ; then
  53. + gettext_printf "Found fallback initramfs image: %s\n" "${dirname}/${initrd}" >&2
  54. + fi
  55. +
  56. + linux_entry "${OS}" "${version}" fallback \
  57. + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
  58. + fi
  59. +
  60. + if test -e "${dirname}/booster-${version}.img" ; then
  61. + initrd="${initrd_early} booster-${version}.img"
  62. +
  63. + if test -n "${initrd}" ; then
  64. + gettext_printf "Found booster initrd image(s) in %s:%s\n" "${dirname}" "${initrd_extra} ${initrd}" >&2
  65. + fi
  66. +
  67. + linux_entry "${OS}" "${version}" booster \
  68. + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
  69. + fi
  70. +
  71. if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
  72. linux_entry "${OS}" "${version}" recovery \
  73. "single ${GRUB_CMDLINE_LINUX}"
  74. --- a/util/grub.d/20_linux_xen.in 2021-06-17 03:06:56.202081000 -0500
  75. +++ b/util/grub.d/20_linux_xen.in 2021-06-17 03:22:43.732079272 -0500
  76. @@ -117,9 +117,11 @@
  77. fi
  78. if [ x$type != xsimple ] ; then
  79. if [ x$type = xrecovery ] ; then
  80. - title="$(gettext_printf "%s, with Xen %s and Linux %s (recovery mode)" "${os}" "${xen_version}" "${version}")"
  81. + title="$(gettext_printf "%s, with Xen %s and %s kernel (recovery mode)" "${os}" "${xen_version}" "${version}")"
  82. + elif [ x$type = xfallback ] ; then
  83. + title="$(gettext_printf "%s, with Xen %s and %s kernel (fallback initramfs)" "${os}" "${xen_version}" "${version}")"
  84. else
  85. - title="$(gettext_printf "%s, with Xen %s and Linux %s" "${os}" "${xen_version}" "${version}")"
  86. + title="$(gettext_printf "%s, with Xen %s and %s kernel" "${os}" "${xen_version}" "${version}")"
  87. fi
  88. replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
  89. if [ x"Xen ${xen_version}>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
  90. @@ -132,7 +134,7 @@
  91. title="$(gettext_printf "%s, with Xen hypervisor" "${os}")"
  92. echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
  93. fi
  94. - if [ x$type != xrecovery ] ; then
  95. + if [ x$type != xrecovery ] && [ x$type != xfallback ] ; then
  96. save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/"
  97. fi
  98. @@ -141,7 +143,7 @@
  99. fi
  100. printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
  101. xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
  102. - lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
  103. + lmessage="$(gettext_printf "Loading %s kernel ..." ${version})"
  104. sed "s/^/$submenu_indentation/" << EOF
  105. echo '$(echo "$xmessage" | grub_quote)'
  106. if [ "\$grub_platform" = "pc" -o "\$grub_platform" = "" ]; then
  107. @@ -275,7 +277,7 @@
  108. basename=`basename $linux`
  109. dirname=`dirname $linux`
  110. rel_dirname=`make_system_path_relative_to_its_root $dirname`
  111. - version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
  112. + version=`echo $basename | sed -e "s,vmlinuz-,,g"`
  113. alt_version=`echo $version | sed -e "s,\.old$,,g"`
  114. linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
  115. @@ -341,6 +343,18 @@
  116. linux_entry "${OS}" "${version}" "${xen_version}" advanced \
  117. "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
  118. +
  119. + if test -e "${dirname}/initramfs-${version}-fallback.img" ; then
  120. + initrd="initramfs-${version}-fallback.img"
  121. +
  122. + if test -n "${initrd}" ; then
  123. + gettext_printf "Found fallback initramfs image: %s\n" "${dirname}/${initrd}" >&2
  124. + fi
  125. +
  126. + linux_entry "${OS}" "${version}" "${xen_version}" fallback \
  127. + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
  128. + fi
  129. +
  130. if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
  131. linux_entry "${OS}" "${version}" "${xen_version}" recovery \
  132. "single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}"