summaryrefslogtreecommitdiff
path: root/kernels/xe-guest-utilities
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <andre@pc-01.localdomain>2012-02-21 11:39:38 -0200
committerAndré Fabian Silva Delgado <andre@pc-01.localdomain>2012-02-21 11:39:38 -0200
commit415e6b0a686989d0000a82ba8404d4ab9cd1e6b7 (patch)
tree4c78f30103549386aa7f645c7f2623c181ce0572 /kernels/xe-guest-utilities
parent8446919c3950deb73699302e1c33cdc05b7d4add (diff)
kernels/xe-guest-utilities
Diffstat (limited to 'kernels/xe-guest-utilities')
-rw-r--r--kernels/xe-guest-utilities/PKGBUILD45
-rw-r--r--kernels/xe-guest-utilities/ip_address.patch30
-rw-r--r--kernels/xe-guest-utilities/xe-guest-utilities-parabola.patch146
3 files changed, 221 insertions, 0 deletions
diff --git a/kernels/xe-guest-utilities/PKGBUILD b/kernels/xe-guest-utilities/PKGBUILD
new file mode 100644
index 000000000..b866a6f58
--- /dev/null
+++ b/kernels/xe-guest-utilities/PKGBUILD
@@ -0,0 +1,45 @@
+# Contributor: Krzysztof Raczkowski <raczkow@gnu-tech.pl>
+# Contributor (Parabola): André Silva <andre.paulista@adinet.com.uy>
+
+pkgname=xe-guest-utilities
+pkgver=6.0.0
+pkgrel=5
+pkgdesc="Citrix XenServer Tools"
+arch=('i686' 'x86_64')
+url="http://citrix.com/English/ps2/products/product.asp?contentID=683148&ntref=hp_nav_US"
+license=('GPL' 'LGPL')
+optdepends=('linux-libre: DomU kernel for x86_64'
+ 'linux-libre-xen: DomU kernel for i686'
+ 'kernel-libre-lts: DomU kernel for i686 (long time supported)')
+makedepends=('rpmextract')
+source=(ftp://ftp.prz.edu.pl/pub/archlinux/archrak/src/xe-guest-utilities-${pkgver}-743.i386.rpm
+ ftp://ftp.prz.edu.pl/pub/archlinux/archrak/src/xe-guest-utilities-xenstore-${pkgver}-743.i386.rpm
+ ftp://ftp.prz.edu.pl/pub/archlinux/archrak/src/xe-guest-utilities-${pkgver}-743.x86_64.rpm
+ ftp://ftp.prz.edu.pl/pub/archlinux/archrak/src/xe-guest-utilities-xenstore-${pkgver}-743.x86_64.rpm
+ xe-guest-utilities-parabola.patch
+ ip_address.patch)
+
+md5sums=('894d33028b2712650be324b7ba01c6c4'
+ 'e100f97421ff522cb228aa749881a082'
+ 'ffaf02afa2105d32e011a32c80921256'
+ '9b9570b5cc27832df303c8ef9cd11d36'
+ '0d8a8ebe124d585a2b101150df8f5ff7'
+ '86b4a69b412f874bf5b4db8ac8858644')
+
+build() {
+ cd $startdir/src
+ [ $CARCH == "i686" ] && (
+ rpmextract.sh xe-guest-utilities-*.i386.rpm && \
+ rpmextract.sh xe-guest-utilities-xenstore-*.i386.rpm || return 1
+ )
+ [ $CARCH == "x86_64" ] && (
+ rpmextract.sh xe-guest-utilities-*.x86_64.rpm && \
+ rpmextract.sh xe-guest-utilities-xenstore-*.x86_64.rpm || return 1
+ )
+
+ patch -Np1 -i ${srcdir}/xe-guest-utilities-parabola.patch || return 1
+ patch -Np1 -i ${srcdir}/ip_address.patch || return 1
+
+ cp -ra ${srcdir}/{etc,usr} ${pkgdir}/ || return 1
+ mv ${pkgdir}/etc/init.d ${pkgdir}/etc/rc.d
+}
diff --git a/kernels/xe-guest-utilities/ip_address.patch b/kernels/xe-guest-utilities/ip_address.patch
new file mode 100644
index 000000000..1e589ef37
--- /dev/null
+++ b/kernels/xe-guest-utilities/ip_address.patch
@@ -0,0 +1,30 @@
+--- src.orig/usr/sbin/xe-update-guest-attrs 2011-12-28 21:05:13.055346917 -0600
++++ src/usr/sbin/xe-update-guest-attrs 2011-12-28 21:04:02.545354603 -0600
+@@ -151,9 +151,9 @@
+ # 3: sit0: <NOARP> mtu 1480 qdisc noop
+ # link/sit 0.0.0.0 brd 0.0.0.0
+
+-#eval $(ip addr show | \
+-# sed -n -e 's/^[[:digit:]]*: \([a-z0-9]*\): .*/ifs="\$ifs \1"; current="\1"; /gp;' \
+-# -e 's/^[[:space:]]\{4\}inet \('${IPADDR_RE}'\)\/.*/eval inet_\${current}="\1"; /gp;')
++eval $(ip addr show | \
++ sed -n -e 's/^[[:digit:]]*: \([a-z0-9]*\): .*/ifs="\$ifs \1"; current="\1"; /gp;' \
++ -e 's/^[[:space:]]\{4\}inet \('${IPADDR_RE}'\)\/.*/eval inet_\${current}="\1"; /gp;')
+
+ # e.g.
+ # eth0 Link encap:Ethernet HWaddr 00:13:20:95:E8:74
+@@ -175,10 +175,10 @@
+ # collisions:0 txqueuelen:0
+ # RX bytes:3604609 (3.4 MiB) TX bytes:3604609 (3.4 MiB)
+
+-eval $(/sbin/ifconfig | \
+- sed -n -e '/^[0-9a-z][0-9a-z]*\:/,/^$/d' \
+- -e 's/^\([0-9a-z][0-9a-z]*\) .*/ifs="\$ifs \1"; current="\1"; /gp;' \
+- -e 's/ *inet addr:\('$IPADDR_RE'\) .*/eval inet_\${current}="\1"; /gp;')
++#eval $(/sbin/ifconfig | \
++# sed -n -e '/^[0-9a-z][0-9a-z]*\:/,/^$/d' \
++# -e 's/^\([0-9a-z][0-9a-z]*\) .*/ifs="\$ifs \1"; current="\1"; /gp;' \
++# -e 's/ *inet addr:\('$IPADDR_RE'\) .*/eval inet_\${current}="\1"; /gp;')
+
+ # network
+ for if in $ifs ; do \ No newline at end of file
diff --git a/kernels/xe-guest-utilities/xe-guest-utilities-parabola.patch b/kernels/xe-guest-utilities/xe-guest-utilities-parabola.patch
new file mode 100644
index 000000000..a433f6887
--- /dev/null
+++ b/kernels/xe-guest-utilities/xe-guest-utilities-parabola.patch
@@ -0,0 +1,146 @@
+diff -uNr src.orig//etc/init.d/xe-linux-distribution src/etc/init.d/xe-linux-distribution
+--- src.orig//etc/init.d/xe-linux-distribution 2010-05-20 13:19:02.000000000 +0200
++++ src/etc/init.d/xe-linux-distribution 2010-10-04 14:45:11.000000000 +0200
+@@ -18,24 +18,8 @@
+ LANG="C"
+ export LANG
+
+-if [ -f /etc/init.d/functions ] ; then
+-. /etc/init.d/functions
+-else
+-action()
+-{
+- descr=$1 ; shift
+- cmd=$@
+- echo -n "$descr "
+- $cmd
+- ret=$?
+- if [ $ret -eq 0 ] ; then
+- echo "OK"
+- else
+- echo "Failed"
+- fi
+- return $ret
+-}
+-fi
++. /etc/rc.conf
++. /etc/rc.d/functions
+
+ XE_LINUX_DISTRIBUTION=/usr/sbin/xe-linux-distribution
+ XE_LINUX_DISTRIBUTION_CACHE=/var/cache/xe-linux-distribution
+@@ -48,35 +32,59 @@
+
+ start()
+ {
++ if [ -e /proc/xen/capabilities ] && grep -q control_d /proc/xen/capabilities ; then
++ # Do not want daemon in domain 0
++ exit 0
++ fi
++
++ stat_busy "Detecting GNU/Linux distribution version"
++ ${XE_LINUX_DISTRIBUTION} ${XE_LINUX_DISTRIBUTION_CACHE}
++ if [ $? -gt 0 ]; then
++ stat_fail
++ else
++ stat_done
++ fi
++
+ if [ ! -e /proc/xen/xenbus ] ; then
+ if [ ! -d /proc/xen ] ; then
+- action $"Mounting xenfs on /proc/xen:" /bin/false
++ stat_busy "Mounting xenfs on /proc/xen"
+ echo "Could not find /proc/xen directory."
+ echo "You need a post 2.6.29-rc1 kernel with CONFIG_XEN_COMPAT_XENFS=y and CONFIG_XENFS=y|m"
+- exit 1
++ stat_die 1
+ else
+ # This is needed post 2.6.29-rc1 when /proc/xen support was pushed upstream as a xen filesystem
+- action $"Mounting xenfs on /proc/xen:" mount -t xenfs none /proc/xen
++ stat_busy "Mounting xenfs on /proc/xen"
++ mount -t xenfs none /proc/xen
++ if [ $? -gt 0 ]; then
++ stat_fail
++ else
++ stat_done
++ fi
+ fi
+ fi
+
+- if [ -e /proc/xen/capabilities ] && grep -q control_d /proc/xen/capabilities ; then
+- # Do not want daemon in domain 0
+- exit 0
+- fi
+-
+- action $"Detecting Linux distribution version:" \
+- ${XE_LINUX_DISTRIBUTION} ${XE_LINUX_DISTRIBUTION_CACHE}
+-
+- action $"Starting xe daemon: " /bin/true
++ stat_busy "Starting xe daemon"
+ mkdir -p $(dirname ${XE_DAEMON_PIDFILE})
+ # This is equivalent to daemon() in C
+ ( exec &>/dev/null ; ${XE_DAEMON} -p ${XE_DAEMON_PIDFILE} & )
++ if [ $? -gt 0 ]; then
++ stat_fail
++ else
++ add_daemon xe-linux-distribution
++ stat_done
++ fi
+ }
+
+ stop()
+ {
+- action $"Stopping xe daemon: " kill -TERM $(cat ${XE_DAEMON_PIDFILE})
++ stat_busy "Stopping xe daemon"
++ killall $(basename ${XE_DAEMON}) -TERM
++ if [ $? -gt 0 ]; then
++ stat_fail
++ else
++ rm_daemon xe-linux-distribution
++ stat_done
++ fi
+ }
+
+ # fail silently if not running xen
+@@ -91,7 +99,7 @@
+ stop)
+ stop
+ ;;
+- force-reload|restart)
++ restart)
+ stop
+ start
+ ;;
+diff -uNr src.orig//usr/sbin/xe-linux-distribution src/usr/sbin/xe-linux-distribution
+--- src.orig//usr/sbin/xe-linux-distribution 2010-05-20 13:19:02.000000000 +0200
++++ src/usr/sbin/xe-linux-distribution 2010-10-04 14:44:37.000000000 +0200
+@@ -51,6 +51,22 @@
+ return 0
+ }
+
++identify_parabola()
++{
++ local parabola_version="$1"
++ local major
++ local minor
++
++ if [ ! -f "${parabola_version}" ] ; then
++ return 1
++ fi
++
++ eval $(LC_ALL=C pacman -Qi initscripts |grep Version |sed "s/^.*: //" | \
++ awk -F. '{print "major="$1 ; print "minor="$2 ; exit 0 }' )
++ write_to_output "parabola" "${major}" "${minor}" "Parabola GNU/Linux-Libre ${major}.${minor}"
++
++}
++
+ identify_debian()
+ {
+ local debian_version="$1"
+@@ -258,6 +274,7 @@
+ identify_sles /etc/SuSE-release && exit 0
+ identify_lsb lsb_release && exit 0
+ identify_debian /etc/debian_version && exit 0
++ identify_parabola /etc/arch-release && exit 0
+
+ if [ $# -eq 1 ] ; then
+ rm -f "$1"