heads/patches/xen-4.8.2-11.patch
Francis Lam 491fe083fa
Update qubes xen version for QSB 36
For Qubes 3.2: version 4.6.6-35
For Qubes 4.0: version 4.8.2-11
2017-12-02 14:47:52 -05:00

131 lines
4.1 KiB
Diff

diff --git ./Makefile ./Makefile
index 75df729..4113caa 100644
--- ./Makefile
+++ ./Makefile
@@ -122,6 +122,7 @@ verrel:
.PHONY: clean
clean::
+ rm -rf xen-$(version)/
@echo "Running the %clean script of the rpmbuild..."
-$(RPMBUILD) --clean --nodeps $(SPECFILE)
@@ -153,6 +154,14 @@ update-repo-installer:
for pkg in $(xen-pkgs); do ln -f rpm/x86_64/$$pkg*.rpm ../installer/yum/qubes-dom0/rpm/; done
ln -f rpm/x86_64/xen-hvm-$(version)gui2*-$(release).$(DIST_DOM0)*.rpm ../installer/yum/qubes-dom0/rpm/
+xen-$(version)/.canary: xen-$(version).tar.gz
+ tar xzvf xen-$(version).tar.gz
+ cd xen-$(version) && ../apply-patches ../series.conf ../
+ touch $@
+
+xen.gz: xen-$(version)/.canary
+ $(MAKE) -C xen-$(version)/ xen
+
help:
@echo "Usage: make <target>"
@echo
diff --git ./apply-patches ./apply-patches
index b1c8468..74a4c20 100755
--- ./apply-patches
+++ ./apply-patches
@@ -6,8 +6,7 @@
USAGE="$0 [--vanilla] <series.conf> <patchdir> [symbol ...]"
-set -e
-set -o pipefail
+set -euf
if test $# -lt 2; then
echo "$USAGE" >&2
exit 1
@@ -17,10 +16,7 @@ SERIES_CONF=$1
PATCH_DIR=$2
shift 2
-(
- echo "trap 'echo \"*** patch \$_ failed ***\"' ERR"
- echo "set -ex"
- egrep -v '^\s*#|^\s*$' <"$SERIES_CONF" | \
- sed "s|^|patch -s -F0 -E -p1 --no-backup-if-mismatch -i $PATCH_DIR/|"
-) | sh
-
+for i in `egrep -v '^\s*#|^\s*$' < $SERIES_CONF`
+do
+ patch -s -F0 -E -p1 --no-backup-if-mismatch -i $PATCH_DIR/$i
+done
diff --git ./patches.heads/heads.patch ./patches.heads/heads.patch
new file mode 100644
index 0000000..d956f8a
--- /dev/null
+++ ./patches.heads/heads.patch
@@ -0,0 +1,54 @@
+diff -u --recursive xen-4.8.2-clean/xen/arch/x86/boot/head.S xen-4.8.2/xen/arch/x86/boot/head.S
+--- xen-4.8.2-clean/xen/arch/x86/boot/head.S 2017-09-06 06:26:35.000000000 -0400
++++ xen-4.8.2/xen/arch/x86/boot/head.S 2017-09-13 21:58:31.186882703 -0400
+@@ -86,6 +86,8 @@
+ cmp $MULTIBOOT_BOOTLOADER_MAGIC,%eax
+ jne not_multiboot
+
++#if 0
++
+ /* Set up trampoline segment 64k below EBDA */
+ movzwl 0x40e,%ecx /* EBDA segment */
+ cmp $0xa000,%ecx /* sanity check (high) */
+@@ -108,6 +110,12 @@
+ shl $10-4,%edx
+ cmp %ecx,%edx /* compare with BDA value */
+ cmovb %edx,%ecx /* and use the smaller */
++#else
++ // coreboot does not provide an Extended BIOS Data Area pointer
++ // just stash things the Multiboot structure, adjusted to bytes
++ mov MB_mem_lower(%ebx),%ecx
++ shl $10-4,%ecx
++#endif
+
+ 2: /* Reserve 64kb for the trampoline */
+ sub $0x1000,%ecx
+diff -u --recursive xen-4.8.2-clean/xen/arch/x86/boot/mkelf32.c xen-4.8.2/xen/arch/x86/boot/mkelf32.c
+--- xen-4.8.2-clean/xen/arch/x86/boot/mkelf32.c 2017-09-06 06:26:35.000000000 -0400
++++ xen-4.8.2/xen/arch/x86/boot/mkelf32.c 2017-09-13 21:58:31.186882703 -0400
+@@ -264,10 +264,10 @@
+ int bytes, todo, i = 1;
+ int num_phdrs = 1;
+
+- Elf32_Ehdr in32_ehdr;
++ Elf32_Ehdr in32_ehdr = {};
+
+- Elf64_Ehdr in64_ehdr;
+- Elf64_Phdr in64_phdr;
++ Elf64_Ehdr in64_ehdr = {};
++ Elf64_Phdr in64_phdr = {};
+
+ if ( argc < 5 )
+ {
+diff -u --recursive xen-4.8.2-clean/xen/Makefile xen-4.8.2/xen/Makefile
+--- xen-4.8.2-clean/xen/Makefile 2017-09-06 06:26:35.000000000 -0400
++++ xen-4.8.2/xen/Makefile 2017-09-13 21:58:31.186882703 -0400
+@@ -152,7 +152,7 @@
+ fi
+
+ .banner: Makefile
+- @if which figlet >/dev/null 2>&1 ; then \
++ @if false ; then \
+ echo " Xen $(XEN_FULLVERSION)" | figlet -f tools/xen.flf > $@.tmp; \
+ else \
+ echo " Xen $(XEN_FULLVERSION)" > $@.tmp; \
diff --git ./series.conf ./series.conf
index 750ec6c..0706300 100644
--- ./series.conf
+++ ./series.conf
@@ -97,6 +97,9 @@ patches.qubes/xenconsoled-enable-logging.patch
patches.qubes/vm-0001-hotplug-do-not-attempt-to-remove-containing-xenstore.patch
patches.qubes/xen-hotplug-qubesdb-update.patch
+# Custom patches for Heads
+patches.heads/heads.patch
+
#python3
patches.misc/0001-python-check-return-value-of-PyErr_NewException.patch
patches.misc/0002-python-drop-tp_getattr-implementation.patch