summarylogtreecommitdiffstats
path: root/20_linux_xen-detect-archlinux-initramfs.patch
diff options
context:
space:
mode:
authorChris Chapman2020-08-09 10:59:50 +0000
committerChris Chapman2020-08-09 10:59:50 +0000
commit25515585428d1515bd844a95fdf404ea53092cff (patch)
treec96f84a8c0373cfa9c874a704c9c18b3d3cc2e67 /20_linux_xen-detect-archlinux-initramfs.patch
parentc86a6d79ce214f4ad439cf49ce7ab578e6ceb8b4 (diff)
downloadaur-25515585428d1515bd844a95fdf404ea53092cff.tar.gz
Initialize a package to build the GRUB for the Xen platform
Since the time pvgrub2 was adopted by the GRUB [1], the AUR has not had a package that built GRUB2 for the Xen platform. I thought about contributing a patch to the `grub-git` AUR package, but since it would double their build targets (and compile time) for a purpose that was probably not important or useful for most of the users of that package (and since this also seemed like too much for this package to take on as well), I thought it might be better to fork their project and create a new package that would address all the GRUB-ish needs of Xen. The intent is that this would follow `grub-git`, rebasing it on that package as needed. Also some of these patches might be useful upstream, either for the `grub-git` AUR package or for the GRUB project itself. [1]: https://lists.xen.org/archives/html/xen-devel/2013-11/msg01216.html
Diffstat (limited to '20_linux_xen-detect-archlinux-initramfs.patch')
-rw-r--r--20_linux_xen-detect-archlinux-initramfs.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/20_linux_xen-detect-archlinux-initramfs.patch b/20_linux_xen-detect-archlinux-initramfs.patch
new file mode 100644
index 000000000000..93c0f54adf1f
--- /dev/null
+++ b/20_linux_xen-detect-archlinux-initramfs.patch
@@ -0,0 +1,41 @@
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index 3b1f47049..7f1c8526a 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -118,6 +118,8 @@ linux_entry_xsm ()
+ if [ x$type != xsimple ] ; then
+ if [ x$type = xrecovery ] ; then
+ title="$(gettext_printf "%s, with Xen %s and Linux %s (recovery mode)" "${os}" "${xen_version}" "${version}")"
++ elif [ x$type = xfallback ] ; then
++ title="$(gettext_printf "%s, with Xen %s and Linux %s (fallback initramfs)" "${os}" "${xen_version}" "${version}")"
+ else
+ title="$(gettext_printf "%s, with Xen %s and Linux %s" "${os}" "${xen_version}" "${version}")"
+ fi
+@@ -275,7 +277,7 @@ while [ "x${xen_list}" != "x" ] ; do
+ basename=`basename $linux`
+ dirname=`dirname $linux`
+ rel_dirname=`make_system_path_relative_to_its_root $dirname`
+- version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
++ version=`echo $basename | sed -e "s,vmlinuz-,,g"`
+ alt_version=`echo $version | sed -e "s,\.old$,,g"`
+ linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+
+@@ -341,6 +343,18 @@ while [ "x${xen_list}" != "x" ] ; do
+
+ linux_entry "${OS}" "${version}" "${xen_version}" advanced \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
++
++ if test -e "${dirname}/initramfs-${version}-fallback.img" ; then
++ initrd_real="initramfs-${version}-fallback.img"
++
++ if test -n "${initrd_real}" ; then
++ gettext_printf "Found fallback initrd image(s) in %s:%s\n" "${dirname}" "${initrd_extra} ${initrd_real}" >&2
++ fi
++
++ linux_entry "${OS}" "${version}" "${xen_version}" fallback \
++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
++ fi
++
+ if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
+ linux_entry "${OS}" "${version}" "${xen_version}" recovery \
+ "single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}"