aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-02-12 10:44:07 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-02-12 10:50:12 +0000
commit97935b308484879fd7117fcaf46cffa84552caaf (patch)
treee593c3271f81f72eb3f2f801a13fd4852e60e63a /main
parentcd46eba6f617f9d99d6485c14d2375fb4bdd68ca (diff)
downloadaports-97935b308484879fd7117fcaf46cffa84552caaf.tar.bz2
aports-97935b308484879fd7117fcaf46cffa84552caaf.tar.xz
main/xen: upgrade to 4.1.2
Diffstat (limited to 'main')
-rw-r--r--main/xen/APKBUILD86
-rw-r--r--main/xen/blktap-write.patch24
-rw-r--r--main/xen/blktap2_libvhd_add_iconv.patch31
-rw-r--r--main/xen/busybox-sed.patch11
-rw-r--r--main/xen/define_fsimage_dir.patch12
-rw-r--r--main/xen/detect_libiconv.patch22
-rw-r--r--main/xen/fix_bswap_blktap.patch61
-rw-r--r--main/xen/fix_bswap_blktap2.patch62
-rw-r--r--main/xen/fix_ipxe_no_pie_default.patch165
-rw-r--r--main/xen/librt.patch11
-rw-r--r--main/xen/pygrub_alpine.patch64
-rw-r--r--main/xen/xen-blktap-uclibc.patch11
-rw-r--r--main/xen/xen-blktap2-uclibc.patch22
-rw-r--r--main/xen/xen-disable-firmware.patch10
-rw-r--r--main/xen/xen-dont-use-lib64.patch11
-rw-r--r--main/xen/xen-gcc-4.6-Werror-fix.patch36
-rw-r--r--main/xen/xen-gcc-4.6-hvmloader-is-broken.patch733
-rw-r--r--main/xen/xen-sed-is-broken-hack.patch11
-rw-r--r--main/xen/xen-x86-pic.patch19
-rw-r--r--[-rwxr-xr-x]main/xen/xencommons.initd133
-rw-r--r--main/xen/xend.initd39
-rw-r--r--main/xen/xendomains.initd68
22 files changed, 633 insertions, 1009 deletions
diff --git a/main/xen/APKBUILD b/main/xen/APKBUILD
index b427fbd374..0fe61ee06d 100644
--- a/main/xen/APKBUILD
+++ b/main/xen/APKBUILD
@@ -1,70 +1,67 @@
# Contributor: William Pitcock <nenolod@dereferenced.org>
+# Contributor: Roger Pau Monne <roger.pau@entel.upc.edu>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=xen
-pkgver=4.1.1
-pkgrel=2
+pkgver=4.1.2
+pkgrel=3
pkgdesc="Xen hypervisor"
url="http://www.xen.org/"
+arch="x86 x86_64"
license="GPL"
-depends="coreutils python sed gawk"
-makedepends="libgcrypt-dev gnutls-dev pciutils-dev texinfo wget mesa-dev sdl-dev zlib-dev openssl-dev util-linux-dev python-dev gettext-dev ncurses-dev perl"
-install=
+depends="udev syslinux bash"
+depends_dev="openssl-dev python-dev e2fsprogs-dev gettext zlib-dev ncurses-dev
+ libiconv-dev dev86 texinfo perl iasl pciutils-dev"
+makedepends="$depends_dev"
+install=""
subpackages="$pkgname-doc"
source="http://bits.xensource.com/oss-xen/release/$pkgver/$pkgname-$pkgver.tar.gz
- xen-blktap-uclibc.patch
- xen-blktap2-uclibc.patch
- xen-disable-firmware.patch
- xen-dont-use-lib64.patch
- xen-sed-is-broken-hack.patch
- blktap-write.patch
- xen-x86-pic.patch
- xen-gcc-4.6-Werror-fix.patch
- xen-gcc-4.6-hvmloader-is-broken.patch
+ blktap2_libvhd_add_iconv.patch
+ detect_libiconv.patch
+ fix_bswap_blktap.patch
+ fix_bswap_blktap2.patch
+ fix_ipxe_no_pie_default.patch
+ define_fsimage_dir.patch
+ pygrub_alpine.patch
+ librt.patch
+ busybox-sed.patch
xencommons.initd
xend.initd
xendomains.initd"
-arch="x86 x86_64"
_builddir="$srcdir"/$pkgname-$pkgver
-
prepare() {
+ local i
cd "$_builddir"
-
- msg "Patching sources..."
for i in $source; do
case $i in
- *.patch)
- msg "Applying $i..."
- patch -s -p1 -N -i "$srcdir"/$i || return 1
- ;;
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
- msg "Sources have been patched successfully."
# remove all -Werror
msg "Eradicating -Werror..."
find -name '*.mk' -o -name 'Make*' | xargs sed -i -e 's/-Werror//g'
+
+ echo "LIBLEAFDIR_x86_64=lib" >> .config
}
build() {
cd "$_builddir"
- # We unset $CFLAGS and $LDFLAGS because Xen's buildsystem does not
- # like these values being set. Arguably this is a bug but I can't be
- # bothered to track it down. --nenolod
+ # Unset CFLAGS and LDFLAGS because the xen build system
+ # doesn't support them. Instead use .config in xen root
+ # folder if necessary.
unset CFLAGS
unset LDFLAGS
- # If we provide no parameters it tries to build a kernel image. We
- # definitely don't want that.
msg "Running preflight check..."
(cd tools/check; ./chk build) || return 1
msg "Building hypervisor..."
- make -j1 xen || return 1
+ make xen || return 1
msg "Building tools..."
- make -j1 tools || return 1
+ make tools || return 1
msg "Building stub domains..."
make -j1 stubdom || return 1
@@ -73,9 +70,6 @@ build() {
package() {
cd "$_builddir"
- # We unset $CFLAGS and $LDFLAGS because Xen's buildsystem does not
- # like these values being set. Arguably this is a bug but I can't be
- # bothered to track it down. --nenolod
unset CFLAGS
unset LDFLAGS
@@ -87,16 +81,16 @@ package() {
install -m755 -D "$srcdir"/xendomains.initd "$pkgdir"/etc/init.d/xendomains
}
-md5sums="fab4bf74d73444ff9b43bced2e4fc5a2 xen-4.1.1.tar.gz
-edb5c3e7fba8214702fac709f0e53124 xen-blktap-uclibc.patch
-1f7f847ae0baa915c7b52d0ed5869fe6 xen-blktap2-uclibc.patch
-a569f16a7e3c832ba3fab6154f657244 xen-disable-firmware.patch
-20ce621f3a2fc8ae78e74b9b72da775c xen-dont-use-lib64.patch
-0cec6a97de9e4bc178f3e71190495cc3 xen-sed-is-broken-hack.patch
-56af00443c8d40944082e26304452a5e blktap-write.patch
-c4fc42b11c5917a93f66acf0f83a8747 xen-x86-pic.patch
-faafc199fa8cf33aac44e41c9e1659ea xen-gcc-4.6-Werror-fix.patch
-202dae12f61f4068971cf9b0f47081da xen-gcc-4.6-hvmloader-is-broken.patch
-0b62c1fbe2699a32e745724fd301db5b xencommons.initd
-5ee6a16ec70dfbcd4944ded71b393fa2 xend.initd
-a2b5234483f1b5892d22e9315d9c307f xendomains.initd"
+md5sums="73561faf3c1b5e36ec5c089b5db848ad xen-4.1.2.tar.gz
+6d4b045ae56be6288733d0e078f591ea blktap2_libvhd_add_iconv.patch
+ed3283697cb1ddff066f4087eabf68c6 detect_libiconv.patch
+503f0883f4a0b50fe4e37e09ed9a6177 fix_bswap_blktap.patch
+b973dc1ffcc6872e222b36f3b7b4836b fix_bswap_blktap2.patch
+10dcf0b6a05691e9f88afc01bd414480 fix_ipxe_no_pie_default.patch
+0bb8a435020a5a49b38b1a447fb69977 define_fsimage_dir.patch
+a7500c42804abdf68e051dc667e65f93 pygrub_alpine.patch
+fa06495a175571f4aa3b6cb88937953e librt.patch
+1bea3543ddc712330527b62fd9ff6520 busybox-sed.patch
+4cf88b53f8ca8d99ad52bae419b620a7 xencommons.initd
+b5bfc08b82bc0d21193714719a719798 xend.initd
+86e7923383a906404da321d1814657e9 xendomains.initd"
diff --git a/main/xen/blktap-write.patch b/main/xen/blktap-write.patch
deleted file mode 100644
index 4b589daec2..0000000000
--- a/main/xen/blktap-write.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- ./tools/blktap2/include/blktaplib.h.orig
-+++ ./tools/blktap2/include/blktaplib.h
-@@ -198,7 +198,9 @@
- } msg_lock_t;
-
- #define READ 0
-+#ifndef WRITE
- #define WRITE 1
-+#endif
-
- /*Control Messages between manager and tapdev*/
- #define CTLMSG_PARAMS 1
---- ./tools/blktap/lib/blktaplib.h.orig
-+++ ./tools/blktap/lib/blktaplib.h
-@@ -196,7 +196,9 @@
- } msg_pid_t;
-
- #define READ 0
-+#ifndef WRITE
- #define WRITE 1
-+#endif
-
- /*Control Messages between manager and tapdev*/
- #define CTLMSG_PARAMS 1
diff --git a/main/xen/blktap2_libvhd_add_iconv.patch b/main/xen/blktap2_libvhd_add_iconv.patch
new file mode 100644
index 0000000000..2353e38a6b
--- /dev/null
+++ b/main/xen/blktap2_libvhd_add_iconv.patch
@@ -0,0 +1,31 @@
+# HG changeset patch
+# Parent 14e911353a91702b439bc06e2a77d67e8bd5f661
+blktap2/vhd: add -liconv when linking if using libiconv
+
+If libiconv is detected on the system add -liconv when linking the
+libvhd library.
+
+If -liconv is not added when compiling libvhd with libiconv the
+following error occours when linking vhd-util and vhd-update:
+
+gcc -o vhd-util vhd-util.o -Llib -lvhd
+lib/libvhd.so: undefined reference to `libiconv_open'
+lib/libvhd.so: undefined reference to `libiconv_close'
+lib/libvhd.so: undefined reference to `libiconv'
+
+Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
+
+diff -r 14e911353a91 tools/blktap2/vhd/lib/Makefile
+--- a/tools/blktap2/vhd/lib/Makefile Tue Dec 20 02:30:12 2011 +0100
++++ b/tools/blktap2/vhd/lib/Makefile Tue Dec 20 02:33:11 2011 +0100
+@@ -23,6 +23,10 @@ ifeq ($(CONFIG_Linux),y)
+ LIBS := -luuid
+ endif
+
++ifeq ($(CONFIG_LIBICONV),y)
++LIBS += -liconv
++endif
++
+ LIB-SRCS := libvhd.c
+ LIB-SRCS += libvhd-journal.c
+ LIB-SRCS += vhd-util-coalesce.c
diff --git a/main/xen/busybox-sed.patch b/main/xen/busybox-sed.patch
new file mode 100644
index 0000000000..e1a9531577
--- /dev/null
+++ b/main/xen/busybox-sed.patch
@@ -0,0 +1,11 @@
+--- ./xen/arch/x86/boot/Makefile.orig
++++ ./xen/arch/x86/boot/Makefile
+@@ -2,7 +2,7 @@
+
+ head.o: reloc.S
+
+-BOOT_TRAMPOLINE := $(shell sed -n 's,^\#define[[:space:]]\{1\,\}BOOT_TRAMPOLINE[[:space:]]\{1\,\},,p' $(BASEDIR)/include/asm-x86/config.h)
++BOOT_TRAMPOLINE := $(shell sed -n 's,^\#define[[:space:]]\+BOOT_TRAMPOLINE[[:space:]]\+,,p' $(BASEDIR)/include/asm-x86/config.h)
+ %.S: %.c
+ RELOC=$(BOOT_TRAMPOLINE) $(MAKE) -f build32.mk $@
+
diff --git a/main/xen/define_fsimage_dir.patch b/main/xen/define_fsimage_dir.patch
new file mode 100644
index 0000000000..04e4aed2af
--- /dev/null
+++ b/main/xen/define_fsimage_dir.patch
@@ -0,0 +1,12 @@
+diff -r 2863b2f43a3b tools/libfsimage/common/Makefile
+--- a/tools/libfsimage/common/Makefile Thu Dec 22 14:49:38 2011 +0000
++++ b/tools/libfsimage/common/Makefile Tue Dec 27 21:00:54 2011 +0100
+@@ -4,6 +4,8 @@
+ MAJOR = 1.0
+ MINOR = 0
+
++CFLAGS += -DFSIMAGE_FSDIR=\"/usr/lib/fs\"
++
+ LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
+ LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU
+ LDFLAGS = $(LDFLAGS-y)
diff --git a/main/xen/detect_libiconv.patch b/main/xen/detect_libiconv.patch
new file mode 100644
index 0000000000..5b2359eb67
--- /dev/null
+++ b/main/xen/detect_libiconv.patch
@@ -0,0 +1,22 @@
+# HG changeset patch
+# Parent 2bc60167b9f8791747d2cea09c5207a9c2d7ef7b
+build: detect is libiconv is present
+
+Detect if libiconv is present in the system, since we will have to
+link against it when using iconv.
+
+Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
+
+diff -r 2bc60167b9f8 Config.mk
+--- a/Config.mk Tue Dec 20 05:25:19 2011 +0100
++++ b/Config.mk Tue Dec 20 07:52:38 2011 +0100
+@@ -9,6 +9,10 @@
+ XEN_OS ?= $(shell uname -s)
+
+ CONFIG_$(XEN_OS) := y
++CONFIG_LIBICONV := $(shell export OS="`uname -s`"; \
++ export CHECK_LIB="$(CHECK_LIB)"; \
++ . $(XEN_ROOT)/tools/check/funcs.sh; \
++ has_lib libiconv.so && echo 'y' || echo 'n')
+
+ SHELL ?= /bin/sh
diff --git a/main/xen/fix_bswap_blktap.patch b/main/xen/fix_bswap_blktap.patch
new file mode 100644
index 0000000000..71671d9dc2
--- /dev/null
+++ b/main/xen/fix_bswap_blktap.patch
@@ -0,0 +1,61 @@
+# HG changeset patch
+# Parent d61e6300274bbc6bc464ad340146bd81e91f64f3
+blktap: remove local definitions and include byteswap.h
+
+Use the same approach as tools/blktap2/include/libvhd.h, remove local
+definitions of bswap* and include byteswap.h. Also remove the
+HAVE_BYTESWAP_H ifdef, since it was not defined in this context (it's
+defined by QEMU).
+
+Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
+
+diff -r d61e6300274b tools/blktap/drivers/bswap.h
+--- a/tools/blktap/drivers/bswap.h Tue Dec 20 05:20:02 2011 +0100
++++ b/tools/blktap/drivers/bswap.h Tue Dec 20 05:24:16 2011 +0100
+@@ -13,45 +13,9 @@
+ #define bswap_16(x) swap16(x)
+ #define bswap_32(x) swap32(x)
+ #define bswap_64(x) swap64(x)
+-#else
++#elif defined(__linux__)
+
+-#ifdef HAVE_BYTESWAP_H
+ #include <byteswap.h>
+-#else
+-
+-#define bswap_16(x) \
+-({ \
+- uint16_t __x = (x); \
+- ((uint16_t)( \
+- (((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
+- (((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
+-})
+-
+-#define bswap_32(x) \
+-({ \
+- uint32_t __x = (x); \
+- ((uint32_t)( \
+- (((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
+- (((uint32_t)(__x) & (uint32_t)0x0000ff00UL) << 8) | \
+- (((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
+- (((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
+-})
+-
+-#define bswap_64(x) \
+-({ \
+- uint64_t __x = (x); \
+- ((uint64_t)( \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
+-})
+-
+-#endif /* !HAVE_BYTESWAP_H */
+
+ static inline uint16_t bswap16(uint16_t x)
+ {
diff --git a/main/xen/fix_bswap_blktap2.patch b/main/xen/fix_bswap_blktap2.patch
new file mode 100644
index 0000000000..69cd2e369c
--- /dev/null
+++ b/main/xen/fix_bswap_blktap2.patch
@@ -0,0 +1,62 @@
+# HG changeset patch
+# Parent 00d9ee3844121f4a7f01e42933751e49b0448abb
+blktap2: remove local definitions and include byteswap.h
+
+Use the same approach as tools/blktap2/include/libvhd.h, remove local
+definitions of bswap* and include byteswap.h. Also remove the
+HAVE_BYTESWAP_H ifdef, since it was not defined in this context (it's
+defined by QEMU).
+
+Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
+
+diff -r 00d9ee384412 tools/blktap2/drivers/bswap.h
+--- a/tools/blktap2/drivers/bswap.h Tue Dec 20 05:24:17 2011 +0100
++++ b/tools/blktap2/drivers/bswap.h Tue Dec 20 05:25:18 2011 +0100
+@@ -13,45 +13,10 @@
+ #define bswap_16(x) swap16(x)
+ #define bswap_32(x) swap32(x)
+ #define bswap_64(x) swap64(x)
+-#else
++#elif defined(__linux__)
+
+-#ifdef HAVE_BYTESWAP_H
++#include <endian.h>
+ #include <byteswap.h>
+-#else
+-
+-#define bswap_16(x) \
+-({ \
+- uint16_t __x = (x); \
+- ((uint16_t)( \
+- (((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
+- (((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
+-})
+-
+-#define bswap_32(x) \
+-({ \
+- uint32_t __x = (x); \
+- ((uint32_t)( \
+- (((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
+- (((uint32_t)(__x) & (uint32_t)0x0000ff00UL) << 8) | \
+- (((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
+- (((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
+-})
+-
+-#define bswap_64(x) \
+-({ \
+- uint64_t __x = (x); \
+- ((uint64_t)( \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
+- (uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
+-})
+-
+-#endif /* !HAVE_BYTESWAP_H */
+
+ static inline uint16_t bswap16(uint16_t x)
+ {
diff --git a/main/xen/fix_ipxe_no_pie_default.patch b/main/xen/fix_ipxe_no_pie_default.patch
new file mode 100644
index 0000000000..3ffb5388c4
--- /dev/null
+++ b/main/xen/fix_ipxe_no_pie_default.patch
@@ -0,0 +1,165 @@
+# HG changeset patch
+# Parent b60667a56ae085ee2bcea896887d0907fb86af41
+ipxe: fix compilation issues with some gcc versions
+
+Backported some changes from current ipxe, to fix a issue with some
+new versions of gcc that add -fPIC by default, and compilation fails
+with the following error:
+
+arch/i386/core/cpu.c: In function 'get_cpuinfo':
+arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
+constraints in an 'asm'
+arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
+constraints in an 'asm'
+arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
+constraints in an 'asm'
+arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
+constraints in an 'asm'
+
+Two patches from ipxe git have been added. The problem is reproducible
+with at least this version of gcc:
+
+Using built-in specs.
+COLLECT_GCC=gcc
+COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-uclibc/4.6.2/lto-wrapper
+Target: x86_64-alpine-linux-uclibc
+Configured with:
+/home/buildozer/aports/main/gcc/src/gcc-4.6.2/configure --prefix=/usr
+--mandir=/usr/share/man --infodir=/usr/share/info
+--build=x86_64-alpine-linux-uclibc --host=x86_64-alpine-linux-uclibc
+--target=x86_64-alpine-linux-uclibc --with-pkgversion='Alpine
+4.6.2-r1' --disable-altivec --disable-checking --disable-fixed-point
+--disable-libssp --disable-libstdcxx-pch --disable-multilib
+--disable-nls --disable-werror --enable-__cxa_atexit --enable-cld
+--enable-esp --enable-cloog-backend
+--enable-languages=c,c++,objc,java,go --enable-shared
+--enable-target-optspace --enable-tls --enable-threads
+--with-dynamic-linker=ld64-uClibc.so.0.9.32
+--with-dynamic-linker-prefix=/lib --with-system-zlib
+--without-system-libunwind
+Thread model: posix
+gcc version 4.6.2 (Alpine 4.6.2-r1)
+
+Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
+
+diff -r b60667a56ae0 tools/firmware/etherboot/patches/gpxe-git-b8924c1aed51
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/tools/firmware/etherboot/patches/gpxe-git-b8924c1aed51 Fri Dec 16 13:48:49 2011 +0100
+@@ -0,0 +1,72 @@
++commit b8924c1aed512aa40cf28a43635df383880f771d
++Author: Michael Brown <mcb30@ipxe.org>
++Date: Wed Mar 16 19:30:42 2011 +0000
++
++ [build] Allow workaround-specific flags to override default flags
++
++ Signed-off-by: Michael Brown <mcb30@ipxe.org>
++
++diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
++index 709f8de..78e78c9 100644
++--- a/src/Makefile.housekeeping
+++++ b/src/Makefile.housekeeping
++@@ -109,6 +109,10 @@ VERYCLEANUP += .toolcheck
++ # Check for various tool workarounds
++ #
++
+++WORKAROUND_CFLAGS :=
+++WORKAROUND_ASFLAGS :=
+++WORKAROUND_LDFLAGS :=
+++
++ # Make syntax does not allow use of comma or space in certain places.
++ # This ugly workaround is suggested in the manual.
++ #
++@@ -119,7 +123,7 @@ SPACE := $(EMPTY) $(EMPTY)
++ # Check for an old version of gas (binutils 2.9.1)
++ #
++ OLDGAS := $(shell $(AS) --version | grep -q '2\.9\.1' && $(ECHO) -DGAS291)
++-CFLAGS += $(OLDGAS)
+++WORKAROUND_CFLAGS += $(OLDGAS)
++ oldgas :
++ @$(ECHO) $(oldgas)
++
++@@ -131,7 +135,7 @@ ifeq ($(CCTYPE),gcc)
++ SP_TEST = $(CC) -fno-stack-protector -x c -c /dev/null \
++ -o /dev/null >/dev/null 2>&1
++ SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
++-CFLAGS += $(SP_FLAGS)
+++WORKAROUND_CFLAGS += $(SP_FLAGS)
++ endif
++
++ # gcc 4.4 generates .eh_frame sections by default, which distort the
++@@ -141,7 +145,7 @@ ifeq ($(CCTYPE),gcc)
++ CFI_TEST = $(CC) -fno-dwarf2-cfi-asm -x c -c /dev/null \
++ -o /dev/null >/dev/null 2>&1
++ CFI_FLAGS := $(shell $(CFI_TEST) && $(ECHO) '-fno-dwarf2-cfi-asm')
++-CFLAGS += $(CFI_FLAGS)
+++WORKAROUND_CFLAGS += $(CFI_FLAGS)
++ endif
++
++ # Some versions of gas choke on division operators, treating them as
++@@ -150,7 +154,7 @@ endif
++ #
++ DIVIDE_TEST = $(AS) --divide /dev/null -o /dev/null 2>/dev/null
++ DIVIDE_FLAGS := $(shell $(DIVIDE_TEST) && $(ECHO) '--divide')
++-ASFLAGS += $(DIVIDE_FLAGS)
+++WORKAROUND_ASFLAGS += $(DIVIDE_FLAGS)
++
++ ###############################################################################
++ #
++@@ -375,9 +379,9 @@ CFLAGS += -diag-disable 1419 # Missing prototypes
++ CFLAGS += -diag-disable 1599 # Hidden variables
++ CFLAGS += -Wall -Wmissing-declarations
++ endif
++-CFLAGS += $(EXTRA_CFLAGS)
++-ASFLAGS += $(EXTRA_ASFLAGS)
++-LDFLAGS += $(EXTRA_LDFLAGS)
+++CFLAGS += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
+++ASFLAGS += $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS)
+++LDFLAGS += $(WORKAROUND_LDFLAGS) $(EXTRA_LDFLAGS)
++
++ # Inhibit -Werror if NO_WERROR is specified on make command line
++ #
+diff -r b60667a56ae0 tools/firmware/etherboot/patches/gpxe-git-fe61f6de0dd5
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/tools/firmware/etherboot/patches/gpxe-git-fe61f6de0dd5 Fri Dec 16 13:48:49 2011 +0100
+@@ -0,0 +1,32 @@
++commit fe61f6de0dd5d39ac3de5e8e18742f9bd0aafad7
++Author: Gilles Espinasse <g.esp@free.fr>
++Date: Tue Mar 29 15:30:11 2011 +0100
++
++ [build] Fix compilation when gcc is patched to default to -fPIE -Wl,-pie
++
++ Signed-off-by: Gilles Espinasse <g.esp@free.fr>
++ Modified-by: Michael Brown <mcb30@ipxe.org>
++ Signed-off-by: Michael Brown <mcb30@ipxe.org>
++
++diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
++index 57e52c0..c184351 100644
++--- a/src/Makefile.housekeeping
+++++ b/src/Makefile.housekeeping
++@@ -138,6 +138,17 @@ SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
++ WORKAROUND_CFLAGS += $(SP_FLAGS)
++ endif
++
+++# Some widespread patched versions of gcc include -fPIE -Wl,-pie by
+++# default. Note that gcc will exit *successfully* if it fails to
+++# recognise an option that starts with "no", so we have to test for
+++# output on stderr instead of checking the exit status.
+++#
+++ifeq ($(CCTYPE),gcc)
+++PIE_TEST = [ -z "`$(CC) -fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1`" ]
+++PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -nopie')
+++WORKAROUND_CFLAGS += $(PIE_FLAGS)
+++endif
+++
++ # gcc 4.4 generates .eh_frame sections by default, which distort the
++ # output of "size". Inhibit this.
++ #
+diff -r b60667a56ae0 tools/firmware/etherboot/patches/series
+--- a/tools/firmware/etherboot/patches/series Fri Dec 16 10:47:18 2011 +0100
++++ b/tools/firmware/etherboot/patches/series Fri Dec 16 13:48:49 2011 +0100
+@@ -1,3 +1,5 @@
+ boot_prompt_option.patch
+ gpxe-git-0edf2405b457
+ gpxe-git-a803ef3dfeac
++gpxe-git-b8924c1aed51
++gpxe-git-fe61f6de0dd5
diff --git a/main/xen/librt.patch b/main/xen/librt.patch
new file mode 100644
index 0000000000..cbb52071a5
--- /dev/null
+++ b/main/xen/librt.patch
@@ -0,0 +1,11 @@
+--- ./tools/ioemu-qemu-xen/Makefile.target.orig
++++ ./tools/ioemu-qemu-xen/Makefile.target
+@@ -520,7 +520,7 @@
+ OBJS+=block-raw-posix.o
+ endif
+
+-LIBS+=-lz
++LIBS+=-lz -lrt
+ ifdef CONFIG_ALSA
+ LIBS += -lasound
+ endif
diff --git a/main/xen/pygrub_alpine.patch b/main/xen/pygrub_alpine.patch
new file mode 100644
index 0000000000..98d0822c71
--- /dev/null
+++ b/main/xen/pygrub_alpine.patch
@@ -0,0 +1,64 @@
+# HG changeset patch
+# Parent 3e02aa9670b3265e36bdddbd4760415cd87d047b
+pygrub: fix extlinux parsing
+
+pygrub was unable to parse extlinux config files correctly, exactly
+the ones like:
+
+LABEL grsec
+ KERNEL vmlinuz-3.0.10-grsec
+ APPEND initrd=initramfs-3.0.10-grsec
+root=UUID=cfd4a7b4-8c40-4025-b877-8205f1c622ee
+modules=sd-mod,usb-storage,ext4 xen quiet
+
+This patch fixes it, adding a new case when parsing the "append" line,
+that searches for the initrd image.
+
+Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
+
+diff -r 3e02aa9670b3 tools/pygrub/examples/alpine-linux-2.3.2.extlinux
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/tools/pygrub/examples/alpine-linux-2.3.2.extlinux Tue Jan 03 13:11:46 2012 +0100
+@@ -0,0 +1,11 @@
++DEFAULT menu.c32
++PROMPT 0
++MENU TITLE Alpine/Linux Boot Menu
++MENU HIDDEN
++MENU AUTOBOOT Alpine will be booted automatically in # seconds.
++TIMEOUT 30
++LABEL grsec
++ MENU DEFAULT
++ MENU LABEL Linux 3.0.10-grsec
++ KERNEL vmlinuz-3.0.10-grsec
++ APPEND initrd=initramfs-3.0.10-grsec root=UUID=a97ffe64-430f-4fd3-830e-4736d9a27af0 modules=sd-mod,usb-storage,ext4 quiet
+diff -r 3e02aa9670b3 tools/pygrub/src/ExtLinuxConf.py
+--- a/tools/pygrub/src/ExtLinuxConf.py Thu Dec 15 18:55:46 2011 +0100
++++ b/tools/pygrub/src/ExtLinuxConf.py Tue Jan 03 13:11:46 2012 +0100
+@@ -60,6 +60,13 @@ class ExtLinuxImage(object):
+
+ # Bypass regular self.commands handling
+ com = None
++ elif "initrd=" in arg:
++ # find initrd image in append line
++ args = arg.strip().split(" ")
++ for a in args:
++ if a.lower().startswith("initrd="):
++ setattr(self, "initrd", a.replace("initrd=", ""))
++ arg = arg.replace(a, "")
+
+ if com is not None and self.commands.has_key(com):
+ if self.commands[com] is not None:
+@@ -86,10 +93,12 @@ class ExtLinuxImage(object):
+ self._args = args
+ def get_kernel(self):
+ return self._kernel
++ def set_args(self, val):
++ self._args = val
+ def get_args(self):
+ return self._args
+ kernel = property(get_kernel, set_kernel)
+- args = property(get_args)
++ args = property(get_args, set_args)
+
+ def set_initrd(self, val):
+ self._initrd = (None,val)
diff --git a/main/xen/xen-blktap-uclibc.patch b/main/xen/xen-blktap-uclibc.patch
deleted file mode 100644
index d8668ec19b..0000000000
--- a/main/xen/xen-blktap-uclibc.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- xen-4.0.1/tools/blktap/drivers/bswap.h
-+++ xen-4.0.1.mod/tools/blktap/drivers/bswap.h
-@@ -15,6 +15,8 @@
- #define bswap_64(x) swap64(x)
- #else
-
-+#define HAVE_BYTESWAP_H
-+
- #ifdef HAVE_BYTESWAP_H
- #include <byteswap.h>
- #else
diff --git a/main/xen/xen-blktap2-uclibc.patch b/main/xen/xen-blktap2-uclibc.patch
deleted file mode 100644
index 7ce1dc0cfd..0000000000
--- a/main/xen/xen-blktap2-uclibc.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- xen-4.0.1/tools/blktap2/drivers/bswap.h
-+++ xen-4.0.1.mod/tools/blktap2/drivers/bswap.h
-@@ -15,6 +15,8 @@
- #define bswap_64(x) swap64(x)
- #else
-
-+#define HAVE_BYTESWAP_H
-+
- #ifdef HAVE_BYTESWAP_H
- #include <byteswap.h>
- #else
---- xen-4.0.1/tools/blktap2/vhd/lib/Makefile
-+++ xen-4.0.1.mod/tools/blktap2/vhd/lib/Makefile
-@@ -23,6 +23,8 @@
- LIBS := -luuid
- endif
-
-+LIBS += -liconv
-+
- # Get gcc to generate the dependencies for us.
- CFLAGS += -Wp,-MD,.$(@F).d
- DEPS = .*.d
diff --git a/main/xen/xen-disable-firmware.patch b/main/xen/xen-disable-firmware.patch
deleted file mode 100644
index 06e43d41c4..0000000000
--- a/main/xen/xen-disable-firmware.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- xen-4.0.1/tools/Makefile
-+++ xen-4.0.1.mod/tools/Makefile
-@@ -13,7 +13,6 @@
- SUBDIRS-y += hotplug
- SUBDIRS-y += xentrace
- SUBDIRS-$(CONFIG_XCUTILS) += xcutils
--SUBDIRS-$(CONFIG_X86) += firmware
- SUBDIRS-$(ACM_SECURITY) += security
- SUBDIRS-y += console
- SUBDIRS-y += xenmon
diff --git a/main/xen/xen-dont-use-lib64.patch b/main/xen/xen-dont-use-lib64.patch
deleted file mode 100644
index b14ff10164..0000000000
--- a/main/xen/xen-dont-use-lib64.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- xen-4.0.1/config/StdGNU.mk
-+++ xen-4.0.1.mod/config/StdGNU.mk
-@@ -28,7 +28,7 @@
- INCLUDEDIR = $(PREFIX)/include
- LIBLEAFDIR = lib
- LIBLEAFDIR_x86_32 = lib
--LIBLEAFDIR_x86_64 ?= lib64
-+LIBLEAFDIR_x86_64 ?= lib
- LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
- LIBDIR_x86_32 = $(PREFIX)/$(LIBLEAFDIR_x86_32)
- LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
diff --git a/main/xen/xen-gcc-4.6-Werror-fix.patch b/main/xen/xen-gcc-4.6-Werror-fix.patch
deleted file mode 100644
index b04ae9cae8..0000000000
--- a/main/xen/xen-gcc-4.6-Werror-fix.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- ./tools/python/xen/lowlevel/checkpoint/libcheckpoint.c.orig
-+++ ./tools/python/xen/lowlevel/checkpoint/libcheckpoint.c
-@@ -820,12 +820,10 @@
-
- static void stop_suspend_thread(checkpoint_state* s)
- {
-- int err;
--
- s->done = 1;
-
-- err = sem_post(&s->resumed_sem);
-+ (void)sem_post(&s->resumed_sem);
-
-- err = pthread_join(s->suspend_thr, NULL);
-+ (void)pthread_join(s->suspend_thr, NULL);
- s->suspend_thr = 0;
- }
---- ./tools/python/xen/lowlevel/netlink/libnetlink.c.orig
-+++ ./tools/python/xen/lowlevel/netlink/libnetlink.c
-@@ -433,7 +433,7 @@
- nladdr.nl_groups = 0;
-
- while (1) {
-- int err, len, type;
-+ int err, len;
- int l;
-
- status = fread(&buf, 1, sizeof(*h), rtnl);
-@@ -448,7 +448,6 @@
- return 0;
-
- len = h->nlmsg_len;
-- type= h->nlmsg_type;
- l = len - sizeof(*h);
-
- if (l<0 || len>sizeof(buf)) {
diff --git a/main/xen/xen-gcc-4.6-hvmloader-is-broken.patch b/main/xen/xen-gcc-4.6-hvmloader-is-broken.patch
deleted file mode 100644
index 767abed5d3..0000000000
--- a/main/xen/xen-gcc-4.6-hvmloader-is-broken.patch
+++ /dev/null
@@ -1,733 +0,0 @@
-
-# HG changeset patch
-# User Keir Fraser <keir@xen.org>
-# Date 1311171934 -3600
-# Node ID 1976adbf2b807e505fdf0356c29ec0c0499ed533
-# Parent 411b38f8f90bc042a9e6839b6840dd57cbee4a8c
-hvmloader: Switch to absolute addressing for calling hypercall stubs.
-
-This is clearer and less fragile than trying to make relative calls
-work. In particular, the old approach failed if _start was not
-== HVMLOADER_PHYSICAL_ADDRESS. This was the case for some modern
-toolchains which reorder functions.
-
-Signed-off-by: Keir Fraser <keir@xen.org>
-xen-unstable changeset: 23730:dd5eecf739d1
-xen-unstable date: Wed Jul 20 15:02:16 2011 +0100
-
-
-hvmloader: Remove hard tabs from source files.
-
-Signed-off-by: Keir Fraser <keir@xen.org>
-xen-unstable changeset: 23729:4f1109af9c63
-xen-unstable date: Wed Jul 20 14:52:16 2011 +0100
-
-diff -r 411b38f8f90b -r 1976adbf2b80 tools/firmware/hvmloader/hypercall.h
---- a/tools/firmware/hvmloader/hypercall.h Wed Jul 20 15:24:09 2011 +0100
-+++ b/tools/firmware/hvmloader/hypercall.h Wed Jul 20 15:25:34 2011 +0100
-@@ -35,147 +35,148 @@
- #include <xen/xen.h>
- #include "config.h"
-
--/*
-- * NB. Hypercall address needs to be relative to a linkage symbol for
-- * some version of ld to relocate the relative calls properly.
-- */
--#define hypercall_pa "_start - " STR(HVMLOADER_PHYSICAL_ADDRESS) \
-- " + " STR(HYPERCALL_PHYSICAL_ADDRESS)
-+#define hcall_addr(name) \
-+ ((unsigned long)HYPERCALL_PHYSICAL_ADDRESS + __HYPERVISOR_##name * 32)
-
--#define _hypercall0(type, name) \
--({ \
-- long __res; \
-- asm volatile ( \
-- "call "hypercall_pa" + " STR(__HYPERVISOR_##name * 32) \
-- : "=a" (__res) \
-- : \
-- : "memory" ); \
-- (type)__res; \
-+#define _hypercall0(type, name) \
-+({ \
-+ long __res; \
-+ asm volatile ( \
-+ "call *%%eax" \
-+ : "=a" (__res) \
-+ : "0" (hcall_addr(name)) \
-+ : "memory" ); \
-+ (type)__res; \
- })
-
--#define _hypercall1(type, name, a1) \
--({ \
-- long __res, __ign1; \
-- asm volatile ( \
-- "call "hypercall_pa" + " STR(__HYPERVISOR_##name * 32) \
-- : "=a" (__res), "=b" (__ign1) \
-- : "1" ((long)(a1)) \
-- : "memory" ); \
-- (type)__res; \
-+#define _hypercall1(type, name, a1) \
-+({ \
-+ long __res, __ign1; \
-+ asm volatile ( \
-+ "call *%%eax" \
-+ : "=a" (__res), "=b" (__ign1) \
-+ : "0" (hcall_addr(name)), \
-+ "1" ((long)(a1)) \
-+ : "memory" ); \
-+ (type)__res; \
- })
-
--#define _hypercall2(type, name, a1, a2) \
--({ \
-- long __res, __ign1, __ign2; \
-- asm volatile ( \
-- "call "hypercall_pa" + " STR(__HYPERVISOR_##name * 32) \
-- : "=a" (__res), "=b" (__ign1), "=c" (__ign2) \
-- : "1" ((long)(a1)), "2" ((long)(a2)) \
-- : "memory" ); \
-- (type)__res; \
-+#define _hypercall2(type, name, a1, a2) \
-+({ \
-+ long __res, __ign1, __ign2; \
-+ asm volatile ( \
-+ "call *%%eax" \
-+ : "=a" (__res), "=b" (__ign1), "=c" (__ign2) \
-+ : "0" (hcall_addr(name)), \
-+ "1" ((long)(a1)), "2" ((long)(a2)) \
-+ : "memory" ); \
-+ (type)__res; \
- })
-
--#define _hypercall3(type, name, a1, a2, a3) \
--({ \
-- long __res, __ign1, __ign2, __ign3; \
-- asm volatile ( \
-- "call "hypercall_pa" + " STR(__HYPERVISOR_##name * 32) \
-- : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
-- "=d" (__ign3) \
-- : "1" ((long)(a1)), "2" ((long)(a2)), \
-- "3" ((long)(a3)) \
-- : "memory" ); \
-- (type)__res; \
-+#define _hypercall3(type, name, a1, a2, a3) \
-+({ \
-+ long __res, __ign1, __ign2, __ign3; \
-+ asm volatile ( \
-+ "call *%%eax" \
-+ : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
-+ "=d" (__ign3) \
-+ : "0" (hcall_addr(name)), \
-+ "1" ((long)(a1)), "2" ((long)(a2)), \
-+ "3" ((long)(a3)) \
-+ : "memory" ); \
-+ (type)__res; \
- })
-
--#define _hypercall4(type, name, a1, a2, a3, a4) \
--({ \
-- long __res, __ign1, __ign2, __ign3, __ign4; \
-- asm volatile ( \
-- "call "hypercall_pa" + " STR(__HYPERVISOR_##name * 32) \
-- : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
-- "=d" (__ign3), "=S" (__ign4) \
-- : "1" ((long)(a1)), "2" ((long)(a2)), \
-- "3" ((long)(a3)), "4" ((long)(a4)) \
-- : "memory" ); \
-- (type)__res; \
-+#define _hypercall4(type, name, a1, a2, a3, a4) \
-+({ \
-+ long __res, __ign1, __ign2, __ign3, __ign4; \
-+ asm volatile ( \
-+ "call *%%eax" \
-+ : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
-+ "=d" (__ign3), "=S" (__ign4) \
-+ : "0" (hcall_addr(name)), \
-+ "1" ((long)(a1)), "2" ((long)(a2)), \
-+ "3" ((long)(a3)), "4" ((long)(a4)) \
-+ : "memory" ); \
-+ (type)__res; \
- })
-
--#define _hypercall5(type, name, a1, a2, a3, a4, a5) \
--({ \
-- long __res, __ign1, __ign2, __ign3, __ign4, __ign5; \
-- asm volatile ( \
-- "call "hypercall_pa" + " STR(__HYPERVISOR_##name * 32) \
-- : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
-- "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) \
-- : "1" ((long)(a1)), "2" ((long)(a2)), \
-- "3" ((long)(a3)), "4" ((long)(a4)), \
-- "5" ((long)(a5)) \
-- : "memory" ); \
-- (type)__res; \
-+#define _hypercall5(type, name, a1, a2, a3, a4, a5) \
-+({ \
-+ long __res, __ign1, __ign2, __ign3, __ign4, __ign5; \
-+ asm volatile ( \
-+ "call *%%eax" \
-+ : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
-+ "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) \
-+ : "0" (hcall_addr(name)), \
-+ "1" ((long)(a1)), "2" ((long)(a2)), \
-+ "3" ((long)(a3)), "4" ((long)(a4)), \
-+ "5" ((long)(a5)) \
-+ : "memory" ); \
-+ (type)__res; \
- })
-
- static inline int
- hypercall_sched_op(
-- int cmd, void *arg)
-+ int cmd, void *arg)
- {
-- return _hypercall2(int, sched_op, cmd, arg);
-+ return _hypercall2(int, sched_op, cmd, arg);
- }
-
- static inline int
- hypercall_memory_op(
-- unsigned int cmd, void *arg)
-+ unsigned int cmd, void *arg)
- {
-- return _hypercall2(int, memory_op, cmd, arg);
-+ return _hypercall2(int, memory_op, cmd, arg);
- }
-
- static inline int
- hypercall_multicall(
-- void *call_list, int nr_calls)
-+ void *call_list, int nr_calls)
- {
-- return _hypercall2(int, multicall, call_list, nr_calls);
-+ return _hypercall2(int, multicall, call_list, nr_calls);
- }
-
- static inline int
- hypercall_event_channel_op(
-- int cmd, void *arg)
-+ int cmd, void *arg)
- {
-- return _hypercall2(int, event_channel_op, cmd, arg);
-+ return _hypercall2(int, event_channel_op, cmd, arg);
- }
-
- static inline int
- hypercall_xen_version(
-- int cmd, void *arg)
-+ int cmd, void *arg)
- {
-- return _hypercall2(int, xen_version, cmd, arg);
-+ return _hypercall2(int, xen_version, cmd, arg);
- }
-
- static inline int
- hypercall_console_io(
-- int cmd, int count, char *str)
-+ int cmd, int count, char *str)
- {
-- return _hypercall3(int, console_io, cmd, count, str);
-+ return _hypercall3(int, console_io, cmd, count, str);
- }
-
- static inline int
- hypercall_vm_assist(
-- unsigned int cmd, unsigned int type)
-+ unsigned int cmd, unsigned int type)
- {
-- return _hypercall2(int, vm_assist, cmd, type);
-+ return _hypercall2(int, vm_assist, cmd, type);
- }
-
- static inline int
- hypercall_vcpu_op(
-- int cmd, int vcpuid, void *extra_args)
-+ int cmd, int vcpuid, void *extra_args)
- {
-- return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
-+ return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
- }
-
- static inline int
- hypercall_hvm_op(
-- int cmd, void *arg)
-+ int cmd, void *arg)
- {
-- return _hypercall2(int, hvm_op, cmd, arg);
-+ return _hypercall2(int, hvm_op, cmd, arg);
- }
-
- #endif /* __HVMLOADER_HYPERCALL_H__ */
-diff -r 411b38f8f90b -r 1976adbf2b80 tools/firmware/hvmloader/pci_regs.h
---- a/tools/firmware/hvmloader/pci_regs.h Wed Jul 20 15:24:09 2011 +0100
-+++ b/tools/firmware/hvmloader/pci_regs.h Wed Jul 20 15:25:34 2011 +0100
-@@ -1,69 +1,69 @@
- /*
-- * pci_regs.h
-+ * pci_regs.h
- *
-- * PCI standard defines
-- * Copyright 1994, Drew Eckhardt
-- * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
-+ * PCI standard defines
-+ * Copyright 1994, Drew Eckhardt
-+ * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
- *
-- * For more information, please consult the following manuals (look at
-- * http://www.pcisig.com/ for how to get them):
-+ * For more information, please consult the following manuals (look at
-+ * http://www.pcisig.com/ for how to get them):
- *
-- * PCI BIOS Specification
-- * PCI Local Bus Specification
-- * PCI to PCI Bridge Specification
-- * PCI System Design Guide
-+ * PCI BIOS Specification
-+ * PCI Local Bus Specification
-+ * PCI to PCI Bridge Specification
-+ * PCI System Design Guide
- */
-
- #ifndef __HVMLOADER_PCI_REGS_H__
- #define __HVMLOADER_PCI_REGS_H__
-
--#define PCI_VENDOR_ID 0x00 /* 16 bits */
--#define PCI_DEVICE_ID 0x02 /* 16 bits */
--#define PCI_COMMAND 0x04 /* 16 bits */
--#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
--#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
--#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
--#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */
--#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */
--#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */
--#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */
--#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */
--#define PCI_COMMAND_SERR 0x100 /* Enable SERR */
--#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */
-+#define PCI_VENDOR_ID 0x00 /* 16 bits */
-+#define PCI_DEVICE_ID 0x02 /* 16 bits */
-+#define PCI_COMMAND 0x04 /* 16 bits */
-+#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
-+#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
-+#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
-+#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */
-+#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */
-+#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */
-+#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */
-+#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */
-+#define PCI_COMMAND_SERR 0x100 /* Enable SERR */
-+#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */
- #define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
-
--#define PCI_STATUS 0x06 /* 16 bits */
--#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
--#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */
--#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */
--#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */
--#define PCI_STATUS_PARITY 0x100 /* Detected parity error */
--#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */
--#define PCI_STATUS_DEVSEL_FAST 0x000
--#define PCI_STATUS_DEVSEL_MEDIUM 0x200
--#define PCI_STATUS_DEVSEL_SLOW 0x400
--#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
--#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */
--#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */
--#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */
--#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */
-+#define PCI_STATUS 0x06 /* 16 bits */
-+#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
-+#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */
-+#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */
-+#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */
-+#define PCI_STATUS_PARITY 0x100 /* Detected parity error */
-+#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */
-+#define PCI_STATUS_DEVSEL_FAST 0x000
-+#define PCI_STATUS_DEVSEL_MEDIUM 0x200
-+#define PCI_STATUS_DEVSEL_SLOW 0x400
-+#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
-+#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */
-+#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */
-+#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */
-+#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */
-
--#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */
--#define PCI_REVISION_ID 0x08 /* Revision ID */
--#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */
--#define PCI_CLASS_DEVICE 0x0a /* Device class */
-+#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */
-+#define PCI_REVISION_ID 0x08 /* Revision ID */
-+#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */
-+#define PCI_CLASS_DEVICE 0x0a /* Device class */
-
--#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
--#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
--#define PCI_HEADER_TYPE 0x0e /* 8 bits */
--#define PCI_HEADER_TYPE_NORMAL 0
--#define PCI_HEADER_TYPE_BRIDGE 1
--#define PCI_HEADER_TYPE_CARDBUS 2
-+#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
-+#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
-+#define PCI_HEADER_TYPE 0x0e /* 8 bits */
-+#define PCI_HEADER_TYPE_NORMAL 0
-+#define PCI_HEADER_TYPE_BRIDGE 1
-+#define PCI_HEADER_TYPE_CARDBUS 2
-
--#define PCI_BIST 0x0f /* 8 bits */
--#define PCI_BIST_CODE_MASK 0x0f /* Return result */
--#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
--#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
-+#define PCI_BIST 0x0f /* 8 bits */
-+#define PCI_BIST_CODE_MASK 0x0f /* Return result */
-+#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
-+#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
-
- /*
- * Base addresses specify locations in memory or I/O space.
-@@ -71,38 +71,38 @@
- * 0xffffffff to the register, and reading it back. Only
- * 1 bits are decoded.
- */
--#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
--#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */
--#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */
--#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
--#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
--#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
--#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */
--#define PCI_BASE_ADDRESS_SPACE_IO 0x01
--#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
--#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06
--#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */
--#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
--#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */
--#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */
--#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
--#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
-+#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
-+#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */
-+#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */
-+#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
-+#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
-+#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
-+#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */
-+#define PCI_BASE_ADDRESS_SPACE_IO 0x01
-+#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
-+#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06
-+#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */
-+#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
-+#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */
-+#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */
-+#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
-+#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
- /* bit 1 is reserved if address_space = 1 */
-
- /* Header type 0 (normal devices) */
--#define PCI_CARDBUS_CIS 0x28
--#define PCI_SUBSYSTEM_VENDOR_ID 0x2c
--#define PCI_SUBSYSTEM_ID 0x2e
--#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
--#define PCI_ROM_ADDRESS_ENABLE 0x01
--#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
-+#define PCI_CARDBUS_CIS 0x28
-+#define PCI_SUBSYSTEM_VENDOR_ID 0x2c
-+#define PCI_SUBSYSTEM_ID 0x2e
-+#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
-+#define PCI_ROM_ADDRESS_ENABLE 0x01
-+#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
-
--#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
-+#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
-
- /* 0x35-0x3b are reserved */
--#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
--#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
--#define PCI_MIN_GNT 0x3e /* 8 bits */
--#define PCI_MAX_LAT 0x3f /* 8 bits */
-+#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
-+#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
-+#define PCI_MIN_GNT 0x3e /* 8 bits */
-+#define PCI_MAX_LAT 0x3f /* 8 bits */
-
- #endif /* __HVMLOADER_PCI_REGS_H__ */
-diff -r 411b38f8f90b -r 1976adbf2b80 tools/firmware/hvmloader/smbios_types.h
---- a/tools/firmware/hvmloader/smbios_types.h Wed Jul 20 15:24:09 2011 +0100
-+++ b/tools/firmware/hvmloader/smbios_types.h Wed Jul 20 15:25:34 2011 +0100
-@@ -32,157 +32,157 @@
- between 0xf0000 and 0xfffff.
- */
- struct smbios_entry_point {
-- char anchor_string[4];
-- uint8_t checksum;
-- uint8_t length;
-- uint8_t smbios_major_version;
-- uint8_t smbios_minor_version;
-- uint16_t max_structure_size;
-- uint8_t entry_point_revision;
-- uint8_t formatted_area[5];
-- char intermediate_anchor_string[5];
-- uint8_t intermediate_checksum;
-- uint16_t structure_table_length;
-- uint32_t structure_table_address;
-- uint16_t number_of_structures;
-- uint8_t smbios_bcd_revision;
-+ char anchor_string[4];
-+ uint8_t checksum;
-+ uint8_t length;
-+ uint8_t smbios_major_version;
-+ uint8_t smbios_minor_version;
-+ uint16_t max_structure_size;
-+ uint8_t entry_point_revision;
-+ uint8_t formatted_area[5];
-+ char intermediate_anchor_string[5];
-+ uint8_t intermediate_checksum;
-+ uint16_t structure_table_length;
-+ uint32_t structure_table_address;
-+ uint16_t number_of_structures;
-+ uint8_t smbios_bcd_revision;
- } __attribute__ ((packed));
-
- /* This goes at the beginning of every SMBIOS structure. */
- struct smbios_structure_header {
-- uint8_t type;
-- uint8_t length;
-- uint16_t handle;
-+ uint8_t type;
-+ uint8_t length;
-+ uint16_t handle;
- } __attribute__ ((packed));
-
- /* SMBIOS type 0 - BIOS Information */
- struct smbios_type_0 {
-- struct smbios_structure_header header;
-- uint8_t vendor_str;
-- uint8_t version_str;
-- uint16_t starting_address_segment;
-- uint8_t release_date_str;
-- uint8_t rom_size;
-- uint8_t characteristics[8];
-- uint8_t characteristics_extension_bytes[2];
-- uint8_t major_release;
-- uint8_t minor_release;
-- uint8_t embedded_controller_major;
-- uint8_t embedded_controller_minor;
-+ struct smbios_structure_header header;
-+ uint8_t vendor_str;
-+ uint8_t version_str;
-+ uint16_t starting_address_segment;
-+ uint8_t release_date_str;
-+ uint8_t rom_size;
-+ uint8_t characteristics[8];
-+ uint8_t characteristics_extension_bytes[2];
-+ uint8_t major_release;
-+ uint8_t minor_release;
-+ uint8_t embedded_controller_major;
-+ uint8_t embedded_controller_minor;
- } __attribute__ ((packed));
-
- /* SMBIOS type 1 - System Information */
- struct smbios_type_1 {
-- struct smbios_structure_header header;
-- uint8_t manufacturer_str;
-- uint8_t product_name_str;
-- uint8_t version_str;
-- uint8_t serial_number_str;
-- uint8_t uuid[16];
-- uint8_t wake_up_type;
-- uint8_t sku_str;
-- uint8_t family_str;
-+ struct smbios_structure_header header;
-+ uint8_t manufacturer_str;
-+ uint8_t product_name_str;
-+ uint8_t version_str;
-+ uint8_t serial_number_str;
-+ uint8_t uuid[16];
-+ uint8_t wake_up_type;
-+ uint8_t sku_str;
-+ uint8_t family_str;
- } __attribute__ ((packed));
-
- /* SMBIOS type 3 - System Enclosure */
- struct smbios_type_3 {
-- struct smbios_structure_header header;
-- uint8_t manufacturer_str;
-- uint8_t type;
-- uint8_t version_str;
-- uint8_t serial_number_str;
-- uint8_t asset_tag_str;
-- uint8_t boot_up_state;
-- uint8_t power_supply_state;
-- uint8_t thermal_state;
-- uint8_t security_status;
-+ struct smbios_structure_header header;
-+ uint8_t manufacturer_str;
-+ uint8_t type;
-+ uint8_t version_str;
-+ uint8_t serial_number_str;
-+ uint8_t asset_tag_str;
-+ uint8_t boot_up_state;
-+ uint8_t power_supply_state;
-+ uint8_t thermal_state;
-+ uint8_t security_status;
- } __attribute__ ((packed));
-
- /* SMBIOS type 4 - Processor Information */
- struct smbios_type_4 {
-- struct smbios_structure_header header;
-- uint8_t socket_designation_str;
-- uint8_t processor_type;
-- uint8_t processor_family;
-- uint8_t manufacturer_str;
-- uint32_t cpuid[2];
-- uint8_t version_str;
-- uint8_t voltage;
-- uint16_t external_clock;
-- uint16_t max_speed;
-- uint16_t current_speed;
-- uint8_t status;
-- uint8_t upgrade;
-+ struct smbios_structure_header header;
-+ uint8_t socket_designation_str;
-+ uint8_t processor_type;
-+ uint8_t processor_family;
-+ uint8_t manufacturer_str;
-+ uint32_t cpuid[2];
-+ uint8_t version_str;
-+ uint8_t voltage;
-+ uint16_t external_clock;
-+ uint16_t max_speed;
-+ uint16_t current_speed;
-+ uint8_t status;
-+ uint8_t upgrade;
- } __attribute__ ((packed));
-
- /* SMBIOS type 11 - OEM Strings */
- struct smbios_type_11 {
-- struct smbios_structure_header header;
-- uint8_t count;
-+ struct smbios_structure_header header;
-+ uint8_t count;
- } __attribute__ ((packed));
-
- /* SMBIOS type 16 - Physical Memory Array
- * Associated with one type 17 (Memory Device).
- */
- struct smbios_type_16 {
-- struct smbios_structure_header header;
-- uint8_t location;
-- uint8_t use;
-- uint8_t error_correction;
-- uint32_t maximum_capacity;
-- uint16_t memory_error_information_handle;
-- uint16_t number_of_memory_devices;
-+ struct smbios_structure_header header;
-+ uint8_t location;
-+ uint8_t use;
-+ uint8_t error_correction;
-+ uint32_t maximum_capacity;
-+ uint16_t memory_error_information_handle;
-+ uint16_t number_of_memory_devices;
- } __attribute__ ((packed));
-
- /* SMBIOS type 17 - Memory Device
- * Associated with one type 19
- */
- struct smbios_type_17 {
-- struct smbios_structure_header header;
-- uint16_t physical_memory_array_handle;
-- uint16_t memory_error_information_handle;
-- uint16_t total_width;
-- uint16_t data_width;
-- uint16_t size;
-- uint8_t form_factor;
-- uint8_t device_set;
-- uint8_t device_locator_str;
-- uint8_t bank_locator_str;
-- uint8_t memory_type;
-- uint16_t type_detail;
-+ struct smbios_structure_header header;
-+ uint16_t physical_memory_array_handle;
-+ uint16_t memory_error_information_handle;
-+ uint16_t total_width;
-+ uint16_t data_width;
-+ uint16_t size;
-+ uint8_t form_factor;
-+ uint8_t device_set;
-+ uint8_t device_locator_str;
-+ uint8_t bank_locator_str;
-+ uint8_t memory_type;
-+ uint16_t type_detail;
- } __attribute__ ((packed));
-
- /* SMBIOS type 19 - Memory Array Mapped Address */
- struct smbios_type_19 {
-- struct smbios_structure_header header;
-- uint32_t starting_address;
-- uint32_t ending_address;
-- uint16_t memory_array_handle;
-- uint8_t partition_width;
-+ struct smbios_structure_header header;
-+ uint32_t starting_address;
-+ uint32_t ending_address;
-+ uint16_t memory_array_handle;
-+ uint8_t partition_width;
- } __attribute__ ((packed));
-
- /* SMBIOS type 20 - Memory Device Mapped Address */
- struct smbios_type_20 {
-- struct smbios_structure_header header;
-- uint32_t starting_address;
-- uint32_t ending_address;
-- uint16_t memory_device_handle;
-- uint16_t memory_array_mapped_address_handle;
-- uint8_t partition_row_position;
-- uint8_t interleave_position;
-- uint8_t interleaved_data_depth;
-+ struct smbios_structure_header header;
-+ uint32_t starting_address;
-+ uint32_t ending_address;
-+ uint16_t memory_device_handle;
-+ uint16_t memory_array_mapped_address_handle;
-+ uint8_t partition_row_position;
-+ uint8_t interleave_position;
-+ uint8_t interleaved_data_depth;
- } __attribute__ ((packed));
-
- /* SMBIOS type 32 - System Boot Information */
- struct smbios_type_32 {
-- struct smbios_structure_header header;
-- uint8_t reserved[6];
-- uint8_t boot_status;
-+ struct smbios_structure_header header;
-+ uint8_t reserved[6];
-+ uint8_t boot_status;
- } __attribute__ ((packed));
-
- /* SMBIOS type 127 -- End-of-table */
- struct smbios_type_127 {
-- struct smbios_structure_header header;
-+ struct smbios_structure_header header;
- } __attribute__ ((packed));
-
- #endif /* SMBIOS_TYPES_H */
-diff -r 411b38f8f90b -r 1976adbf2b80 tools/firmware/hvmloader/util.c
---- a/tools/firmware/hvmloader/util.c Wed Jul 20 15:24:09 2011 +0100
-+++ b/tools/firmware/hvmloader/util.c Wed Jul 20 15:25:34 2011 +0100
-@@ -125,11 +125,11 @@
-
- int strncmp(const char *s1, const char *s2, uint32_t n)
- {
-- uint32_t ctr;
-- for (ctr = 0; ctr < n; ctr++)
-- if (s1[ctr] != s2[ctr])
-- return (int)(s1[ctr] - s2[ctr]);
-- return 0;
-+ uint32_t ctr;
-+ for (ctr = 0; ctr < n; ctr++)
-+ if (s1[ctr] != s2[ctr])
-+ return (int)(s1[ctr] - s2[ctr]);
-+ return 0;
- }
-
- void *memcpy(void *dest, const void *src, unsigned n)
-
diff --git a/main/xen/xen-sed-is-broken-hack.patch b/main/xen/xen-sed-is-broken-hack.patch
deleted file mode 100644
index 4168f72060..0000000000
--- a/main/xen/xen-sed-is-broken-hack.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- xen-4.0.1/xen/arch/x86/boot/Makefile
-+++ xen-4.0.1.mod/xen/arch/x86/boot/Makefile
-@@ -2,7 +2,7 @@
-
- head.o: reloc.S
-
--BOOT_TRAMPOLINE := $(shell sed -n 's,^\#define[[:space:]]\{1\,\}BOOT_TRAMPOLINE[[:space:]]\{1\,\},,p' $(BASEDIR)/include/asm-x86/config.h)
-+BOOT_TRAMPOLINE := 0x7c000
- %.S: %.c
- RELOC=$(BOOT_TRAMPOLINE) XEN_BITSPERLONG=$(patsubst x86_%,%,$(TARGET_SUBARCH)) $(MAKE) -f build32.mk $@
-
diff --git a/main/xen/xen-x86-pic.patch b/main/xen/xen-x86-pic.patch
deleted file mode 100644
index dcb4d0d817..0000000000
--- a/main/xen/xen-x86-pic.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- ./tools/misc/xen-detect.c.orig
-+++ ./tools/misc/xen-detect.c
-@@ -41,8 +41,16 @@
- int pv_context)
- {
- asm volatile (
-+#if defined(__PIC__) && defined(__i386__)
-+ "movl %%ebx, %%edi ;"
-+ "test %1,%1 ; jz 1f ; ud2a ; .ascii \"xen\" ;"
-+ "1: cpuid ; "
-+ "xchg %%ebx, %%edi"
-+ : "=a" (*eax), "=D" (*ebx), "=c" (*ecx), "=d" (*edx)
-+#else
- "test %1,%1 ; jz 1f ; ud2a ; .ascii \"xen\" ; 1: cpuid"
- : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
-+#endif
- : "0" (idx), "1" (pv_context) );
- }
-
diff --git a/main/xen/xencommons.initd b/main/xen/xencommons.initd
index 1ad0fb8c35..3d3c5da387 100755..100644
--- a/main/xen/xencommons.initd
+++ b/main/xen/xencommons.initd
@@ -3,89 +3,100 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: $
-opts="start stop status restart"
-
if [ -d /etc/sysconfig ]; then
- xencommons_config=/etc/sysconfig
+ xencommons_config=/etc/sysconfig
else
- xencommons_config=/etc/default
+ xencommons_config=/etc/default
fi
test -f $xencommons_config/xencommons && . $xencommons_config/xencommons
XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid
-#shopt -s extglob
+# not running in Xen dom0 or domU
+if ! test -d /proc/xen ; then
+ exit 0
+fi
+
+# mount xenfs in dom0 or domU with a pv_ops kernel
if test "x$1" = xstart && \
- test -d /proc/xen && \
- ! test -f /proc/xen/capabilities && \
- ! grep '^xenfs ' /proc/mounts >/dev/null;
+ ! test -f /proc/xen/capabilities && \
+ ! grep '^xenfs ' /proc/mounts >/dev/null;
then
- mount -t xenfs xenfs /proc/xen
+ mount -t xenfs xenfs /proc/xen
fi
-if ! grep -q "control_d" /proc/xen/capabilities ; then
- exit 0
+# run this script only in dom0:
+# no capabilities file in xenlinux domU kernel
+# empty capabilities file in pv_ops domU kernel
+if test -f /proc/xen/capabilities && \
+ ! grep -q "control_d" /proc/xen/capabilities ; then
+ exit 0
fi
depend() {
- need net
- before xend
+ need udev
+ before xend
}
start() {
- local time=0
- local timeout=30
-
- if ! `xenstore-read -s / >/dev/null 2>&1`
- then
- test -z "$XENSTORED_ROOTDIR" || XENSTORED_ROOTDIR="/var/lib/xenstored"
- rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
- test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
-
- ebegin "Starting xenstored..."
- xenstored --pid-file=/var/run/xenstored.pid $XENSTORED_ARGS
-
- # Wait for xenstored to actually come up, timing out after 30 seconds
- while [ $time -lt $timeout ] && ! `xenstore-read -s / >/dev/null 2>&1` ; do
- time=$(($time+1))
- sleep 1
- done
-
- # Exit if we timed out
- if ! [ $time -lt $timeout ] ; then
- eend 1
- echo Could not start xenstored
- exit 1
- fi
- eend 0
-
- ebegin "Setting domain 0 name..."
- xenstore-write "/local/domain/0/name" "Domain-0"
- eend $?
- fi
-
- ebegin "Starting xenconsoled..."
- test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
- xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
- eend $?
-
- test -z "$XENBACKENDD_DEBUG" || XENBACKENDD_ARGS="-d"
- test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS
+ local time=0
+ local timeout=30
+
+ modprobe xen-evtchn 2>/dev/null
+ modprobe xen-gntdev 2>/dev/null
+ modprobe evtchn 2>/dev/null
+ modprobe gntdev 2>/dev/null
+
+ if ! `xenstore-read -s / >/dev/null 2>&1`
+ then
+ test -z "$XENSTORED_ROOTDIR" || XENSTORED_ROOTDIR="/var/lib/xenstored"
+ rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
+ test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
+
+ ebegin "Starting xenstored..."
+ xenstored --pid-file=/var/run/xenstored.pid $XENSTORED_ARGS
+
+ # Wait for xenstored to actually come up, timing out after 30 seconds
+ while [ $time -lt $timeout ] && ! `xenstore-read -s / >/dev/null 2>&1` ; do
+ time=$(($time+1))
+ sleep 1
+ done
+
+ # Exit if we timed out
+ if ! [ $time -lt $timeout ] ; then
+ eend 1
+ echo Could not start xenstored
+ exit 1
+ fi
+ eend 0
+
+ ebegin "Setting domain 0 name..."
+ xenstore-write "/local/domain/0/name" "Domain-0"
+ eend $?
+ fi
+
+ ebegin "Starting xenconsoled..."
+ test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
+ xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
+ eend $?
+
+ test -z "$XENBACKENDD_DEBUG" || XENBACKENDD_ARGS="-d"
+ test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS
}
stop() {
- ebegin "Stopping xenconsoled"
- if read 2>/dev/null <$XENCONSOLED_PIDFILE pid; then
- kill $pid
- while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
- rm -f $XENCONSOLED_PIDFILE
- fi
- eend 0
-
- echo WARNING: Not stopping xenstored, as it cannot be restarted.
+ ebegin "Stopping xenconsoled"
+ if read 2>/dev/null <$XENCONSOLED_PIDFILE pid; then
+ kill $pid
+ while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
+ rm -f $XENCONSOLED_PIDFILE
+ fi
+ eend 0
+
+ echo WARNING: Not stopping xenstored, as it cannot be restarted.
}
status() {
- xenstore-read -s / >/dev/null 2>&1
+ xenstore-read -s / >/dev/null 2>&1
}
diff --git a/main/xen/xend.initd b/main/xen/xend.initd
index ee26c3f331..398ecd86b9 100644
--- a/main/xen/xend.initd
+++ b/main/xen/xend.initd
@@ -1,38 +1,53 @@
#!/sbin/runscript
depend() {
- need net xencommons
- before xendomains sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp
+ need xencommons
+ before xendomains
}
-is_privileged_domain() {
- grep -qsE '^control_d$' /proc/xen/capabilities
- return $?
+await_daemons_up() {
+ i=1
+ rets=10
+ /usr/sbin/xend status
+ while [ $? -ne 0 -a $i -lt $rets ]; do
+ sleep 1
+ i=$(($i + 1))
+ /usr/sbin/xend status
+ done
}
start() {
- if is_privileged_domain ; then
- ebegin "Starting Xen daemons"
- /usr/sbin/xend start
- eend $?
+ ebegin "Starting Xen daemons"
+ if [ -z "`ps xenconsoled -o pid=`" ]; then
+ eend 1
+ echo "xencommons should be started first."
+ exit 1
+ fi
+ mkdir -p /var/lock
+ if [ -d /var/lock/subsys ]; then
+ touch /var/lock/subsys/xend
else
- eerror "Can't start xend - not a privileged domain"
- return 1
+ touch /var/lock/xend
fi
+ /usr/sbin/xend start
+ await_daemons_up
+ eend $?
}
stop() {
ebegin "Stopping Xen control daemon"
/usr/sbin/xend stop
+ rm -f /var/lock/subsys/xend /var/lock/xend
eend $?
}
restart() {
ebegin "Restarting Xen control daemon"
/usr/sbin/xend restart
+ await_daemons_up
eend $?
}
status() {
- is_privileged_domain && /usr/sbin/xend status
+ /usr/sbin/xend status
}
diff --git a/main/xen/xendomains.initd b/main/xen/xendomains.initd
index d12577c2b0..0f309ef3d0 100644
--- a/main/xen/xendomains.initd
+++ b/main/xen/xendomains.initd
@@ -1,22 +1,64 @@
#!/sbin/runscript
+CMD=xm
+/usr/sbin/$CMD list &> /dev/null
+if test $? -ne 0
+then
+ CMD=xl
+fi
+
+/usr/sbin/$CMD list &> /dev/null
+if test $? -ne 0
+then
+ eend 1;
+ exit 1;
+fi
+
+# Correct exit code would probably be 5, but it's enough
+# if xend complains if we're not running as privileged domain
+if ! [ -e /proc/xen/privcmd ]; then
+ eend 1;
+ exit 1;
+fi
+
+# See docs/misc/distro_mapping.txt
+if [ -d /var/lock/subsys ]; then
+ LOCKFILE=/var/lock/subsys/xendomains
+else
+ LOCKFILE=/var/lock/xendomains
+fi
+
+if [ -d /etc/sysconfig ]; then
+ XENDOM_CONFIG=/etc/sysconfig/xendomains
+else
+ XENDOM_CONFIG=/etc/default/xendomains
+fi
+
+if ! [ -r $XENDOM_CONFIG ]; then
+ eend 1;
+ echo "$XENDOM_CONFIG not existing";
+ exit 1;
+fi
+
+. $XENDOM_CONFIG
+
depend() {
- need xend
- after dhcp
+ need xencommons
+ after net xend
}
get_domname() {
- local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1)
+ local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1)
- if [[ -z ${name_from_file} ]] ; then
- basename "${1}"
- else
- echo ${name_from_file}
- fi
+ if [[ -z ${name_from_file} ]] ; then
+ basename "${1}"
+ else
+ echo ${name_from_file}
+ fi
}
is_running() {
- /usr/sbin/xm list "${1}" >/dev/null 2>&1
+ /usr/sbin/$CMD list "${1}" >/dev/null 2>&1
}
start() {
@@ -26,7 +68,7 @@ start() {
name=$(get_domname ${dom})
if ! is_running ${name} ; then
ebegin " Starting domain ${name}"
- xm create --quiet ${dom}
+ /usr/sbin/$CMD create --quiet --defconfig ${dom}
eend $?
else
einfo " Not starting ${name} - already running."
@@ -41,7 +83,7 @@ stop() {
name=$(get_domname ${dom})
if is_running ${name} ; then
ebegin " Sending shutdown signal to ${name}"
- xm shutdown ${name} >/dev/null
+ /usr/sbin/$CMD shutdown ${name} >/dev/null
eend $?
fi
done
@@ -50,7 +92,7 @@ stop() {
name=$(get_domname ${dom})
if is_running ${name} ; then
ebegin " Waiting for domain ${name} to shutdown"
- xm shutdown --wait ${name}
+ /usr/sbin/$CMD shutdown --wait ${name}
eend $?
else
einfo " Not stopping ${name} - not running."
@@ -59,5 +101,5 @@ stop() {
}
status() {
- /usr/sbin/xm list
+ /usr/sbin/$CMD list
}