summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO25
-rw-r--r--20_linux_xen-detect-archlinux-initramfs.patch41
-rw-r--r--20_linux_xen-detect-x86-xen-dom0-linux-list.patch25
-rw-r--r--20_linux_xen-load-ucode-as-separate-multiboot-module.patch44
-rw-r--r--20_linux_xen-remove-grub-submenu-for-multiple-xen-versions.patch42
-rw-r--r--20_linux_xen-select-gzipped-xen-only.patch13
-rw-r--r--20_linux_xen-support-xen-realmode-with-grub-efi-boot.patch13
-rw-r--r--PKGBUILD52
-rw-r--r--grub-xen-git.install (renamed from grub-git.install)0
-rw-r--r--grub.default6
10 files changed, 246 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0fe651eb6860..9f3047b4165a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
-pkgbase = grub-git
- pkgdesc = GNU GRand Unified Bootloader (2)
- pkgver = 2.04.rc1.r19.g4e7b5bb3b
+pkgbase = grub-xen-git
+ pkgdesc = GNU GRand Unified Bootloader (2) with Xen platform support
+ pkgver = 2.04.r141.ge7b8856f8
pkgrel = 1
url = https://www.gnu.org/software/grub/
- install = grub-git.install
+ install = grub-xen-git.install
arch = x86_64
arch = i686
license = GPL3
@@ -29,20 +29,33 @@ pkgbase = grub-git
optdepends = libusb: For grub-emu USB support
provides = grub
conflicts = grub
+ conflicts = grub-git
backup = etc/default/grub
backup = etc/grub.d/40_custom
source = grub::git+https://git.savannah.gnu.org/git/grub.git
source = grub-extras::git+https://git.savannah.gnu.org/git/grub-extras.git
source = gnulib::git+https://git.savannah.gnu.org/git/gnulib.git
source = 10_linux-detect-archlinux-initramfs.patch
+ source = 20_linux_xen-detect-archlinux-initramfs.patch
+ source = 20_linux_xen-detect-x86-xen-dom0-linux-list.patch
+ source = 20_linux_xen-load-ucode-as-separate-multiboot-module.patch
+ source = 20_linux_xen-remove-grub-submenu-for-multiple-xen-versions.patch
+ source = 20_linux_xen-select-gzipped-xen-only.patch
+ source = 20_linux_xen-support-xen-realmode-with-grub-efi-boot.patch
source = add-GRUB_COLOR_variables.patch
source = grub.default
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
sha256sums = 171415ab075d1ac806f36c454feeb060f870416f24279b70104bba94bd6076d4
+ sha256sums = aa2f81e74c9eb09bfd0eced093ec0f38409b0001bd20e2cad9e2d9275c8e73c4
+ sha256sums = 432ec7cda9d1a0c8e203d4cfd8ce8f046b967d2330a172ccbedca5345e5e7d08
+ sha256sums = 0ac60de9cca4000825c34f601e1a135e01bda85af6e4bcd75751967c0cc5c00d
+ sha256sums = aa1edfce6193146def470ae61129af3cbdc20638419a37e7e72f543281cb9d53
+ sha256sums = 7cec8e548a8cc6bd7dd26e7b81c1e43bfe270e89bff05382683ddbeeccf218bc
+ sha256sums = f0ccc146a3af7ecc14f5b1adbb0e0e5d03953839b336541741ba16737593e6ef
sha256sums = a5198267ceb04dceb6d2ea7800281a42b3f91fd02da55d2cc9ea20d47273ca29
- sha256sums = 690adb7943ee9fedff578a9d482233925ca3ad3e5a50fffddd27cf33300a89e3
+ sha256sums = bd464f665372ee5211fe825153f31d3d499589cb3e7e25070340ddc0602727c1
-pkgname = grub-git
+pkgname = grub-xen-git
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}"
diff --git a/20_linux_xen-detect-x86-xen-dom0-linux-list.patch b/20_linux_xen-detect-x86-xen-dom0-linux-list.patch
new file mode 100644
index 000000000000..d2feede06318
--- /dev/null
+++ b/20_linux_xen-detect-x86-xen-dom0-linux-list.patch
@@ -0,0 +1,25 @@
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index 3b1f47049..ec3895ee4 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -179,19 +179,7 @@ EOF
+
+ linux_list=
+ for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
+- if grub_file_is_not_garbage "$i"; then
+- basename=$(basename $i)
+- version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
+- dirname=$(dirname $i)
+- config=
+- for j in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
+- if test -e "${j}" ; then
+- config="${j}"
+- break
+- fi
+- done
+- if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then linux_list="$linux_list $i" ; fi
+- fi
++ if (grub_file_is_not_garbage "$i" && $grub_file --is-x86-xen-dom0 "$i") ; then linux_list="$linux_list $i" ; fi
+ done
+ if [ "x${linux_list}" = "x" ] ; then
+ exit 0
diff --git a/20_linux_xen-load-ucode-as-separate-multiboot-module.patch b/20_linux_xen-load-ucode-as-separate-multiboot-module.patch
new file mode 100644
index 000000000000..4aeb77c8461e
--- /dev/null
+++ b/20_linux_xen-load-ucode-as-separate-multiboot-module.patch
@@ -0,0 +1,44 @@
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index 3b1f47049..3d740264d 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -112,6 +112,9 @@ linux_entry_xsm ()
+ xen_version="$(gettext_printf "%s (XSM enabled)" "$xen_version")"
+ # xen_version is used for messages only; actual file is xen_basename
+ fi
++ if [ -n "$initrd_early" ] ; then
++ xen_args="$xen_args ucode=scan"
++ fi
+ if [ -z "$boot_device_id" ]; then
+ boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
+ fi
+@@ -153,16 +156,27 @@ linux_entry_xsm ()
+ echo '$(echo "$lmessage" | grub_quote)'
+ ${module_loader} ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
+ EOF
+- if test -n "${initrd}" ; then
++ if test -n "${initrd_real}" ; then
+ # TRANSLATORS: ramdisk isn't identifier. Should be translated.
+ message="$(gettext_printf "Loading initial ramdisk ...")"
+ initrd_path=
+- for i in ${initrd}; do
++ for i in ${initrd_real}; do
+ initrd_path="${initrd_path} ${rel_dirname}/${i}"
+ done
+ sed "s/^/$submenu_indentation/" << EOF
+ echo '$(echo "$message" | grub_quote)'
+ ${module_loader} --nounzip $(echo $initrd_path)
++EOF
++ fi
++ if test -n "${initrd_early}" ; then
++ message="$(gettext_printf "Loading early microcode updates ...")"
++ ucode_path=
++ for i in ${initrd_early}; do
++ ucode_path="${ucode_path} ${rel_dirname}/${i}"
++ done
++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
++ ${module_loader} $(echo $ucode_path)
+ EOF
+ fi
+ if test -n "${xenpolicy}" ; then
diff --git a/20_linux_xen-remove-grub-submenu-for-multiple-xen-versions.patch b/20_linux_xen-remove-grub-submenu-for-multiple-xen-versions.patch
new file mode 100644
index 000000000000..4552ec51a409
--- /dev/null
+++ b/20_linux_xen-remove-grub-submenu-for-multiple-xen-versions.patch
@@ -0,0 +1,42 @@
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index 3b1f47049..bb12d4a76 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -245,9 +245,6 @@ while [ "x${xen_list}" != "x" ] ; do
+ if [ -z "$boot_device_id" ]; then
+ boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
+ fi
+- if [ "x$is_top_level" != xtrue ]; then
+- echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
+- fi
+ if ($grub_file --is-arm64-efi $current_xen); then
+ xen_loader="xen_hypervisor"
+ module_loader="xen_module"
+@@ -328,15 +325,14 @@ while [ "x${xen_list}" != "x" ] ; do
+ linux_entry "${OS}" "${version}" "${xen_version}" simple \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
+
+- submenu_indentation="$grub_tab$grub_tab"
++ submenu_indentation="$grub_tab"
+
+ if [ -z "$boot_device_id" ]; then
+ boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
+ fi
+ # TRANSLATORS: %s is replaced with an OS name
+ echo "submenu '$(gettext_printf "Advanced options for %s (with Xen hypervisor)" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
+- echo " submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
+- is_top_level=false
++ is_top_level=false
+ fi
+
+ linux_entry "${OS}" "${version}" "${xen_version}" advanced \
+@@ -348,9 +344,6 @@ while [ "x${xen_list}" != "x" ] ; do
+
+ list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
+ done
+- if [ x"$is_top_level" != xtrue ]; then
+- echo ' }'
+- fi
+ xen_list=`echo $xen_list | tr ' ' '\n' | fgrep -vx "$current_xen" | tr '\n' ' '`
+ done
+
diff --git a/20_linux_xen-select-gzipped-xen-only.patch b/20_linux_xen-select-gzipped-xen-only.patch
new file mode 100644
index 000000000000..b2414bb845ef
--- /dev/null
+++ b/20_linux_xen-select-gzipped-xen-only.patch
@@ -0,0 +1,13 @@
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index 3b1f47049..f51a64ff8 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -211,7 +211,7 @@ file_is_not_xen_garbage () {
+ }
+
+ xen_list=
+-for i in /boot/xen*; do
++for i in /boot/xen*.gz; do
+ if grub_file_is_not_garbage "$i" && file_is_not_xen_garbage "$i" ; then xen_list="$xen_list $i" ; fi
+ done
+ prepare_boot_cache=
diff --git a/20_linux_xen-support-xen-realmode-with-grub-efi-boot.patch b/20_linux_xen-support-xen-realmode-with-grub-efi-boot.patch
new file mode 100644
index 000000000000..a6c4aa247283
--- /dev/null
+++ b/20_linux_xen-support-xen-realmode-with-grub-efi-boot.patch
@@ -0,0 +1,13 @@
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index 3b1f47049..8fb1c87a4 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -144,7 +144,7 @@ linux_entry_xsm ()
+ lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
+ sed "s/^/$submenu_indentation/" << EOF
+ echo '$(echo "$xmessage" | grub_quote)'
+- if [ "\$grub_platform" = "pc" -o "\$grub_platform" = "" ]; then
++ if [ "\$grub_platform" = "pc" -o "\$grub_platform" = "efi" -o "\$grub_platform" = "" ]; then
+ xen_rm_opts=
+ else
+ xen_rm_opts="no-real-mode edd=off"
diff --git a/PKGBUILD b/PKGBUILD
index d0f6ad20f35c..027eee809064 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,5 @@
-# Maintainer: Llewelyn Trahaearn <WoefulDerelict [at] GMail [dot] com>
+# Maintainer: Chris Chapman <chris [dot] chapman [at] aggiemail [dot] usu [dot] edu>
+# Contributor: Llewelyn Trahaearn <WoefulDerelict [at] GMail [dot] com>
# Contributor: Tobias Powalowski <tpowa [at] archlinux [dot] org>
# Contributor: Ronald van Haren <ronald [at] archlinux [dot] org>
# Contributor: Keshav Amburay <(the ddoott ridikulus ddoott rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
@@ -9,17 +10,22 @@ _ia32_efi_in_arch_x64="1"
## "1" to enable EMU build, "0" to disable
_grub_emu_build="1"
+## "1" to enable XEN build, "0" to disable
+_grub_xen_build="1"
+
[[ "${CARCH}" == "x86_64" ]] && _target_arch="x86_64"
[[ "${CARCH}" == "i686" ]] && _target_arch="i386"
_build_platforms="i386-pc ${_target_arch}-efi"
[[ "${CARCH}" == "x86_64" ]] && [[ "${_ia32_efi_in_arch_x64}" == "1" ]] && _build_platforms+=" i386-efi"
[[ "${_grub_emu_build}" == "1" ]] && _build_platforms+=" ${_target_arch}-emu"
+[[ "${_grub_xen_build}" == "1" ]] && _build_platforms+=" i386-xen i386-xen_pvh"
+[[ "${_grub_xen_build}" == "1" ]] && [[ "${CARCH}" == "x86_64" ]] && _build_platforms+=" x86_64-xen"
-pkgname="grub-git"
-pkgver=2.04.rc1.r19.g4e7b5bb3b
+pkgname="grub-xen-git"
+pkgver=2.04.r141.ge7b8856f8
pkgrel=1
-pkgdesc="GNU GRand Unified Bootloader (2)"
+pkgdesc="GNU GRand Unified Bootloader (2) with Xen platform support"
arch=('x86_64' 'i686')
url="https://www.gnu.org/software/grub/"
license=('GPL3')
@@ -38,8 +44,8 @@ if [[ "${_grub_emu_build}" == "1" ]]; then
optdepends+=('libusb: For grub-emu USB support')
fi
-provides=("${pkgname%-*}")
-conflicts=("${pkgname%-*}")
+provides=('grub')
+conflicts=('grub' 'grub-git')
backup=('etc/default/grub'
'etc/grub.d/40_custom')
install="${pkgname}.install"
@@ -47,20 +53,48 @@ source=("grub::git+https://git.savannah.gnu.org/git/grub.git"
"grub-extras::git+https://git.savannah.gnu.org/git/grub-extras.git"
"gnulib::git+https://git.savannah.gnu.org/git/gnulib.git"
'10_linux-detect-archlinux-initramfs.patch'
+ '20_linux_xen-detect-archlinux-initramfs.patch'
+ '20_linux_xen-detect-x86-xen-dom0-linux-list.patch'
+ '20_linux_xen-load-ucode-as-separate-multiboot-module.patch'
+ '20_linux_xen-remove-grub-submenu-for-multiple-xen-versions.patch'
+ '20_linux_xen-select-gzipped-xen-only.patch'
+ '20_linux_xen-support-xen-realmode-with-grub-efi-boot.patch'
'add-GRUB_COLOR_variables.patch'
'grub.default')
sha256sums=('SKIP'
'SKIP'
'SKIP'
'171415ab075d1ac806f36c454feeb060f870416f24279b70104bba94bd6076d4'
+ 'aa2f81e74c9eb09bfd0eced093ec0f38409b0001bd20e2cad9e2d9275c8e73c4'
+ '432ec7cda9d1a0c8e203d4cfd8ce8f046b967d2330a172ccbedca5345e5e7d08'
+ '0ac60de9cca4000825c34f601e1a135e01bda85af6e4bcd75751967c0cc5c00d'
+ 'aa1edfce6193146def470ae61129af3cbdc20638419a37e7e72f543281cb9d53'
+ '7cec8e548a8cc6bd7dd26e7b81c1e43bfe270e89bff05382683ddbeeccf218bc'
+ 'f0ccc146a3af7ecc14f5b1adbb0e0e5d03953839b336541741ba16737593e6ef'
'a5198267ceb04dceb6d2ea7800281a42b3f91fd02da55d2cc9ea20d47273ca29'
- '690adb7943ee9fedff578a9d482233925ca3ad3e5a50fffddd27cf33300a89e3')
+ 'bd464f665372ee5211fe825153f31d3d499589cb3e7e25070340ddc0602727c1')
prepare() {
cd grub
# Patch grub-mkconfig to detect Arch Linux initramfs images.
patch -Np1 -i "$srcdir"/10_linux-detect-archlinux-initramfs.patch
+ patch -Np1 -i "$srcdir"/20_linux_xen-detect-archlinux-initramfs.patch
+
+ # Patch grub-mkconfig to detect Dom0-ready Arch Linux kernels.
+ patch -Np1 -i "$srcdir"/20_linux_xen-detect-x86-xen-dom0-linux-list.patch
+
+ # Patch grub-mkconfig to load microcode as separate module that Xen will scan.
+ patch -Np1 -i "$srcdir"/20_linux_xen-load-ucode-as-separate-multiboot-module.patch
+
+ # Patch grub-mkconfig to remove superfluous submenu for selecting Xen versions.
+ patch -Np1 -i "$srcdir"/20_linux_xen-remove-grub-submenu-for-multiple-xen-versions.patch
+
+ # Patch grub-mkconfig to select gzipped Xen kernels only.
+ patch -Np1 -i "$srcdir"/20_linux_xen-select-gzipped-xen-only.patch
+
+ # Patch grub-mkconfig to support GRUB EFI boot.
+ patch -Np1 -i "$srcdir"/20_linux_xen-support-xen-realmode-with-grub-efi-boot.patch
# Patch to enable GRUB_COLOR_* variables in grub-mkconfig.
# Based on http://lists.gnu.org/archive/html/grub-devel/2012-02/msg00021.html
@@ -70,10 +104,10 @@ prepare() {
sed 's|/usr/share/fonts/dejavu|/usr/share/fonts/dejavu /usr/share/fonts/TTF|g' -i "configure.ac"
# Modify grub-mkconfig behaviour to silence warnings FS#36275
- sed 's| ro | rw |g' -i "util/grub.d/10_linux.in"
+ sed 's| ro | rw |g' -i util/grub.d/{10_linux,20_linux_xen}.in
# Modify grub-mkconfig behaviour so automatically generated entries read 'Arch Linux' FS#33393
- sed 's|GNU/Linux|Linux|' -i "util/grub.d/10_linux.in"
+ sed 's|GNU/Linux|Linux|' -i util/grub.d/{10_linux,20_linux_xen}.in
# Pull in latest language files
./linguas.sh
diff --git a/grub-git.install b/grub-xen-git.install
index c13ef99c77c5..c13ef99c77c5 100644
--- a/grub-git.install
+++ b/grub-xen-git.install
diff --git a/grub.default b/grub.default
index d6d41a91345c..1105d5b7f7e7 100644
--- a/grub.default
+++ b/grub.default
@@ -6,6 +6,12 @@ GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet"
GRUB_CMDLINE_LINUX=""
+GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT=""
+GRUB_CMDLINE_LINUX_XEN_REPLACE="earlyprintk=xen"
+
+GRUB_CMDLINE_XEN_DEFAULT=""
+GRUB_CMDLINE_XEN=""
+
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"