From: Rajiv Ranganath <rajiv.ranganath@atihita.com>
To: xen-devel@lists.xen.org
Cc: sstabellini@kernel.org
Subject: [stage1-xen PATCH v1 06/10] build/fedora: Add `xen-unstable-runit/*` scripts
Date: Sun, 27 Aug 2017 08:31:11 +0530 [thread overview]
Message-ID: <20170827030110.40527.811.stgit@rajivs-macbook-pro.local> (raw)
In-Reply-To: <20170827030018.40527.88922.stgit@rajivs-macbook-pro.local>
From: Rajiv M Ranganath <rajiv.ranganath@atihita.com>
Signed-off-by: Rajiv Ranganath <rajiv.ranganath@atihita.com>
---
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@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-08-27 3:01 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-27 3:00 [stage1-xen PATCH v1 00/10] Add Fedora support Rajiv Ranganath
2017-08-27 3:00 ` [stage1-xen PATCH v1 01/10] .gitignore: Add Rajiv Ranganath
2017-09-06 18:42 ` Stefano Stabellini
2017-08-27 3:00 ` [stage1-xen PATCH v1 02/10] build/fedora: Add `buildroot-README.md` Rajiv Ranganath
2017-09-06 18:43 ` Stefano Stabellini
2017-08-27 3:00 ` [stage1-xen PATCH v1 03/10] build/fedora: Add `buildroot-Dockerfile` Rajiv Ranganath
2017-09-06 18:43 ` Stefano Stabellini
2017-08-27 3:00 ` [stage1-xen PATCH v1 04/10] build/fedora: Add `run` and `components/*` scripts Rajiv Ranganath
2017-09-06 18:59 ` Stefano Stabellini
2017-09-09 2:04 ` Rajiv Ranganath
2017-09-11 20:06 ` Stefano Stabellini
2017-09-13 5:17 ` Rajiv Ranganath
2017-09-13 21:23 ` Stefano Stabellini
2017-08-27 3:01 ` [stage1-xen PATCH v1 05/10] build/fedora: Add `source_path.sh` Rajiv Ranganath
2017-08-27 3:01 ` Rajiv Ranganath [this message]
2017-09-06 18:40 ` [stage1-xen PATCH v1 06/10] build/fedora: Add `xen-unstable-runit/*` scripts Stefano Stabellini
2017-09-09 1:51 ` Rajiv Ranganath
2017-09-11 20:20 ` Stefano Stabellini
2017-09-11 23:08 ` Andrew Cooper
2017-09-13 5:09 ` Rajiv Ranganath
2017-08-27 3:01 ` [stage1-xen PATCH v1 07/10] .circleci/config.yml: Add Rajiv Ranganath
2017-09-06 19:05 ` Stefano Stabellini
2017-08-27 3:01 ` [stage1-xen PATCH v1 08/10] README.md: Add CircleCI badge Rajiv Ranganath
2017-09-06 18:44 ` Stefano Stabellini
2017-08-27 3:01 ` [stage1-xen PATCH v1 09/10] build/fedora: Add `RUNNING_STAGE1_XEN.md` Rajiv Ranganath
2017-09-06 19:14 ` Stefano Stabellini
2017-09-09 2:10 ` Rajiv Ranganath
2017-09-09 2:52 ` Rajiv Ranganath
2017-09-11 20:07 ` Stefano Stabellini
2017-08-27 3:01 ` [stage1-xen PATCH v1 10/10] BUILDING.md: Add Fedora instructions Rajiv Ranganath
2017-09-06 19:07 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170827030110.40527.811.stgit@rajivs-macbook-pro.local \
--to=rajiv.ranganath@atihita.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).