aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/xe-guest-utilities/APKBUILD60
-rw-r--r--main/xe-guest-utilities/fix_cflags.patch43
-rw-r--r--main/xe-guest-utilities/identify_alpine.patch43
-rw-r--r--main/xe-guest-utilities/no_bash_dependency.patch8
-rw-r--r--main/xe-guest-utilities/no_hard_links.patch11
-rw-r--r--main/xe-guest-utilities/xe-guest-utilities.initd50
6 files changed, 215 insertions, 0 deletions
diff --git a/main/xe-guest-utilities/APKBUILD b/main/xe-guest-utilities/APKBUILD
new file mode 100644
index 0000000000..5b4e481058
--- /dev/null
+++ b/main/xe-guest-utilities/APKBUILD
@@ -0,0 +1,60 @@
+# Contributor: Cedric Schieli <cschieli@gmail.com>
+# Maintainer: Citrix
+pkgname=xe-guest-utilities
+_major=5.5.0
+_minor=458
+pkgver=${_major}.${_minor}
+pkgrel=0
+pkgdesc="XenServer guest tools"
+url="http://www.citrix.com"
+license="GPL"
+depends=
+makedepends=
+install=
+subpackages=
+source="http://updates.vmd.citrix.com/XenServer/${_major}/debian/pool/main/x/${pkgname}/${pkgname}_${_major}-${_minor}.tar.gz
+ $pkgname.initd
+ no_bash_dependency.patch
+ identify_alpine.patch
+ fix_cflags.patch
+ no_hard_links.patch
+ "
+
+_builddir="$srcdir"/$pkgname-$_major
+
+prepare() {
+ cd "$_builddir"
+
+ msg "Unpacking xenstore-sources..."
+ tar xjf xenstore-sources.tar.bz2
+
+ for i in ../*.diff ../*.patch; do
+ [ -f $i ] || continue
+ msg "Applying $i..."
+ patch -s -p1 -N < $i || return 1
+ done
+
+ ln -s ../../xen/include/public uclibc-sources/tools/xenstore/xen
+}
+
+build() {
+ cd "$_builddir"/uclibc-sources/tools/xenstore
+ make XENSTORE_STATIC_CLIENTS=y clients
+}
+
+package() {
+ cd "$_builddir"
+ install -m755 -D "$_builddir"/xe-linux-distribution "$pkgdir"/usr/sbin/xe-linux-distribution
+ install -m755 -D "$_builddir"/xe-update-guest-attrs "$pkgdir"/usr/sbin/xe-update-guest-attrs
+ install -m755 -D "$_builddir"/xe-daemon "$pkgdir"/usr/sbin/xe-daemon
+ install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ cd uclibc-sources/tools/xenstore
+ make DESTDIR="$pkgdir" client-install
+}
+
+md5sums="b15546f0b3883472140f35f5f8802a92 xe-guest-utilities_5.5.0-458.tar.gz
+d2eefda7fb55926dddbf87f17989b16e xe-guest-utilities.initd
+1fe4c6c4621982a87de97d897612eef7 no_bash_dependency.patch
+aa129940379b312783dc314497f62042 identify_alpine.patch
+cf32b9c90ce2e846d2221eaca0638929 fix_cflags.patch
+96e872ed89792f9d1b5cb51f8fdfd5f6 no_hard_links.patch"
diff --git a/main/xe-guest-utilities/fix_cflags.patch b/main/xe-guest-utilities/fix_cflags.patch
new file mode 100644
index 0000000000..866fa29fd3
--- /dev/null
+++ b/main/xe-guest-utilities/fix_cflags.patch
@@ -0,0 +1,43 @@
+--- xe-guest-utilities-5.5.0.orig/uclibc-sources/Config.mk
++++ xe-guest-utilities-5.5.0/uclibc-sources/Config.mk
+@@ -70,7 +70,6 @@
+ export XEN_ROOT
+ endef
+
+-CFLAGS += -g
+
+ CFLAGS += -fno-strict-aliasing
+
+--- xe-guest-utilities-5.5.0.orig/uclibc-sources/config/StdGNU.mk
++++ xe-guest-utilities-5.5.0/uclibc-sources/config/StdGNU.mk
+@@ -44,7 +44,6 @@
+ SHLIB_CFLAGS = -shared
+
+ ifneq ($(debug),y)
+-CFLAGS += -O2 -fomit-frame-pointer
+ else
+ # Less than -O1 produces bad code and large stack frames
+ CFLAGS += -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls
+--- xe-guest-utilities-5.5.0.orig/uclibc-sources/config/x86_32.mk
++++ xe-guest-utilities-5.5.0/uclibc-sources/config/x86_32.mk
+@@ -7,7 +7,6 @@
+ CONFIG_XCUTILS := y
+ CONFIG_IOEMU := n
+
+-CFLAGS += -m32 -march=i686
+
+ # Use only if calling $(LD) directly.
+ LDFLAGS_DIRECT_OpenBSD = _obsd
+--- xe-guest-utilities-5.5.0.orig/uclibc-sources/tools/Rules.mk
++++ xe-guest-utilities-5.5.0/uclibc-sources/tools/Rules.mk
+@@ -27,9 +27,7 @@
+ CFLAGS += -D__XEN_TOOLS__
+
+ # Enable implicit LFS support *and* explicit LFS names.
+-CFLAGS += $(shell getconf LFS_CFLAGS)
+-CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+-LDFLAGS += $(shell getconf LFS_LDFLAGS)
++CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+
+ # 32-bit x86 does not perform well with -ve segment accesses on Xen.
+ CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs)
diff --git a/main/xe-guest-utilities/identify_alpine.patch b/main/xe-guest-utilities/identify_alpine.patch
new file mode 100644
index 0000000000..d645c139ab
--- /dev/null
+++ b/main/xe-guest-utilities/identify_alpine.patch
@@ -0,0 +1,43 @@
+--- xe-guest-utilities-5.5.0.orig/xe-linux-distribution
++++ xe-guest-utilities-5.5.0/xe-linux-distribution
+@@ -248,6 +248,32 @@
+ write_to_output "${distro}" "${major}" "${minor}" "${description}"
+ }
+
++identify_alpine()
++{
++ alpine_release="$1"
++ local major
++ local minor
++
++ if [ ! -f "${alpine_release}" ] ; then
++ return 1
++ fi
++
++ eval $(sed -n \
++ -e 's/^.*-\([0-9]*\)\.\([0-9]*\)\.[0-9]* .*$/major=\1;minor=\2/gp;' \
++ -e 's/^.*-\([0-9]*\) .*$/major=\1;minor=/gp;' \
++ "${alpine_release}")
++
++ if [ -z "${major}" ] ; then
++ return 1
++ fi
++
++ if [ -z "${minor}" ] ; then
++ minor=0
++ fi
++
++ write_to_output "alpine" "${major}" "${minor}" "Alpinelinux $(head -n 1 $alpine_release)"
++}
++
+ if [ $# -eq 1 ] ; then
+ exec 1>"$1"
+ fi
+@@ -257,6 +283,7 @@
+ identify_sles /etc/SuSE-release && exit 0
+ identify_lsb lsb_release && exit 0
+ identify_debian /etc/debian_version && exit 0
++ identify_alpine /etc/alpine-release && exit 0
+
+ if [ $# -eq 1 ] ; then
+ rm -f "$1"
diff --git a/main/xe-guest-utilities/no_bash_dependency.patch b/main/xe-guest-utilities/no_bash_dependency.patch
new file mode 100644
index 0000000000..27d9af285b
--- /dev/null
+++ b/main/xe-guest-utilities/no_bash_dependency.patch
@@ -0,0 +1,8 @@
+--- xe-guest-utilities-5.5.0.orig/xe-daemon
++++ xe-guest-utilities-5.5.0/xe-daemon
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # Copyright (C) 2009 Citrix Systems Inc.
+ #
diff --git a/main/xe-guest-utilities/no_hard_links.patch b/main/xe-guest-utilities/no_hard_links.patch
new file mode 100644
index 0000000000..c10918f391
--- /dev/null
+++ b/main/xe-guest-utilities/no_hard_links.patch
@@ -0,0 +1,11 @@
+--- xe-guest-utilities-5.5.0.orig/uclibc-sources/tools/xenstore/Makefile
++++ xe-guest-utilities-5.5.0/uclibc-sources/tools/xenstore/Makefile
+@@ -97,7 +97,7 @@
+ $(INSTALL_DIR) $(DESTDIR)/usr/bin
+ $(INSTALL_PROG) xenstore $(DESTDIR)/usr/bin
+ set -e ; for c in $(CLIENTS) ; do \
+- ln -f $(DESTDIR)/usr/bin/xenstore $(DESTDIR)/usr/bin/$${c} ; \
++ ln -sf $(DESTDIR)/usr/bin/xenstore $(DESTDIR)/usr/bin/$${c} ; \
+ done
+
+ .PHONY: install
diff --git a/main/xe-guest-utilities/xe-guest-utilities.initd b/main/xe-guest-utilities/xe-guest-utilities.initd
new file mode 100644
index 0000000000..2d9c880da7
--- /dev/null
+++ b/main/xe-guest-utilities/xe-guest-utilities.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+
+XE_LINUX_DISTRIBUTION=/usr/sbin/xe-linux-distribution
+XE_LINUX_DISTRIBUTION_CACHE=/var/cache/xe-linux-distribution
+XE_DAEMON=/usr/sbin/xe-daemon
+XE_DAEMON_PIDFILE=/var/run/xe-daemon.pid
+
+name=xe-daemon
+daemon=/usr/sbin/$name
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+start() {
+ if [ ! -d /proc/xen ]; then
+ return
+ fi
+
+ ebegin "Detecting Linux distribution version"
+ ${XE_LINUX_DISTRIBUTION} ${XE_LINUX_DISTRIBUTION_CACHE}
+ eend $?
+
+ if [ ! -e /proc/xen/xenbus ] ; then
+ ebegin "Mounting xenfs on /proc/xen"
+ if [ ! -d /proc/xen ] ; then
+ /bin/false
+ else
+ mount -t xenfs none /proc/xen
+ fi
+ eend $?
+ fi
+
+ ebegin "Starting ${name}"
+ mkdir -p $(dirname ${XE_DAEMON_PIDFILE})
+ ( exec &>/dev/null ; ${XE_DAEMON} -p ${XE_DAEMON_PIDFILE} & )
+ eend $?
+}
+
+stop() {
+ if [ ! -d /proc/xen ]; then
+ return
+ fi
+
+ ebegin "Stopping ${name}"
+ kill -TERM $(cat ${XE_DAEMON_PIDFILE})
+ eend $?
+}
+