From 1e7b1f88c3ef7648c2f8f566ca30b6ba7ef4e980 Mon Sep 17 00:00:00 2001 From: statzitz Date: Tue, 23 Jul 2024 12:54:54 +0200 Subject: [PATCH] add scripts I've create yesterday --- proc-xen/proc-xen.check | 4 ++++ proc-xen/proc-xen.finish | 3 +++ proc-xen/proc-xen.run | 11 +++++++++++ proc-xen/proc-xen.sysinit | 21 +++++++++++++++++++++ xen-init-dom0.run | 15 +++++++++++++++ xenconsoled.run | 17 +++++++++++++++++ xendomains.run | 16 ++++++++++++++++ xenstored.run | 14 ++++++++++++++ 8 files changed, 101 insertions(+) create mode 100755 proc-xen/proc-xen.check create mode 100755 proc-xen/proc-xen.finish create mode 100755 proc-xen/proc-xen.run create mode 100755 proc-xen/proc-xen.sysinit create mode 100755 xen-init-dom0.run create mode 100755 xenconsoled.run create mode 100755 xendomains.run create mode 100755 xenstored.run diff --git a/proc-xen/proc-xen.check b/proc-xen/proc-xen.check new file mode 100755 index 0000000..117ed2b --- /dev/null +++ b/proc-xen/proc-xen.check @@ -0,0 +1,4 @@ +#!/bin/sh + +mount | grep -q xenfs && exit 0 +exit 1 diff --git a/proc-xen/proc-xen.finish b/proc-xen/proc-xen.finish new file mode 100755 index 0000000..5f92641 --- /dev/null +++ b/proc-xen/proc-xen.finish @@ -0,0 +1,3 @@ +#!/bin/sh + +umount /proc/xen diff --git a/proc-xen/proc-xen.run b/proc-xen/proc-xen.run new file mode 100755 index 0000000..7f6a284 --- /dev/null +++ b/proc-xen/proc-xen.run @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +[ ! -d /proc/xen ] && exit 0 +[ -e /proc/xen/capabilities ] && exit 0 + +mount -t xenfs xenfs /proc/xen + +exec chpst -b proc-xen pause + diff --git a/proc-xen/proc-xen.sysinit b/proc-xen/proc-xen.sysinit new file mode 100755 index 0000000..5ea6378 --- /dev/null +++ b/proc-xen/proc-xen.sysinit @@ -0,0 +1,21 @@ +#!/bin/sh + +. /usr/lib/rc/functions + + +case "$1" in + start) + stat_busy "mounting xen" + [ ! -d /proc/xen ] && stat_die proc-xen + [ -e /proc/xen/capabilities ] && stat_die proc-xen + + mount -t xenfs xenfs /proc/xen || stat_die proc-xen + + add_daemon proc-xen + stat_done proc-xen + ;; + *) + echo "usage: $0 {start}" + exit 1 + ;; +esac diff --git a/xen-init-dom0.run b/xen-init-dom0.run new file mode 100755 index 0000000..2ef97f4 --- /dev/null +++ b/xen-init-dom0.run @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +sv s proc-xen > /dev/null || exit 1 +sv s xenstored > /dev/null || exit 1 + +[ -e /run/xen/xenstored.pid ] || exit 1 + +. /etc/conf.d/xencommons +/bin/grep -q control_d /proc/xen/capabilities || exit 0 + +/usr/lib/xen/bin/xen-init-dom0 $XEN_DOM0_UUID > /dev/null + +exec chpst -b xen-init-dom0 pause diff --git a/xenconsoled.run b/xenconsoled.run new file mode 100755 index 0000000..f3092bb --- /dev/null +++ b/xenconsoled.run @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +sv s proc-xen > /dev/null || exit 1 +sv s xenstored > /dev/null || exit 1 + +export XENCONSOLED_ARGS="" +export XENCONSOLED_TRACE="none" +export XENCONSOLED_LOG_DIR="/var/log/xen/console" + +. /etc/conf.d/xencommons + +/bin/grep -q control_d /proc/xen/capabilities || exit 1 +/bin/mkdir -p ${XENCONSOLED_LOG_DIR} /run/xen || exit 1 + +exec /usr/bin/xenconsoled -i --log=${XENCONSOLED_TRACE} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS diff --git a/xendomains.run b/xendomains.run new file mode 100755 index 0000000..beb5be0 --- /dev/null +++ b/xendomains.run @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +sv s proc-xen > /dev/null || exit 1 +sv s xenstored > /dev/null || exit 1 +sv s xenconsoled > /dev/null || exit 1 +sv s xen-init-dom0 > /dev/null || exit 1 + +[ -e /proc/xen/capabilities ] || exit 1 +/bin/grep -q control_d /proc/xen/capabilities || exit 1 + +/usr/lib/xen/bin/xendomains start > /dev/null + +exec chpst -b xendomains pause + diff --git a/xenstored.run b/xenstored.run new file mode 100755 index 0000000..1c0e102 --- /dev/null +++ b/xenstored.run @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +[ -e /proc/xen/capabilities ] || exit 1 +sv s proc-xen > /dev/null || exit 1 +/bin/grep -q control_d /proc/xen/capabilities || exit 1 + + +sleep 3 + +/etc/xen/scripts/launch-xenstore > /dev/null + +exec chpst -b xenstored pause