[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [stage1-xen PATCH v1 06/10] build/fedora: Add `xen-unstable-runit/*` scripts
From: Rajiv M Ranganath <rajiv.ranganath@xxxxxxxxxxx> Signed-off-by: Rajiv Ranganath <rajiv.ranganath@xxxxxxxxxxx> --- build/fedora/xen-unstable-runit/setup.sh | 18 ++++++++++++++++ build/fedora/xen-unstable-runit/teardown.sh | 18 ++++++++++++++++ .../xen-init-dom0-disk-backend/run | 11 ++++++++++ build/fedora/xen-unstable-runit/xen-init-dom0/run | 9 ++++++++ build/fedora/xen-unstable-runit/xenconsoled/run | 13 +++++++++++ build/fedora/xen-unstable-runit/xenstored/run | 23 ++++++++++++++++++++ 6 files changed, 92 insertions(+) create mode 100755 build/fedora/xen-unstable-runit/setup.sh create mode 100755 build/fedora/xen-unstable-runit/teardown.sh create mode 100755 build/fedora/xen-unstable-runit/xen-init-dom0-disk-backend/run create mode 100755 build/fedora/xen-unstable-runit/xen-init-dom0/run create mode 100755 build/fedora/xen-unstable-runit/xenconsoled/run create mode 100755 build/fedora/xen-unstable-runit/xenstored/run diff --git a/build/fedora/xen-unstable-runit/setup.sh b/build/fedora/xen-unstable-runit/setup.sh new file mode 100755 index 0000000..b5adf8c --- /dev/null +++ b/build/fedora/xen-unstable-runit/setup.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +# runit RPM creates `/etc/service` directory +if [ ! -d "/etc/service" ]; then + echo "/etc/service directory not found. Please install runit RPM." + exit 1 +fi + +runit_services="xenconsoled xen-init-dom0 xen-init-dom0-disk-backend xenstored" + +for service in $runit_services; do + ln -sf /opt/xen-unstable-runit/$service /etc/service/$service +done + +echo "Successfully created symlinks in /etc/service directory." +exit 0 diff --git a/build/fedora/xen-unstable-runit/teardown.sh b/build/fedora/xen-unstable-runit/teardown.sh new file mode 100755 index 0000000..d333807 --- /dev/null +++ b/build/fedora/xen-unstable-runit/teardown.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +# runit RPM creates `/etc/service` directory +if [ ! -d "/etc/service" ]; then + echo "/etc/service directory not found." + exit 1 +fi + +runit_services="xenconsoled xen-init-dom0 xen-init-dom0-disk-backend xenstored" + +for service in $runit_services; do + rm -f /etc/service/$service +done + +echo "Successfully deleted symlinks in /etc/service directory." +exit 0 diff --git a/build/fedora/xen-unstable-runit/xen-init-dom0-disk-backend/run b/build/fedora/xen-unstable-runit/xen-init-dom0-disk-backend/run new file mode 100755 index 0000000..6315d48 --- /dev/null +++ b/build/fedora/xen-unstable-runit/xen-init-dom0-disk-backend/run @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +sv check xenstored >/dev/null || exit 1 +sv check xenconsoled >/dev/null || exit 1 + +# In case of failure, allow user to run teardown script +sleep 5s + +exec /opt/xen-unstable/lib/xen/bin/qemu-system-i386 -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -monitor /dev/null -serial /dev/null -parallel /dev/null -nodefaults -no-user-config diff --git a/build/fedora/xen-unstable-runit/xen-init-dom0/run b/build/fedora/xen-unstable-runit/xen-init-dom0/run new file mode 100755 index 0000000..193ba19 --- /dev/null +++ b/build/fedora/xen-unstable-runit/xen-init-dom0/run @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +sv check xenstored >/dev/null || exit 1 + +/opt/xen-unstable/lib/xen/bin/xen-init-dom0 + +exec chpst -b xen-init-dom0 runit-pause diff --git a/build/fedora/xen-unstable-runit/xenconsoled/run b/build/fedora/xen-unstable-runit/xenconsoled/run new file mode 100755 index 0000000..b5b7a9f --- /dev/null +++ b/build/fedora/xen-unstable-runit/xenconsoled/run @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +sv check xen-init-dom0 >/dev/null || exit 1 + +[ ! -d /var/log/xen/console ] && mkdir -p /var/log/xen/console + +# In case of failure, allow user to run teardown script +sleep 5s + +# --log=[none|guest|hv|all] +exec /opt/xen-unstable/sbin/xenconsoled -i --log=none diff --git a/build/fedora/xen-unstable-runit/xenstored/run b/build/fedora/xen-unstable-runit/xenstored/run new file mode 100755 index 0000000..beb2a5f --- /dev/null +++ b/build/fedora/xen-unstable-runit/xenstored/run @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +[ ! -d /var/run/xen ] && mkdir -p /var/run/xen +[ ! -d /var/run/xenstored ] && mkdir -p /var/run/xenstored +[ ! -d /var/log/xen ] && mkdir -p /var/log/xen +[ ! -d /var/lib/xen ] && mkdir -p /var/lib/xen +[ ! -d /var/lib/xen/dump ] && mkdir -p /var/lib/xen/dump +[ ! -d /var/lib/xen/xenpaging ] && mkdir -p /var/lib/xen/paging +[ ! -d /var/lib/xenstored ] && mkdir -p /var/lib/xenstored +modprobe -q xen-evtchn || exit 1 +modprobe -q xen-gntdev || exit 1 +modprobe -q xen-gntalloc || exit 1 +mountpoint -q /proc/xen || mount -t xenfs xenfs /proc/xen +mountpoint -q /var/lib/xenstored || mount -t tmpfs xenstored /var/lib/xenstored +grep -q "control_d" /proc/xen/capabilities || exit 1 + +# In case of failure, allow user to run teardown script +sleep 5s + +# Use `--trace-file /var/log/xen/xenstored-trace.log` for logs +exec /opt/xen-unstable/sbin/xenstored --no-fork _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |