From ff4a6a76b2c992ed9471419a2264edefe61f20bf Mon Sep 17 00:00:00 2001 From: Isaac David Date: Tue, 11 Jul 2017 20:00:14 -0500 Subject: pcr/xen: update to 4.9.0 --- pcr/xen/21_linux_xen_multiboot_arch | 294 +++++++++++ pcr/xen/PKGBUILD | 585 +++++++++++++-------- pcr/xen/patch-gcc7-minios-udivmod.patch | 415 +++++++++++++++ pcr/xen/patch-gcc7-vtpm-implicit-fallthrough.patch | 415 +++++++++++++++ .../patch-gcc7-vtpmmgr-make-inline-static.patch | 417 +++++++++++++++ pcr/xen/patch-ipxe-patches-series.patch | 18 + pcr/xen/patch-ovmf-apply-inbuild-patches.patch | 26 + pcr/xen/patch-ovmf-patches-series.patch | 20 + pcr/xen/patch-ovmf-use-python2.patch | 22 + pcr/xen/xen.install | 93 +++- 10 files changed, 2085 insertions(+), 220 deletions(-) create mode 100755 pcr/xen/21_linux_xen_multiboot_arch create mode 100644 pcr/xen/patch-gcc7-minios-udivmod.patch create mode 100644 pcr/xen/patch-gcc7-vtpm-implicit-fallthrough.patch create mode 100644 pcr/xen/patch-gcc7-vtpmmgr-make-inline-static.patch create mode 100644 pcr/xen/patch-ipxe-patches-series.patch create mode 100644 pcr/xen/patch-ovmf-apply-inbuild-patches.patch create mode 100644 pcr/xen/patch-ovmf-patches-series.patch create mode 100644 pcr/xen/patch-ovmf-use-python2.patch (limited to 'pcr') diff --git a/pcr/xen/21_linux_xen_multiboot_arch b/pcr/xen/21_linux_xen_multiboot_arch new file mode 100755 index 000000000..2c7d457a0 --- /dev/null +++ b/pcr/xen/21_linux_xen_multiboot_arch @@ -0,0 +1,294 @@ +#! /bin/sh +set -e + +# grub-mkconfig helper script. +# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +prefix="/usr" +exec_prefix="/usr" +datarootdir="/usr/share" + +. "$pkgdatadir/grub-mkconfig_lib" + +export TEXTDOMAIN=grub +export TEXTDOMAINDIR="${datarootdir}/locale" + +CLASS="--class gnu-linux --class gnu --class os --class xen" + +if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then + OS=GNU/Linux-libre +else + OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre" + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" +fi + +# loop-AES arranges things so that /dev/loop/X can be our root device, but +# the initrds that Linux-libre uses don't like that. +case ${GRUB_DEVICE} in + /dev/loop/*|/dev/loop[0-9]) + GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` + ;; +esac + +# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter +# and mounting btrfs requires user space scanning, so force UUID in this case. +if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ + || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ + || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then + LINUX_ROOT_DEVICE=${GRUB_DEVICE} +else + LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} +fi + +# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT. +if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then + GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}" +fi +if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then + GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" +fi + +case x"$GRUB_FS" in + xbtrfs) + rootsubvol="`make_system_path_relative_to_its_root /`" + rootsubvol="${rootsubvol#/}" + if [ "x${rootsubvol}" != x ]; then + GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}" + fi;; + xzfs) + rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` + bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`" + LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}" + ;; +esac + +title_correction_code= + +linux_entry () +{ + os="$1" + version="$2" + xen_version="$3" + type="$4" + args="$5" + xen_args="$6" + ver="" + if $($grub_file --is-x86-multiboot2 ${xen_dirname}/${xen_basename}); then + ver="2" + fi + if [ -z "$boot_device_id" ]; then + boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + fi + if [ x$type != xsimple ] ; then + if [ x$type = xrecovery ] ; then + title="$(gettext_printf "%s, with Xen %s and Linux-libre %s (recovery mode)" "${os}" "${xen_version}" "${version}")" + else + title="$(gettext_printf "%s, with Xen %s and Linux-libre %s" "${os}" "${xen_version}" "${version}")" + fi + replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')" + if [ x"Xen ${xen_version}>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then + quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)" + title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;" + grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")" + fi + echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + else + title="$(gettext_printf "%s, with Xen hypervisor" "${os}")" + echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + fi + if [ x$type != xrecovery ] ; then + save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/" + fi + + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)" + fi + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" + xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})" + lmessage="$(gettext_printf "Loading Linux-libre %s ..." ${version})" + sed "s/^/$submenu_indentation/" << EOF + echo '$(echo "$xmessage" | grub_quote)' + if [ "\$grub_platform" = "pc" -o "\$grub_platform" = "" ]; then + xen_rm_opts= + else + xen_rm_opts="no-real-mode edd=off" + fi + multiboot${ver} ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts} + echo '$(echo "$lmessage" | grub_quote)' + module${ver} ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args} +EOF + if test -n "${initrd}" ; then + # TRANSLATORS: ramdisk isn't identifier. Should be translated. + message="$(gettext_printf "Loading initial ramdisk ...")" + sed "s/^/$submenu_indentation/" << EOF + echo '$(echo "$message" | grub_quote)' + module${ver} --nounzip ${rel_dirname}/${initrd} +EOF + fi + sed "s/^/$submenu_indentation/" << EOF +} +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 || [ -z ${config} ]); then linux_list="$linux_list $i" ; fi + fi +done +if [ "x${linux_list}" = "x" ] ; then + exit 0 +fi + +file_is_not_sym () { + case "$1" in + */xen-syms-*) + return 1;; + *) + return 0;; + esac +} + +file_is_not_xen_config () { + case "$1" in + */xen*\.*config) + return 1;; + */xen*\.*cfg) + return 1;; + */xen*\.*efi) + return 1;; + *) + return 0;; + esac +} + + +xen_list= +for i in /boot/xen*; do + if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" && file_is_not_xen_config "$i"; then xen_list="$xen_list $i" ; fi +done +prepare_boot_cache= +boot_device_id= + +title_correction_code= + +machine=`uname -m` + +case "$machine" in + i?86) GENKERNEL_ARCH="x86" ;; + mips|mips64) GENKERNEL_ARCH="mips" ;; + mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;; + arm*) GENKERNEL_ARCH="arm" ;; + *) GENKERNEL_ARCH="$machine" ;; +esac + +# Extra indentation to add to menu entries in a submenu. We're not in a submenu +# yet, so it's empty. In a submenu it will be equal to '\t' (one tab). +submenu_indentation="" + +is_top_level=true + +while [ "x${xen_list}" != "x" ] ; do + list="${linux_list}" + current_xen=`version_find_latest $xen_list` + xen_basename=`basename ${current_xen}` + xen_dirname=`dirname ${current_xen}` + rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname` + xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"` + 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 + while [ "x$list" != "x" ] ; do + linux=`version_find_latest $list` + gettext_printf "Found linux-libre image: %s\n" "$linux" >&2 + 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"` + alt_version=`echo $version | sed -e "s,\.old$,,g"` + linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" + + initrd= + for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \ + "initrd-${version}" "initramfs-${version}.img" \ + "initrd.img-${alt_version}" "initrd-${alt_version}.img" \ + "initrd-${alt_version}" "initramfs-${alt_version}.img" \ + "initramfs-genkernel-${version}" \ + "initramfs-genkernel-${alt_version}" \ + "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ + "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" ; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break + fi + done + if test -n "${initrd}" ; then + gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 + else + # "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here. + linux_root_device_thisversion=${GRUB_DEVICE} + fi + + if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then + 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" + + 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 + fi + + linux_entry "${OS}" "${version}" "${xen_version}" advanced \ + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}" + if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then + linux_entry "${OS}" "${version}" "${xen_version}" recovery \ + "single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}" + fi + + 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 + +# If at least one kernel was found, then we need to +# add a closing '}' for the submenu command. +if [ x"$is_top_level" != xtrue ]; then + echo '}' +fi + +echo "$title_correction_code" diff --git a/pcr/xen/PKGBUILD b/pcr/xen/PKGBUILD index e6f8e5d23..c52c13c2f 100644 --- a/pcr/xen/PKGBUILD +++ b/pcr/xen/PKGBUILD @@ -1,100 +1,164 @@ -# Maintainer (Arch): David Sutton +# current version adapted from https://gitlab.com/johnth/aur-xen/blob/717dc1c8e32c3c615652f2b40838d1cb12441073/PKGBUILD + +# Maintainer (AUR): John Thomson +# Contributor (Arch): David Sutton # Contributor (Arch): Shanmu Thiagaraja # Contributor (Arch): Limao Luo # Contributor (Arch): Luceo # Contributor (Arch): Revellion -# Contributor (Arch): John Thomson -# Maintainer: André Silva +# Contributor: André Silva # Contributor: Márcio Silva +# Contributor: Isaac David + +#linux-4.7 EFI boot panic issue (patch linux) +#http://lkml.iu.edu/hypermail/linux/kernel/1608.2/03448.html +_build_stubdom="${build_stubdom:-false}" +_system_seabios="${system_seabios:-false}" +_build_debug="${build_debug:-false}" +_build_livepatch="${build_livepatch:-false}" -_build_stubdom=${build_stubdom:-false} ## use _build_stubdom=true to build xen with stubdom -#_build_stubdom=true +## use _system_seabios=true to use system seabios +## this bios file is slightly different to the xen seabios +## /usr/share/qemu/bios-256k.bin uses CONFIG_ROM_SIZE=256, and newer seabios +## can force use this file through vm.cfg bios_path_override='/usr/share/qemu/bios-256k.bin' +## use _build_debug=true to compile Xen with debug options +## use _build_livepatch=true to compile Xen with livepatch support -pkgname=xen -pkgver=4.7.0 -pkgrel=1.parabola1.1 +#_build_stubdom=true +#_system_seabios=true +#_build_debug=true +#_build_livepatch=true + +pkgbase=xen +pkgname=(xen{,-docs,-syms}) +_pkgname=xen +pkgver=4.9.0 +_pkgver=${pkgver/rc/-rc} +pkgrel=1.parabola1 pkgdesc="Virtual Machine Hypervisor & Tools (Parabola rebranded)" -arch=(x86_64) -url="http://www.xenproject.org/" -license=(GPL2) -depends=(bridge-utils curl gnutls iproute2 libaio libcap-ng libiscsi libnl libpng lzo pciutils python python2 sdl spice usbredir yajl - # seabios ovmf qemu - ) -[[ "$CARCH" == "x86_64" ]] && depends+=(lib32-glibc) -makedepends=(bin86 cmake dev86 figlet git iasl markdown nasm ocaml-findlib spice-protocol wget) +arch=(x86_64 armv7h) +depends=( + bridge-utils + curl + gnutls + iproute2 + libaio + libcap-ng + libiscsi + libnl + libpng + lzo + pciutils + python2 + sdl + spice + systemd + usbredir + yajl + # seabios ovmf qemu +) +[[ "$CARCH" == 'x86_64' ]] && depends+=( + lib32-glibc +) +[[ "$CARCH" == *'arm'* ]] && depends+=( + dtc-overlay +) +[[ "$_system_seabios" == true ]] && depends+=( + seabios +) +url='http://www.xenproject.org/' +license=('GPL2') +makedepends=( + cmake + figlet + git + markdown + nasm + ocaml-findlib + spice-protocol + wget +) +[[ "$CARCH" == 'x86_64' ]] && makedepends+=( + bin86 + dev86 + gcc-multilib + iasl +) ## For building Xen EFI boot file. ## mingw-w64-binutils only needed if ## binutils not built with --enable-targets=x86_64-pep -_binutils_emulations=$(ld -V) _binutils_efi=false -if [[ $_binutils_emulations == *'i386pep'* ]] -then - _binutils_efi=true - echo 'ld has efi support' -else - makedepends+=(mingw-w64-binutils) - echo 'ld does not have efi support, using mingw' -fi -optdepends=('xen-docs: Official Xen Documentation' 'openvswitch: Optional Networking support') -conflicts=(xen-4.2{,-testing-hg} xen-{gdbsx,hg-unstable,rc,git,igvtg} xen-4.3{,-testing-hg} xen-4.4 xen-4.5 xen-4.6) -backup=( - etc/modules-load.d/$pkgname.conf - etc/$pkgname/xl.conf - etc/conf.d/xen{stored,consoled,domains,commons} - etc/$pkgname/grub.conf +if [[ "$CARCH" == 'x86_64' ]]; then + _binutils_emulations="$(ld -V)" + if [[ "$_binutils_emulations" == *'i386pep'* ]]; then + _binutils_efi=true + echo '#ld has efi support' + else + makedepends+=( + mingw-w64-binutils ) + echo '#ld does not have efi support, using mingw' + fi +fi + + options=(!buildflags !strip) -install=$pkgname.install changelog=ChangeLog + +##SeaBIOS & OVMF tags are in src/xen-*/tools/Config.mk +##grep -rE '_(REVISION|VERSION|TAG)( \?| :){0,1}=' src/xen**/{Config.mk,stubdom/configure,tools/firmware/etherboot/Makefile} +_git_tag_seabios='#tag=rel-1.10.0' +_git_tag_ovmf='#tag=5920a9d16b1ab887c2858224316a98e961d71b05' +_git_tag_ipxe='827dd1bfee67daa683935ce65316f7e0f057fe1c' + +if [[ "$_build_stubdom" == true ]]; then + if [[ "$CARCH" == *'arm'* ]]; then + echo '####Compile settings error:' + echo "#cannot build stubdom for $CARCH" + _build_stubdom=false + fi +fi + source=( - http://bits.xensource.com/oss-xen/release/$pkgver/$pkgname-$pkgver.tar.gz - http://xenbits.xen.org/xen-extfiles/ipxe-git-9a93db3f0947484e30e753bbd61a10b17336e20e.tar.gz + "https://downloads.xenproject.org/release/$_pkgname/$_pkgver/$_pkgname-$_pkgver.tar.gz"{,.sig} + "http://xenbits.xen.org/xen-extfiles/ipxe-git-$_git_tag_ipxe.tar.gz" - ##SeaBIOS & OVMF tags are in src/xen-*/tools/Config.mk - ##Can be found through: grep -R 'UPSTREAM_REVISION' src/xen-*/Config.mk - #'seabios'::'git://xenbits.xen.org/seabios.git#tag=rel-1.9.2' - #'ovmf'::'git://xenbits.xen.org/ovmf.git#tag=52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d' + 'seabios'::"git://xenbits.xen.org/seabios.git$_git_tag_seabios" + 'ovmf'::"git://xenbits.xen.org/ovmf.git$_git_tag_ovmf" ##HTTP access - 'seabios'::'git+http://xenbits.xen.org/git-http/seabios.git#tag=rel-1.9.2' - 'ovmf'::'git+http://xenbits.xen.org/git-http/ovmf.git#tag=52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d' + #'seabios'::"git+http://xenbits.xen.org/git-http/seabios.git$_git_tag_seabios" ## Compile patches ati-passthrough.patch - ovmf.patch + patch-ovmf-use-python2.patch + patch-ovmf-apply-inbuild-patches.patch + patch-ovmf-patches-series.patch #patch-build-efi-with-mingw.patch::https://github.com/jakogut/xen-igvtg-aur/raw/28c81072e419d72a100ada9c393e37fae35ad263/xen_efi_build.patch - patch-gcc6-ovmf-build.sh.patch - #ipxe - patch-gcc6-etherboot-nonnull-compare.patch::https://git.ipxe.org/ipxe.git/patch/e2f14c2f8c10674dbbd4f1228d79dc4c9be213b5 - patch-gcc6-etherboot-rm-unused-string-functions.patch - patch-gcc6-etherboot-nic.c.patch::https://git.ipxe.org/ipxe.git/patch/a5885fbc19c4b60dc1a21624d1a9d1b77a93504e - patch-gcc6-etherboot-ath.patch::https://git.ipxe.org/ipxe.git/patch/63037bdce4a325e5e1da85ffcdf27b77ac670c01 - patch-gcc6-etherboot-sis190.patch::https://git.ipxe.org/ipxe.git/patch/65b32a0b7000f70a5bb1d33190d40f9b04c93172 - patch-gcc6-etherboot-skge.patch::https://git.ipxe.org/ipxe.git/patch/76ec2a0540b25dbd183b9ce185583a4b24278cf1 - patch-gcc6-etherboot-via-velocity.c.patch - patch-gcc6-etherboot-via-rhine.c.patch - patch-gcc6-etherboot-e1000_phy.c.patch - patch-gcc6-etherboot-igb_phy.c.patch - patch-gcc6-etherboot-eth_broadcast.patch::https://git.ipxe.org/ipxe.git/patch/1cbb1581f16e235fafc963c906ad02b38d5457bd - patch-gcc6-etherboot-link-header.patch::https://git.ipxe.org/ipxe.git/patch/6324bd9389521c7e86384591f41eb78a81e9af47 - patch-gcc6-etherboot-ath9k-9287-array.patch + patch-inbuild-ovmf-5-hiilib.c-pointer-zero.patch::'https://github.com/tianocore/edk2/commit/fe4a28ccbfd33cae9e1f56b174d46b4eb2329efd.patch' + patch-inbuild-ipxe-gcc7-implicit-fallthrough.patch::'https://github.com/ipxe/ipxe/commit/5f85cbb9ee1c00cec81a848a9e871ad5d1e7f53f.patch' + patch-inbuild-ipxe-gcc7-implicit-fallthrough-ath5k.patch::'https://github.com/ipxe/ipxe/commit/45f2265bfcbbf2afd7fac24372ae26e453f2b52d.patch' + patch-inbuild-ipxe-gcc7-implicit-fallthrough-curses.patch::'https://github.com/ipxe/ipxe/commit/28e26dd2503e6006fabb26f8c33050ba93a99623.patch' + patch-ipxe-patches-series.patch + patch-gcc7-vtpm-implicit-fallthrough.patch + patch-gcc7-vtpmmgr-make-inline-static.patch + patch-gcc7-minios-udivmod.patch ## Files xen.install - 09_xen + 21_linux_xen_multiboot_arch efi-xen.cfg - grub.conf - $pkgname.conf - tmpfiles.d-$pkgname.conf + "$_pkgname.conf" + "tmpfiles.d-$_pkgname.conf" ## XSA patches - ) +) -if [ "$_build_stubdom" = true ] ; then - echo "building with stubdom" +if [[ "$_build_stubdom" == true ]]; then + echo '#building with stubdom' source+=( http://xenbits.xen.org/xen-extfiles/lwip-1.3.0.tar.gz http://xenbits.xen.org/xen-extfiles/zlib-1.2.3.tar.gz @@ -104,16 +168,16 @@ if [ "$_build_stubdom" = true ] ; then http://xenbits.xen.org/xen-extfiles/grub-0.97.tar.gz http://xenbits.xen.org/xen-extfiles/tpm_emulator-0.7.4.tar.gz http://xenbits.xen.org/xen-extfiles/gmp-4.3.2.tar.bz2 - #http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-3.11.0.tar.gz + http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-3.11.0.tar.gz ) fi noextract=( - ipxe-git-9a93db3f0947484e30e753bbd61a10b17336e20e.tar.gz - ) + "ipxe-git-$_git_tag_ipxe.tar.gz" +) -if [ "$_build_stubdom" = true ] ; then +if [[ "$_build_stubdom" == true ]]; then noextract+=( lwip-1.3.0.tar.gz zlib-1.2.3.tar.gz @@ -123,75 +187,90 @@ if [ "$_build_stubdom" = true ] ; then grub-0.97.tar.gz tpm_emulator-0.7.4.tar.gz gmp-4.3.2.tar.bz2 - #ocaml-3.11.0.tar.gz + ocaml-3.11.0.tar.gz ) fi +validpgpkeys=('23E3222C145F4475FA8060A783FE14C957E82BD9') +#gpg --keyserver pgp.mit.edu --recv-key 23E3222C145F4475FA8060A783FE14C957E82BD9 sha256sums=( - 'be5876144d49729572ae06142e0bb93f1c1f2695578141eff2931995add24623' - '632ce8c193ccacc3012bd354bdb733a4be126f7c098e111930aa41dad537405c' - - 'SKIP' - 'SKIP' - - 'd93c2d5bcdf0c3e4c6e8efb357cb4b9d618209025361f5ccd9d03651a8acd7a3' - '9cf9232c6e9a2b972cd4e1c7aacac9152bb8676db2b794381e1964c9f452e7de' - #'a8ce42777e22af49080131e174b6b89c6e7597539838fb8b17a12280fd10b10b' - '6403a0478e3cfed91dcad53b5f02e71745c98d18ab53930f87aeff1da8d71d55' - #ipxe - '17bb27d95c86af8cc5e499b1b0db9b95bba3f45910d55b420f9f1f5452355fab' - '5d5fe7bf52cbae9da20cfd1fc798699b2355a1af907ebf7f764e227891a759bb' - '9f34f8ecb9a44c688275b838c83efd233bb817f5e222629eac98e116168d704c' - 'cdf7c4a089fe1fe493aafaf669decc3c9e071a0950da77dce526c09088d1c931' - '32595581467772b9fa0fbb5384c99caefeb2cee3306b94b9bd2722084454f5a2' - 'c73d1653b9b1d97ddce717817dc74429cd94c7b22989a08604eaa60df63f75f8' - '448caed900ada2c030738218f5b82f5e29d9dc2e1beef9ebd49cbeb23734df0d' - '61b1518c8d41792ec3b36e0fbfc265adb6c9304945a6fa18d6cc5a197e34b94f' - '577f06e38a9ecbd3576907f2ba1c5040f4f1573fe92912635230702ad157b2e7' - '80a24e9504d3893e83dc60550ffe364a873aaf3dafb52dcdade13f61f2ec0ee5' - 'be05ccd8975af402dcba3a3dc78c173319b2edd636bac11ac11163091453b704' - 'cace870b6629003b55d9df9ef24f3445067239b913c006b6e23da511c1a21d78' - 'a15d73e0fb51fe3c1cf8b80a5ff17d532444016d14495d90d9e642ec60f320a6' - #pkgbuild files - '7da2db54d35914284d60bb4474aff3538897dd3cf5065347b393d6e18a029292' - '92b8fc6679cc75bd993c8ead946eb1f212da03a52566b1c329d248fa1cdfe879' - '95f09bccc104d98c14559000823cb50f0d076f6a65b9f3b4e7725762b84ab5c7' - '3f0af16958c3e057b9baa5afc47050d9adf7dd553274dd97ae4f35938fefb568' - '50a9b7fd19e8beb1dea09755f07318f36be0b7ec53d3c9e74f3266a63e682c0c' - '40e0760810a49f925f2ae9f986940b40eba477dc6d3e83a78baaae096513b3cf' - - ## XSA patches - ) -if [ "$_build_stubdom" = true ] ; then + 'cade643fe3310d4d6f97d0c215c6fa323bc1130d7e64d7e2043ffaa73a96f33b' + 'SKIP' + '36deacb946c59ad1d6600f6e5b89d6a7a8961e65eb000900e184075920120f49' + + 'SKIP' + 'SKIP' + + 'd93c2d5bcdf0c3e4c6e8efb357cb4b9d618209025361f5ccd9d03651a8acd7a3' + '5fb65130f96d1728368a09042e55f622c14117572030ce2141bff4ae150e4a01' + 'a853a38b8fd661d6b99979831cdae014cd23d831b57a90a467400660343f23f6' + '81b93e8c9e0ecb0d8c0555892b27b7e6c39d961af33cdea53ac72070e3e741b2' + #'a8ce42777e22af49080131e174b6b89c6e7597539838fb8b17a12280fd10b10b' + '79d8ce76bdeb72a1583254f1fb80309e56428d7406a6605a5ec860dc5a1beb3d' + 'e042b0161d76ee9af7b113c46703dde2663f762d696f4290585be36d907e97a5' + '2be4efb8be044c9b2459d09f5a6390fecb218ed4cb38964bce0674882817b91a' + 'db21442e38be53d342c7574c7c17fb8ce45e57c11dd1ad99e60641ea4061653b' + '9135c1ca7aed28a86afc7a0feb2930bd95b4fabf865dd368e8912cc77d38fb33' + '826cc633cd1a5b5ae88f50c3d94647a4a108747e946c398eb88f1dcc069be2b8' + 'e5328145563a0e9a5f118f6d7b68468dca04d14bf97ab5699bf99d7d8b966f12' + 'c2b004ad976c050ec19986cbca6586d2c137959f11a0c3494146a4ccb1e5f9d4' + + #pkgbuild files + '330bcc5ab22e982d37495b57176d306353c220fec7c2b6c4a78a9133382a623e' + '7fa619845874e1a596acc5fb43b921496fba3014e04f40b2af462c51b02656ee' + '95f09bccc104d98c14559000823cb50f0d076f6a65b9f3b4e7725762b84ab5c7' + '50a9b7fd19e8beb1dea09755f07318f36be0b7ec53d3c9e74f3266a63e682c0c' + '40e0760810a49f925f2ae9f986940b40eba477dc6d3e83a78baaae096513b3cf' + + ## XSA patches +) + + +if [[ "$_build_stubdom" == true ]]; then sha256sums+=( - #stubdom bits - '772e4d550e07826665ed0528c071dd5404ef7dbe1825a38c8adbc2a00bca948f' - '1795c7d067a43174113fdf03447532f373e1c6c57c08d61d9e4e9be5e244b05e' - 'db426394965c48c1d29023e1cc6d965ea6b9a9035d8a849be2750ca4659a3d07' - 'f60ae61cfbd5da1d849d0beaa21f593c38dac9359f0b3ddc612f447408265b24' - '2d29fd04a0d0ba29dae6bd29fb418944c08d3916665dcca74afb297ef37584b6' - '4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b' - '4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459' - '936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775' - #'ecdd4f8473ab0dee5d3acb5c0a31a4c1dd6aa12179895cf1903dd0f455c43a4f' - - #stubdom patches - ) + #stubdom bits + '772e4d550e07826665ed0528c071dd5404ef7dbe1825a38c8adbc2a00bca948f' + '1795c7d067a43174113fdf03447532f373e1c6c57c08d61d9e4e9be5e244b05e' + 'db426394965c48c1d29023e1cc6d965ea6b9a9035d8a849be2750ca4659a3d07' + 'f60ae61cfbd5da1d849d0beaa21f593c38dac9359f0b3ddc612f447408265b24' + '2d29fd04a0d0ba29dae6bd29fb418944c08d3916665dcca74afb297ef37584b6' + '4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b' + '4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459' + '936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775' + 'ecdd4f8473ab0dee5d3acb5c0a31a4c1dd6aa12179895cf1903dd0f455c43a4f' + + #stubdom patches + ) fi +_xen_kconfig_debug=$(cat </dev/null 2>&1); then + #patch -Np1 -i "$srcdir/patch-build-efi-with-mingw.patch" + sed -i.bak '/ EFI_LD/s/LD/LD_EFI/' xen/arch/x86/Makefile + sed -i.bak 's/LD/LD_EFI/' xen/arch/x86/efi/Makefile + sed -i.bak '/EFI_MOUNTPOINT .*/aLD_EFI ?= $(LD)' xen/Makefile + else + echo '#Not capable of building xen.efi. Need either:' + echo '#(preferred) binutils compiled with --enable-targets=x86_64-pep' + echo '#or install mingw-w64-binutils' + fi fi # OVMF Compile support (Pulls from GIT repo, so patching to patch after pull request) - patch -Np1 -i "$srcdir/ovmf.patch" - cp "$srcdir/patch-gcc6-ovmf-build.sh.patch" tools/firmware/ + patch -Np1 -i "$srcdir/patch-ovmf-use-python2.patch" + patch -Np1 -i "$srcdir/patch-ovmf-apply-inbuild-patches.patch" + mkdir -p tools/firmware/ovmf-patches + patch -Np1 -i "$srcdir/patch-ovmf-patches-series.patch" + cp "$srcdir"/patch-inbuild-ovmf*.patch tools/firmware/ovmf-patches/ # Uncomment line below if you want to enable ATI Passthrough support (some reported successes, untested with 4.4) #patch -Np1 -i "$srcdir/ati-passthrough.patch" - ## GCC-6 - #etherboot - echo -e "patch-gcc6-etherboot-nonnull-compare.patch\npatch-gcc6-etherboot-rm-unused-string-functions.patch\npatch-gcc6-etherboot-nic.c.patch\npatch-gcc6-etherboot-ath.patch\npatch-gcc6-etherboot-sis190.patch\npatch-gcc6-etherboot-skge.patch\npatch-gcc6-etherboot-via-velocity.c.patch\npatch-gcc6-etherboot-via-rhine.c.patch\npatch-gcc6-etherboot-e1000_phy.c.patch\npatch-gcc6-etherboot-igb_phy.c.patch\npatch-gcc6-etherboot-link-header.patch\npatch-gcc6-etherboot-eth_broadcast.patch\npatch-gcc6-etherboot-ath9k-9287-array.patch" >> tools/firmware/etherboot/patches/series - cp ${srcdir}/patch-gcc6-etherboot-*.patch tools/firmware/etherboot/patches/ + ## Fix fixed rundir paths + ## grep -Rl '\/var\/run\/xen' * 2> /dev/null + _var_run_fixed_paths=( + tools/hotplug/Linux/locking.sh + tools/xenmon/xenbaked.c + tools/xenmon/xenmon.py + tools/pygrub/src/pygrub + ) + sed -i 's:/var/run:/run:' ${_var_run_fixed_paths[@]} - ## Fix Install Paths - sed -i 's:\$localstatedir/run/xen:/run/xen:' m4/paths.m4 - sed -i 's:/var/run:/run:' tools/ocaml/xenstored/define.ml - sed -i 's:/var/run:/run:' tools/ocaml/xenstored/systemd_stubs.c + ## Fix python version in shebang + echo 'Fix python shebang to python2' + _python_files=( $(grep -Rlse '^#!/usr/bin/.*python$' || : ) ) + sed -Ei 's|(^#!.*/usr/bin/(env ){0,1})python$|\1python2|' ${_python_files[@]} - if [ "$_build_stubdom" = true ] ; then + if [[ "$_build_stubdom" == true ]]; then # Copy supporting tarballs into place - cp "$srcdir/lwip-1.3.0.tar.gz" stubdom/ - cp "$srcdir/zlib-1.2.3.tar.gz" stubdom/ - cp "$srcdir/newlib-1.16.0.tar.gz" stubdom/ - cp "$srcdir/pciutils-2.2.9.tar.bz2" stubdom/ - cp "$srcdir/polarssl-1.1.4-gpl.tgz" stubdom/ - cp "$srcdir/grub-0.97.tar.gz" stubdom/ - cp "$srcdir/tpm_emulator-0.7.4.tar.gz" stubdom/ - cp "$srcdir/gmp-4.3.2.tar.bz2" stubdom/ - #cp "$srcdir/ocaml-3.11.0.tar.gz" stubdom/ + ln -s "$srcdir/lwip-1.3.0.tar.gz" stubdom/ + ln -s "$srcdir/zlib-1.2.3.tar.gz" stubdom/ + ln -s "$srcdir/newlib-1.16.0.tar.gz" stubdom/ + ln -s "$srcdir/pciutils-2.2.9.tar.bz2" stubdom/ + ln -s "$srcdir/polarssl-1.1.4-gpl.tgz" stubdom/ + ln -s "$srcdir/grub-0.97.tar.gz" stubdom/ + ln -s "$srcdir/tpm_emulator-0.7.4.tar.gz" stubdom/ + ln -s "$srcdir/gmp-4.3.2.tar.bz2" stubdom/ + ln -s "$srcdir/ocaml-3.11.0.tar.gz" stubdom/ ## Stubdom patches cd 'extras/mini-os' + patch -Np1 -i "$srcdir/patch-gcc7-minios-udivmod.patch" cd '../../' + #vtpm + patch -Np1 -i "$srcdir/patch-gcc7-vtpmmgr-make-inline-static.patch" + patch -Np1 -i "$srcdir/patch-gcc7-vtpm-implicit-fallthrough.patch" fi #etherboot - cp "$srcdir/ipxe-git-9a93db3f0947484e30e753bbd61a10b17336e20e.tar.gz" tools/firmware/etherboot/ipxe.tar.gz - - #Workaround for cannot compute sizeof (unsigned short) - #Makefile:170: recipe for target 'gmp-x86_64' failed - #Probably not safe! - #sed -i.bak "/< gmp.patch/a\ sed -i.bak 's/\\\\(\\\\s*\\\\)\\\\(fprintf (f,\\\\)\\\\(.*\\\\)/\\\\1\\\\2\\\\3\\\\n\\\\1clearerr(f);/' \$@/configure" stubdom/Makefile - - + ln -s "$srcdir/ipxe-git-$_git_tag_ipxe.tar.gz" tools/firmware/etherboot/ipxe.tar.gz + patch -Np1 -i "$srcdir/patch-ipxe-patches-series.patch" + cp "$srcdir"/patch-inbuild-ipxe*.patch tools/firmware/etherboot/patches/ } build() { - cd "$pkgname-$pkgver/" - export LD_EFI="/usr/x86_64-w64-mingw32/bin/ld" + cd "$_pkgname-$_pkgver/" + export LD_EFI='/usr/x86_64-w64-mingw32/bin/ld' ./autogen.sh - if [ "$_build_stubdom" = true ] ; then - _config_stubdom='--enable-stubdom' + if [[ "$_build_stubdom" == true ]]; then + _config_stubdom=(--enable-stubdom) + _config_stubdom+=( + #--enable-ioemu-stubdom=no + #--enable-c-stubdom=no + #--enable-caml-stubdom=no + #--enable-pv-grub=no + #--enable-xenstore-stubdom=no + #--enable-vtpm-stubdom=no + #--enable-vtpmmgr-stubdom=no + ) + else + _config_stubdom=(--disable-stubdom) fi - ./configure PYTHON=/usr/bin/python2 --prefix=/usr --sbindir=/usr/bin --with-sysconfig-leaf-dir=conf.d --with-initddir=/etc/init.d \ - --enable-systemd --disable-docs --enable-ovmf \ - "${_config_stubdom:---disable-stubdom}" \ - --with-extra-qemuu-configure-args="--disable-bluez --disable-gtk --enable-spice --enable-usb-redir" + _config_seabios=() + if [[ "$_system_seabios" == true ]]; then + _config_seabios=(--with-system-seabios=/usr/share/qemu/bios-256k.bin) + fi + _config_xen_kconfig='' + _config_debug=() + if [[ "$_build_debug" == true ]]; then + _config_debug=(--enable-debug --enable-debug-tcg --enable-debug-info) + _config_xen_kconfig+="\n$_xen_kconfig_debug" + _makevars+=(debug=y CONFIG_DEBUG=y) + fi + if [[ "$_build_livepatch" == true ]]; then + _config_xen_kconfig+="\n$_xen_kconfig_livepatch" + fi + if [[ -n "$_config_xen_kconfig" ]]; then + cd xen + echo -e "$_config_xen_kconfig" > .config + make "${_makevars[@]}" olddefconfig V=1 + cd ../ + fi + ./configure PYTHON=/usr/bin/python2 --prefix=/usr --sbindir=/usr/bin --with-sysconfig-leaf-dir=conf.d --with-rundir=/run \ + --enable-systemd --enable-ovmf \ + "${_config_seabios[@]}" \ + "${_config_stubdom[@]}" \ + "${_config_debug[@]}" \ + --with-extra-qemuu-configure-args='--disable-bluez --disable-gtk --enable-spice --enable-usb-redir' #--with-system-qemu --with-system-seabios --with-system-ovmf #defaults --enable-qemu-traditional --enable-rombios \ - make LANG=C PYTHON=python2 dist-misc - make LANG=C PYTHON=python2 dist-xen - make LANG=C PYTHON=python2 dist-tools - if [ "$_build_stubdom" = true ] ; then - make LANG=C PYTHON=python2 dist-stubdom + make "${_makevars[@]}" dist + if [[ "$_build_livepatch" == true ]]; then + make "${_makevars[@]}" build-tests fi } -package() { - cd "$pkgname-$pkgver/" +package_xen() { + _makevars_package=("${_makevars[@]}" DESTDIR="$pkgdir") + optdepends=( + 'xen-docs: Official Xen documentation' + 'openvswitch: Optional advanced networking support' + 'urlgrabber: Required for xenpvnetboot' + ) + conflicts=(xen-{git,rc,igvtg,4.{5,6,7}} xenstore) + provides=(xenstore) + replaces=(xen-{git,rc,4.{5,6,7}}) + backup=( + etc/conf.d/xen{domains,commons} + "etc/$_pkgname/grub.conf" + "etc/$_pkgname/oxenstored.conf" + "etc/$_pkgname/xl.conf" + ) + install="$_pkgname.install" + + cd "$_pkgname-$_pkgver/" - make DESTDIR="$pkgdir" LANG=C PYTHON=python2 install + make "${_makevars_package[@]}" install-xen + make "${_makevars_package[@]}" install-tools + if [[ "$_build_stubdom" == true ]]; then + make "${_makevars_package[@]}" install-stubdom + fi + if [[ "$_build_livepatch" == true ]]; then + make "${_makevars_package[@]}" install-tests + fi cd "$pkgdir" # Install files from Parabola package - install -Dm644 "$srcdir/tmpfiles.d-$pkgname.conf" usr/lib/tmpfiles.d/$pkgname.conf - install -Dm644 "$srcdir/grub.conf" etc/xen/grub.conf - install -Dm755 "$srcdir/09_xen" etc/grub.d/09_xen + install -Dm644 "$srcdir/tmpfiles.d-$_pkgname.conf" "usr/lib/tmpfiles.d/$_pkgname.conf" + install -Dm755 "$srcdir/21_linux_xen_multiboot_arch" etc/grub.d/21_linux_xen_multiboot_arch install -Dm644 "$srcdir/efi-xen.cfg" etc/xen/efi-xen.cfg - # Fix paths in scripts, move to right locations and create missing directories - sed -i 's:/var/run:/run:' etc/init.d/xencommons - sed -i 's:/var/lock:/run/lock:' etc/xen/scripts/hotplugpath.sh - sed -i 's:/var/run:/run:' etc/xen/scripts/locking.sh - sed -i 's:/var/run:/run:' usr/lib/systemd/system/xenstored.service - sed -i 's:/var/run:/run:' usr/lib/systemd/system/xenstored.socket - sed -i 's:/var/run:/run:' usr/lib/systemd/system/xenstored_ro.socket - - mkdir var/log/xen/console + mkdir -p var/log/xen/console # Sanitize library path (if lib64 exists) if [[ -d usr/lib64 ]]; then cd usr/ - cp -r lib64/* lib/ - rm -rf lib64 - cd ../ + mv lib64/* lib/ + rmdir lib64 + cd ../ fi - # If EFI binaries build, move to /boot + # If EFI binaries built, move to /boot if [[ -f usr/lib/efi/xen.efi ]]; then - mv usr/lib/efi/xen-$pkgver.efi boot/xen-$pkgver.efi - rm -rf usr/lib/efi + mv usr/lib/efi/*.efi boot/ + rmdir usr/lib/efi fi - # Compress syms file and move to a share location - #gzip boot/$pkgname-syms-* - #mv boot/$pkgname-syms-*.gz usr/share/xen + # Remove syms + find usr/lib/debug -type f \( -name '*-syms*' -or -name '*\.map' \) -delete + rmdir --ignore-fail-on-non-empty usr/lib/debug - ##### Kill unwanted stuff ##### - # hypervisor symlinks - rm -f boot/xen{,-4,-4.7,-4.7-rc}.gz + # Remove hypervisor boot symlinks + rm -f boot/xen{,-4{,.8,.9}}{,.{gz,efi}} # Documentation cleanup ( see xen-docs package ) - rm -rf usr/share/doc - rm -rf usr/share/man - - # Unnecessary qemu support files -# rm -rf usr/bin/qemu-*-xen - rm usr/share/qemu-xen/qemu/{palcode,openbios}-* - rm usr/share/xen/qemu/openbios-* + #rm -rf usr/share/doc + #rm -rf usr/share/man + + # Remove tempdirs + rmdir run/xen{,stored} + rmdir run + + # Remove unnecessary qemu ELF support files + # qemuu + rm -f usr/share/qemu-xen/qemu/{palcode,openbios,s390}-* + rm -f usr/share/qemu-xen/qemu/u-boot.e500 + # qemut + if [[ "$CARCH" == *'x86'* ]]; then + rm -f usr/share/xen/qemu/openbios-* + fi # adhere to Static Library Packaging Guidelines rm -rf usr/lib/*.a + # Remove unneeded init.d files + rm -rf etc/init.d +} + +package_xen-docs(){ + _makevars_package=("${_makevars[@]}" DESTDIR="$pkgdir") + pkgdesc='Xen virtual machine hypervisor documentation' + arch=('any') + depends=() + cd "$_pkgname-$_pkgver/" + make "${_makevars_package[@]}" install-docs +} + +package_xen-syms(){ + _makevars_package=("${_makevars[@]}" DESTDIR="$pkgdir") + pkgdesc='Xen virtual machine hypervisor debugging symbols' + arch=('any') + depends=() + _installdir="${pkgdir}/usr/lib/debug" + cd "$_pkgname-$_pkgver/" + install -d -m0755 "$_installdir" + for _path in $(find xen -type f \( -name '*-syms' -or -name '*\.map' \)); do + _file=$(basename "$_path") + _installfile=$(echo "$_file" | + sed "s/\([^.]*\)\(\.*\)/\1-${_pkgver}\2/" ) + install -D -m0644 -p "$_path" "$_installdir/$_installfile" + done } diff --git a/pcr/xen/patch-gcc7-minios-udivmod.patch b/pcr/xen/patch-gcc7-minios-udivmod.patch new file mode 100644 index 000000000..8b67c3415 --- /dev/null +++ b/pcr/xen/patch-gcc7-minios-udivmod.patch @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + +patch-gcc7-minios-udivmod.patch · master · John Thomson / aur-xen · GitLab + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + + +
+
+
+
+ + +patch-gcc7-minios-udivmod.patch + + + +1.3 KB + +
+ + +
+ + + +
+
+ +
+ +
+ + +
+
+ +
+
+ +
+
+
+
+ + + + + diff --git a/pcr/xen/patch-gcc7-vtpm-implicit-fallthrough.patch b/pcr/xen/patch-gcc7-vtpm-implicit-fallthrough.patch new file mode 100644 index 000000000..69a025942 --- /dev/null +++ b/pcr/xen/patch-gcc7-vtpm-implicit-fallthrough.patch @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + +patch-gcc7-vtpm-implicit-fallthrough.patch · master · John Thomson / aur-xen · GitLab + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + + +
+
+
+
+ + +patch-gcc7-vtpm-implicit-fallthrough.patch + + + +1.91 KB + +
+ + +
+ + + +
+
+ +
+ +
+ + +
+
+ +
+
+ +
+
+
+
+ + + + + diff --git a/pcr/xen/patch-gcc7-vtpmmgr-make-inline-static.patch b/pcr/xen/patch-gcc7-vtpmmgr-make-inline-static.patch new file mode 100644 index 000000000..4238d3d66 --- /dev/null +++ b/pcr/xen/patch-gcc7-vtpmmgr-make-inline-static.patch @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + +patch-gcc7-vtpmmgr-make-inline-static.patch · master · John Thomson / aur-xen · GitLab + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + + +
+
+
+
+ + +patch-gcc7-vtpmmgr-make-inline-static.patch + + + +37.4 KB + +
+ + +
+ + + +
+
+ +
+ +
+ + +
+
+ +
+
+ +
+
+
+
+ + + + + diff --git a/pcr/xen/patch-ipxe-patches-series.patch b/pcr/xen/patch-ipxe-patches-series.patch new file mode 100644 index 000000000..30e916417 --- /dev/null +++ b/pcr/xen/patch-ipxe-patches-series.patch @@ -0,0 +1,18 @@ +Subject: [PATCH] Fix gcc7 warn + +--- + tools/firmware/etherboot/patches/series | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/tools/firmware/etherboot/patches/series b/tools/firmware/etherboot/patches/series +index 86cb300..780c6c6 100644 +--- a/tools/firmware/etherboot/patches/series ++++ b/tools/firmware/etherboot/patches/series +@@ -1 +1,4 @@ + boot_prompt_option.patch ++patch-inbuild-ipxe-gcc7-implicit-fallthrough.patch ++patch-inbuild-ipxe-gcc7-implicit-fallthrough-ath5k.patch ++patch-inbuild-ipxe-gcc7-implicit-fallthrough-curses.patch +-- +2.13.0 + diff --git a/pcr/xen/patch-ovmf-apply-inbuild-patches.patch b/pcr/xen/patch-ovmf-apply-inbuild-patches.patch new file mode 100644 index 000000000..2c2f3ed75 --- /dev/null +++ b/pcr/xen/patch-ovmf-apply-inbuild-patches.patch @@ -0,0 +1,26 @@ +From 088d0d605131eeb43dc1c4ab21631ea7e51f8501 Mon Sep 17 00:00:00 2001 +From: John Thomson +Date: Sat, 24 Jun 2017 09:38:13 +1000 +Subject: [PATCH] Fix OVMF apply patches series + +--- + tools/firmware/Makefile | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile +index a5a6802..875e7e5 100644 +--- a/tools/firmware/Makefile ++++ b/tools/firmware/Makefile +@@ -20,6 +20,9 @@ ovmf-dir: + sed 's|python |python2 |g' -i "ovmf-dir/BaseTools/BinWrappers/PosixLike"/* || true + sed 's|python |python2 |g' -i "ovmf-dir/BaseTools/Tests/GNUmakefile" + cp ovmf-makefile ovmf-dir/Makefile; ++ for i in $$(cat ovmf-patches/series); do \ ++ patch -d ovmf-dir -Np1 < ovmf-patches/$$i || exit 1; \ ++ done + + seabios-dir: + GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_REVISION) seabios-dir +-- +2.13.1 + diff --git a/pcr/xen/patch-ovmf-patches-series.patch b/pcr/xen/patch-ovmf-patches-series.patch new file mode 100644 index 000000000..0f230e504 --- /dev/null +++ b/pcr/xen/patch-ovmf-patches-series.patch @@ -0,0 +1,20 @@ +From 30f9f61c42b9530332a856a5bc09db52c446289d Mon Sep 17 00:00:00 2001 +From: John Thomson +Date: Sat, 24 Jun 2017 09:48:02 +1000 +Subject: [PATCH] Add ovmf patches series file + +--- + tools/firmware/ovmf-patches/series | 1 + + 1 file changed, 1 insertion(+) + create mode 100644 tools/firmware/ovmf-patches/series + +diff --git a/tools/firmware/ovmf-patches/series b/tools/firmware/ovmf-patches/series +new file mode 100644 +index 0000000..ac6bda5 +--- /dev/null ++++ b/tools/firmware/ovmf-patches/series +@@ -0,0 +1 @@ ++patch-inbuild-ovmf-5-hiilib.c-pointer-zero.patch +-- +2.13.1 + diff --git a/pcr/xen/patch-ovmf-use-python2.patch b/pcr/xen/patch-ovmf-use-python2.patch new file mode 100644 index 000000000..b52b9230c --- /dev/null +++ b/pcr/xen/patch-ovmf-use-python2.patch @@ -0,0 +1,22 @@ +Subject: [PATCH] Fix ovmf, use python2 + +--- + tools/firmware/Makefile | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile +index b840c6a..a5a6802 100644 +--- a/tools/firmware/Makefile ++++ b/tools/firmware/Makefile +@@ -17,6 +17,8 @@ LD32BIT-$(CONFIG_FreeBSD) := LD32BIT_FLAG=-melf_i386_fbsd + + ovmf-dir: + GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf-dir ++ sed 's|python |python2 |g' -i "ovmf-dir/BaseTools/BinWrappers/PosixLike"/* || true ++ sed 's|python |python2 |g' -i "ovmf-dir/BaseTools/Tests/GNUmakefile" + cp ovmf-makefile ovmf-dir/Makefile; + + seabios-dir: +-- +2.13.0 + diff --git a/pcr/xen/xen.install b/pcr/xen/xen.install index f48de62f8..f629e6643 100644 --- a/pcr/xen/xen.install +++ b/pcr/xen/xen.install @@ -1,17 +1,64 @@ +xen_boot() { + cat << __EOF__ +You are not running xen unless you boot xen. +Possible Xen boot paths: +EFI boot -> grubx64.efi -> multiboot2 -> [xen.gz, vmlinuz, ramdisk] +BIOS boot -> grub -> multiboot(2) -> [xen.gz, vmlinuz, ramdisk] + +EFI boot -> xen.efi + +########## +grub multiboot2 preparation: +Install grub: https://wiki.parabola.nu/index.php/GRUB + +At this time, some modifications are needed to 20_linux_xen. +These are included in this package as 21_linux_xen + +Set the values needed for your configuration in /etc/default/grub +Detailed here: https://www.gnu.org/software/grub/manual/html_node/Simple-configuration.html +Needed: +GRUB_CMDLINE_XEN +GRUB_CMDLINE_LINUX_XEN_REPLACE +These values are not required but can be used; they are appended to the previous values, then this is used for the non-recovery (default) entry: +GRUB_CMDLINE_XEN_DEFAULT +GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT + +run grub-mkconfig + +To boot xen as default: +suggested: inspect and use this config to boot with. Check if the xen entry works as expected +find the id of the xen entry and set this as DEFAULT in /etc/default/grub. +This may look something like: +GRUB_DEFAULT="xen-gnulinux-simple-a-unique-id-from-your-grub-goes-here" + +run grub-mkconfig + +########## + +Direct EFI boot preperation: +Create a xen.cfg file in the same directory as xen.efi. +These need to be in ESP, or in a directory accessible from you EFI bootloader. +Put settings relevant to your system into xen.cfg +Detailed here: https://xenbits.xen.org/docs/4.9-testing/misc/efi.html +Needed: +kernel +ramdisk +Add the xen.efi file to your EFI bootloader (such as Refind). +And / or add the xen.efi file to you EFI boot options (efibootmgr). +__EOF__ +} + install_msg() { cat << __EOF__ ===> IMPORTANT NOTICES: In order to complete the installation, and enable Xen, at the very least you must: -1. If using GRUB2, edit your GRUB2 config files as specified at - https://wiki.parabola.nu/index.php/Xen#Bootloader_Configuration - - Support for the grub-mkconfig command was added, and will auto-discover - the deployed xen hypervisor and linux kernel -2. If booting via efi, copy the example /etc/xen/efi-xen.cfg to /boot/xen.cfg - and edit the contents to match the settings you need. -3. Issue the following commands to allow you to create and start VMs: +1. Configure your bootloader to boot Xen: +__EOF__ + xen_boot + cat << __EOF__ +2. Issue the following commands to allow you to create and start VMs: systemctl enable xen-qemu-dom0-disk-backend.service systemctl enable xen-init-dom0.service @@ -20,34 +67,52 @@ at the very least you must: Other optional services are: systemctl enable xen-watchdog.service -4. If you want some domains to automatically start up/shutdown, run the following: +3. If you want some domains to automatically start up/shutdown, run the following: systemctl enable xendomains.service For more information refer to the Wiki: https://wiki.parabola.nu/index.php/Xen __EOF__ - } upgrade_msg() { cat << __EOF__ -Xen 4.7 +Xen 4.9 Release notes -http://wiki.xen.org/wiki/Xen_Project_4.7_Release_Notes +http://wiki.xen.org/wiki/Xen_Project_4.9_Release_Notes Feature list -http://wiki.xen.org/wiki/Xen_Project_4.7_Feature_List +http://wiki.xen.org/wiki/Xen_Project_4.9_Feature_List __EOF__ +} +upgrade_msg_grub_multiboot2() { + cat << __EOF__ +########## +Xen 4.9 can now use grub>=2.02 multiboot2. +If you previously booted using xen.efi, you have an alternative. +If you previously relied on the packaged 09_xen for grub-mkconfig: +It is now removed. +You will need to do the following under grub multiboot2 preparation: +########## +__EOF__ + xen_boot } post_install() { install_msg upgrade_msg + systemd-tmpfiles --create } post_upgrade() { - upgrade_msg + if [[ "$2" < 4.9.0 || "$2" == *'4.9.0rc'* ]]; then + upgrade_msg + fi + if [[ "$2" < 4.9.0 || "$2" == *'4.9.0rc'* ]]; then + upgrade_msg_grub_multiboot2 + fi + systemd-tmpfiles --create } pre_remove() { -- cgit v1.2.3