summaryrefslogtreecommitdiff
path: root/kernels/xen/archinit.patch
diff options
context:
space:
mode:
Diffstat (limited to 'kernels/xen/archinit.patch')
-rw-r--r--kernels/xen/archinit.patch450
1 files changed, 450 insertions, 0 deletions
diff --git a/kernels/xen/archinit.patch b/kernels/xen/archinit.patch
new file mode 100644
index 000000000..f5bece6e2
--- /dev/null
+++ b/kernels/xen/archinit.patch
@@ -0,0 +1,450 @@
+--- a/tools/hotplug/Linux/init.d/xencommons 2011-07-03 03:08:44.953747064 -0700
++++ b/tools/hotplug/Linux/init.d/xencommons 2011-07-05 13:47:54.627029164 -0700
+@@ -17,6 +17,8 @@
+ # Short-Description: Start/stop xenstored and xenconsoled
+ # Description: Starts and stops the daemons neeeded for xl/xend
+ ### END INIT INFO
++. /etc/rc.conf
++. /etc/rc.d/functions
+
+ if [ -d /etc/sysconfig ]; then
+ xencommons_config=/etc/sysconfig
+@@ -26,7 +28,7 @@
+
+ test -f $xencommons_config/xencommons && . $xencommons_config/xencommons
+
+-XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid
++XENCONSOLED_PIDFILE=/run/daemons/xenconsoled.pid
+ shopt -s extglob
+
+ # not running in Xen dom0 or domU
+@@ -69,7 +71,7 @@
+ modprobe pciback 2>/dev/null
+ modprobe xen-acpi-processor 2>/dev/null
+ modprobe blktap2 2>/dev/null || modprobe blktap 2>/dev/null
+- mkdir -p /var/run/xen
++ #mkdir -p /var/run/xen
+
+ if ! `xenstore-read -s / >/dev/null 2>&1`
+ then
+@@ -78,55 +80,66 @@
+ test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
+
+ if [ -n "$XENSTORED" ] ; then
+- echo -n Starting $XENSTORED...
+- $XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
++ #echo -n Starting $XENSTORED...
++ stat_busy "Starting $XENSTORED"
++ $XENSTORED --pid-file /run/daemons/xenstored.pid $XENSTORED_ARGS
+ elif [ -x /usr/sbin/oxenstored ] ; then
+- echo -n Starting oxenstored...
+- /usr/sbin/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
++ #echo -n Starting oxenstored...
++ stat_busy "Starting oxenstored"
++ /usr/sbin/oxenstored --pid-file /run/daemons/xenstored.pid $XENSTORED_ARGS
+ elif [ -x /usr/sbin/xenstored ] ; then
+- echo -n Starting C xenstored...
+- /usr/sbin/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
++ #echo -n Starting C xenstored...
++ stat_busy "Starting C xenstored"
++ /usr/sbin/xenstored --pid-file /run/daemons/xenstored.pid $XENSTORED_ARGS
+ else
+- echo "No xenstored found"
++ #echo "No xenstored found"
++ stat_fail
+ exit 1
+ fi
+
+ # Wait for xenstored to actually come up, timing out after 30 seconds
+ while [ $time -lt $timeout ] && ! `xenstore-read -s / >/dev/null 2>&1` ; do
+- echo -n .
++ #echo -n .
+ time=$(($time+1))
+ sleep 1
+ done
+- echo
++ #echo
+
+ # Exit if we timed out
+ if ! [ $time -lt $timeout ] ; then
+- echo Could not start xenstored
++ #echo Could not start xenstored
++ stat_fail
+ exit 1
+ fi
+
+- echo Setting domain 0 name...
++ #echo Setting domain 0 name...
++ stat_busy "Setting domain0 name"
+ xenstore-write "/local/domain/0/name" "Domain-0"
+ fi
+
+- echo Starting xenconsoled...
++ #echo Starting xenconsoled...
++ stat_busy "Starting xenconsoled"
+ test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
+ xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
+ test -z "$XENBACKENDD_DEBUG" || XENBACKENDD_ARGS="-d"
+ test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS
+- echo Starting QEMU as disk backend for dom0
++ #echo Starting QEMU as disk backend for dom0
++ stat_busy "Starting QEMU as disk backend for dom0"
+ test -z "$QEMU_XEN" && QEMU_XEN=/usr/lib/xen/bin/qemu-system-i386
+ $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null
++ stat_done
+ }
+ do_stop () {
+- echo Stopping xenconsoled
++ #echo Stopping xenconsoled
++ stat_busy "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
++ stat_done
+
+- echo WARNING: Not stopping xenstored, as it cannot be restarted.
++ #echo WARNING: Not stopping xenstored, as it cannot be restarted.
+ }
+
+ case "$1" in
+--- a/tools/hotplug/Linux/init.d/xend 2011-07-03 03:08:44.953747064 -0700
++++ b/tools/hotplug/Linux/init.d/xend 2011-07-05 01:47:40.981951191 -0700
+@@ -18,6 +18,10 @@
+ # Description: Starts and stops the Xen control daemon.
+ ### END INIT INFO
+
++. /etc/rc.conf
++. /etc/rc.d/functions
++
++
+ shopt -s extglob
+
+ # Wait for Xend to be up
+@@ -37,23 +41,30 @@
+ case "$1" in
+ start)
+ if [ -z "`ps -C xenconsoled -o pid=`" ]; then
+- echo "xencommons should be started first."
++ printhl "xencommons should be started first."
+ exit 1
+ fi
+ # mkdir shouldn't be needed as most distros have this already created. Default to using subsys.
+ # See docs/misc/distro_mapping.txt
+- mkdir -p /var/lock
+- if [ -d /var/lock/subsys ] ; then
+- touch /var/lock/subsys/xend
++ if [ -d /run/lock/subsys ] ; then
++ touch /run/lock/subsys/xend
+ else
+- touch /var/lock/xend
++ touch /run/lock/xend
+ fi
++ stat_busy "Starting xend"
+ xend start
+ await_daemons_up
++ stat_done
++ add_daemon xend
+ ;;
++
++
+ stop)
++ stat_busy "Stopping xend"
+ xend stop
+- rm -f /var/lock/subsys/xend /var/lock/xend
++ rm -f /run/lock/xend /var/lock/xend
++ stat_done
++ rm_daemon xend
+ ;;
+ status)
+ xend status
+@@ -62,8 +73,10 @@
+ xend reload
+ ;;
+ restart|force-reload)
++ stat_busy "Restarting xend"
+ xend restart
+ await_daemons_up
++ stat_done
+ ;;
+ *)
+ # do not advertise unreasonable commands that there is no reason
+--- a/tools/hotplug/Linux/init.d/xendomains 2011-07-03 03:08:44.953747064 -0700
++++ b/tools/hotplug/Linux/init.d/xendomains 2011-07-05 13:46:36.208222760 -0700
+@@ -26,6 +26,9 @@
+ # Description: Start / stop domains automatically when domain 0
+ # boots / shuts down.
+ ### END INIT INFO
++. /etc/rc.conf
++. /etc/rc.d/functions
++
+
+ CMD=xm
+ $CMD list &> /dev/null
+@@ -46,93 +49,52 @@
+ exit 0
+ 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
++LOCKFILE=/run/lock/xendomains
++XENDOM_CONFIG=/etc/default/xendomains
+
+-test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing";
++test -r $XENDOM_CONFIG || {
++ printhl "$XENDOM_CONFIG not existing";
+ if [ "$1" = "stop" ]; then exit 0;
+ else exit 6; fi; }
+
+ . $XENDOM_CONFIG
+
+-# Use the SUSE rc_ init script functions;
+-# emulate them on LSB, RH and other systems
+-if test -e /etc/rc.status; then
+- # SUSE rc script library
+- . /etc/rc.status
+-else
+- _cmd=$1
+- declare -a _SMSG
+- if test "${_cmd}" = "status"; then
++_cmd=$1
++declare -a _SMSG
++if test "${_cmd}" = "status"; then
+ _SMSG=(running dead dead unused unknown)
+ _RC_UNUSED=3
+- else
++else
+ _SMSG=(done failed failed missed failed skipped unused failed failed)
+ _RC_UNUSED=6
+- fi
+- if test -e /etc/init.d/functions; then
+- # REDHAT
+- . /etc/init.d/functions
+- echo_rc()
+- {
+- #echo -n " [${_SMSG[${_RC_RV}]}] "
+- if test ${_RC_RV} = 0; then
+- success " [${_SMSG[${_RC_RV}]}] "
+- else
+- failure " [${_SMSG[${_RC_RV}]}] "
+- fi
+- }
+- elif test -e /lib/lsb/init-functions; then
+- # LSB
+- . /lib/lsb/init-functions
+- if alias log_success_msg >/dev/null 2>/dev/null; then
+- echo_rc()
+- {
+- echo " [${_SMSG[${_RC_RV}]}] "
+- }
+- else
+- echo_rc()
+- {
+- if test ${_RC_RV} = 0; then
+- log_success_msg " [${_SMSG[${_RC_RV}]}] "
+- else
+- log_failure_msg " [${_SMSG[${_RC_RV}]}] "
+- fi
+- }
+- fi
+- else
+- # emulate it
+- echo_rc()
+- {
+- echo " [${_SMSG[${_RC_RV}]}] "
+- }
+- fi
+- rc_reset() { _RC_RV=0; }
+- rc_failed()
+- {
++fi
++
++
++
++echo_rc() {
++ echo
++ printhl "Return Status: ${_SMSG[${_RC_RV}]}"
++}
++
++
++rc_reset() { _RC_RV=0; }
++
++
++rc_failed() {
+ if test -z "$1"; then
+- _RC_RV=1;
++ _RC_RV=1;
+ elif test "$1" != "0"; then
+- _RC_RV=$1;
+- fi
++ _RC_RV=$1;
++ fi
+ return ${_RC_RV}
+- }
+- rc_check()
+- {
++}
++
++rc_check() {
+ return rc_failed $?
+- }
+- rc_status()
+- {
++}
++
++
++rc_status() {
+ rc_failed $?
+ if test "$1" = "-r"; then _RC_RV=0; shift; fi
+ if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi
+@@ -140,26 +102,24 @@
+ if test "$1" = "-v"; then echo_rc; shift; fi
+ if test "$1" = "-r"; then _RC_RV=0; shift; fi
+ return ${_RC_RV}
+- }
+- rc_exit() { exit ${_RC_RV}; }
+- rc_active()
+- {
++}
++
++
++rc_exit() { exit ${_RC_RV}; }
++
++
++rc_active() {
+ if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi
+ if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi
+ return 1
+- }
+-fi
++}
+
+-if ! which usleep >&/dev/null
+-then
+- usleep()
+- {
+- if [ -n "$1" ]
+- then
+- sleep $(( $1 / 1000000 ))
+- fi
+- }
+-fi
++usleep() {
++ if [ -n "$1" ]
++ then
++ sleep $(( $1 / 1000000 ))
++ fi
++}
+
+ # Reset status of this service
+ rc_reset
+@@ -240,10 +200,12 @@
+ start()
+ {
+ if [ -f $LOCKFILE ]; then
+- echo -e "xendomains already running (lockfile exists)"
++ stat_busy "xendomains already running (lockfile exists)"
++ stat_fail
+ return;
+ fi
+
++ printhl "Starting Xen Domains"
+ saved_domains=" "
+ if [ "$XENDOMAINS_RESTORE" = "true" ] &&
+ contains_something "$XENDOMAINS_SAVE"
+@@ -304,6 +266,7 @@
+ fi
+ done
+ fi
++ add_daemon xendomains
+ }
+
+ all_zombies()
+@@ -357,7 +320,7 @@
+ if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
+ rdnames
+ fi
+- echo -n "Shutting down Xen domains:"
++ printhl "Shutting down Xen domains"
+ name=;id=
+ while read LN; do
+ parseln "$LN" || continue
+@@ -470,6 +433,7 @@
+ rm -f $LOCKFILE
+
+ exec 2>&3
++ rm_daemon xendomains
+ }
+
+ check_domain_up()
+--- a/tools/hotplug/Linux/init.d/xen-watchdog 2011-07-03 03:08:44.957080397 -0700
++++ b/tools/hotplug/Linux/init.d/xen-watchdog 2011-07-05 13:20:22.515289867 -0700
+@@ -17,49 +17,32 @@
+ ### END INIT INFO
+ #
+
++. /etc/rc.conf
++. /etc/rc.d/functions
++
+ DAEMON=/usr/sbin/xenwatchdogd
+ base=$(basename $DAEMON)
++initname="xen-watchdog"
+
+-# Source function library.
+-if [ -e /etc/init.d/functions ] ; then
+- . /etc/init.d/functions
+-elif [ -e /lib/lsb/init-functions ] ; then
+- . /lib/lsb/init-functions
+- success () {
+- log_success_msg $*
+- }
+- failure () {
+- log_failure_msg $*
+- }
+-else
+- success () {
+- echo $*
+- }
+- failure () {
+- echo $*
+- }
+-fi
+
+ start() {
+ local r
+- echo -n $"Starting domain watchdog daemon: "
++ stat_busy "Starting domain watchdog daemon"
+
+ $DAEMON 30 15
+ r=$?
+- [ "$r" -eq 0 ] && success $"$base startup" || failure $"$base startup"
+- echo
++ [ "$r" -eq 0 ] && stat_done ; add_daemon $initname || stat_fail
+
+ return $r
+ }
+
+ stop() {
+ local r
+- echo -n $"Stopping domain watchdog daemon: "
++ stat_busy "Stopping domain watchdog daemon"
+
+ killall -USR1 $base 2>/dev/null
+ r=$?
+- [ "$r" -eq 0 ] && success $"$base stop" || failure $"$base stop"
+- echo
++ [ "$r" -eq 0 ] && stat_done ; rm_daemon $initname || stat_fail
+
+ return $r
+ }