summaryrefslogtreecommitdiff
path: root/kernels/xe-guest-utilities/xe-guest-utilities-parabola.patch
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-02-26 21:53:52 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-02-26 21:53:52 -0500
commit7275399e96c64abc852c3746aa58d10bee8a5a44 (patch)
treea798ae34656585ec83f390dac95382ccc303919c /kernels/xe-guest-utilities/xe-guest-utilities-parabola.patch
parent4bfc44a83c098d0f6d731b855541140fac36b8aa (diff)
parent31763e92611731c859ccbe4e97019afabb5ef91e (diff)
downloadabslibre-7275399e96c64abc852c3746aa58d10bee8a5a44.tar.gz
abslibre-7275399e96c64abc852c3746aa58d10bee8a5a44.tar.bz2
abslibre-7275399e96c64abc852c3746aa58d10bee8a5a44.zip
Merge branch 'master' of ssh://parabolagnulinux.org:1863/abslibre
Diffstat (limited to 'kernels/xe-guest-utilities/xe-guest-utilities-parabola.patch')
-rw-r--r--kernels/xe-guest-utilities/xe-guest-utilities-parabola.patch146
1 files changed, 146 insertions, 0 deletions
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"