app-emulation/xen-tools: add ebuild
Package-Manager: Portage-2.3.69, Repoman-2.3.16
This commit is contained in:
parent
52217b65e1
commit
1d8dbdb1a6
19 changed files with 1115 additions and 0 deletions
96
app-emulation/xen-tools/files/gentoo-patches.conf
Normal file
96
app-emulation/xen-tools/files/gentoo-patches.conf
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
# Bug 496708
|
||||
_gx045=" xen-tools-4.10.1-unbundle-ipxe.patch"
|
||||
_gx054=" xen-tools-4.12.0-unbundle-ipxe.patch"
|
||||
|
||||
# Bug 379537
|
||||
_gx017=" fix-gold-ld.patch"
|
||||
|
||||
# Bug 477676
|
||||
_gx038=" xen-tools-4.8-ar-cc.patch"
|
||||
|
||||
# Prevent file collision with qemu package Bug 478064
|
||||
_gx043=" xen-4.10-qemu-bridge.patch"
|
||||
_gx051=" xen-4.12-qemu-bridge.patch"
|
||||
#mv tools/qemu-xen/qemu-bridge-helper.c tools/qemu-xen/xen-bridge-helper.c || die
|
||||
|
||||
# Fix po file collision with app-emulation/qemu, while USE=qemu is enabled, Bug 508302
|
||||
_gx027=" xen-tools-4-qemu-fix-po-collision.patch"
|
||||
|
||||
# Fix build failure with ncurses[tinfo], bug 526526
|
||||
_gx028=" xen-tools-4.4.1-tinfo.patch"
|
||||
|
||||
# Don't download ovmf, use pre-released
|
||||
_gx029=" xen-tools-4-anti-ovmf-download.patch"
|
||||
|
||||
# increase stack to fix xenqemu err
|
||||
# https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg03961.html
|
||||
_gx037=" xen-tools-4.6-increase-stack-size.patch"
|
||||
|
||||
#Fix missing makedev(), major(), minor()
|
||||
_gx042=" xen-tools-4.8.2-makedev.patch"
|
||||
|
||||
# Disable failing shim
|
||||
_gx046=" xen-tools-4.10.1-shim.patch"
|
||||
_gx050=" xen-tools-4.12.0-shim.patch"
|
||||
|
||||
# Fix building with gcc 8, bug #657388
|
||||
_gx047=" xen-tools-4.10.1-gcc8.patch"
|
||||
_gx048=" xen-tools-4.11.1-gcc8.patch"
|
||||
_gx052=" xen-tools-4.10.3-gcc8.patch"
|
||||
_gx053=" xen-tools-4.12.0-gcc8.patch"
|
||||
|
||||
# Fix building with gcc 9, bug #689082
|
||||
_gx055=" xen-tools-4.11.2-gcc9.patch"
|
||||
|
||||
# Fix pdf document generation, bug #650396
|
||||
_gx049=" xen-tools-4.10.1-pdfdoc.patch"
|
||||
|
||||
# xen-tools-4.10.3 patches set
|
||||
_gpv_xen_tools_4103_0="
|
||||
${_gx038} ${_gx017} ${_gx043}
|
||||
${_gx027}
|
||||
${_gx028} ${_gx029}
|
||||
${_gx037} ${_gx042}
|
||||
${_gx045} ${_gx046} ${_gx047}
|
||||
${_gx049}
|
||||
"
|
||||
|
||||
# xen-tools-4.10.3 patches set r1
|
||||
_gpv_xen_tools_4103_1="
|
||||
${_gx038} ${_gx017} ${_gx043}
|
||||
${_gx027}
|
||||
${_gx028} ${_gx029}
|
||||
${_gx037} ${_gx042}
|
||||
${_gx045} ${_gx046} ${_gx052}
|
||||
${_gx049}
|
||||
"
|
||||
|
||||
# xen-tools-4.11.1 patches set
|
||||
_gpv_xen_tools_4111_0="
|
||||
${_gx038} ${_gx017} ${_gx043}
|
||||
${_gx027}
|
||||
${_gx028} ${_gx029}
|
||||
${_gx037} ${_gx042}
|
||||
${_gx045} ${_gx046} ${_gx048}
|
||||
${_gx049}
|
||||
"
|
||||
|
||||
# xen-tools-4.11.2 patches set
|
||||
_gpv_xen_tools_4112_0="
|
||||
${_gx038} ${_gx017} ${_gx043}
|
||||
${_gx027}
|
||||
${_gx028} ${_gx029}
|
||||
${_gx037} ${_gx042}
|
||||
${_gx045} ${_gx046} ${_gx048}
|
||||
${_gx049} ${_gx055}
|
||||
"
|
||||
|
||||
# xen-tools-4.12.0 patches set
|
||||
_gpv_xen_tools_4120_0="
|
||||
${_gx038}
|
||||
${_gx027}
|
||||
${_gx028} ${_gx029}
|
||||
${_gx037} ${_gx042}
|
||||
${_gx053} ${_gx050} ${_gx051}
|
||||
${_gx054}
|
||||
"
|
||||
20
app-emulation/xen-tools/files/stubs-32.h
Normal file
20
app-emulation/xen-tools/files/stubs-32.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* This file is automatically generated.
|
||||
It defines a symbol `__stub_FUNCTION' for each function
|
||||
in the C library which is a stub, meaning it will fail
|
||||
every time called, usually setting errno to ENOSYS. */
|
||||
|
||||
#ifdef _LIBC
|
||||
#error Applications may not define the macro _LIBC
|
||||
#endif
|
||||
|
||||
#define __stub_chflags
|
||||
#define __stub_fattach
|
||||
#define __stub_fchflags
|
||||
#define __stub_fdetach
|
||||
#define __stub_gtty
|
||||
#define __stub_lchmod
|
||||
#define __stub_revoke
|
||||
#define __stub_setlogin
|
||||
#define __stub_sigreturn
|
||||
#define __stub_sstk
|
||||
#define __stub_stty
|
||||
5
app-emulation/xen-tools/files/xen-consoles.logrotate
Normal file
5
app-emulation/xen-tools/files/xen-consoles.logrotate
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
/var/log/xen-consoles/*.log {
|
||||
rotate 7
|
||||
missingok
|
||||
compress
|
||||
}
|
||||
6
app-emulation/xen-tools/files/xen-watchdog.initd
Normal file
6
app-emulation/xen-tools/files/xen-watchdog.initd
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
command="/usr/sbin/xenwatchdogd"
|
||||
command_args="30 15"
|
||||
4
app-emulation/xen-tools/files/xencommons.confd
Normal file
4
app-emulation/xen-tools/files/xencommons.confd
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# /etc/conf.d/xencommons
|
||||
|
||||
# Load xen's kernel modules, and this will override defaults
|
||||
XEN_KERNEL_MODULES=""
|
||||
79
app-emulation/xen-tools/files/xencommons.initd
Normal file
79
app-emulation/xen-tools/files/xencommons.initd
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
depend() {
|
||||
before xenstored
|
||||
}
|
||||
|
||||
is_privileged_domain() {
|
||||
grep -qsE '^control_d$' /proc/xen/capabilities
|
||||
return $?
|
||||
}
|
||||
|
||||
handle_kernel_modules() {
|
||||
local XEN_DEFAULT_KERNEL_MODULES="
|
||||
xen-evtchn
|
||||
xen-gntdev
|
||||
xen-gntalloc
|
||||
xen-blkback
|
||||
xen-netback
|
||||
xen-pciback
|
||||
gntdev
|
||||
netbk
|
||||
blkbk
|
||||
xen-scsibk
|
||||
usbbk
|
||||
pciback
|
||||
xen-acpi-processor
|
||||
blktap2
|
||||
blktap
|
||||
"
|
||||
|
||||
[ "$1" = "remove" ] && OPTS="-r"
|
||||
|
||||
XEN_KERNEL_MODULES="${XEN_KERNEL_MODULES:-${XEN_DEFAULT_KERNEL_MODULES}}"
|
||||
for i in ${XEN_KERNEL_MODULES}; do
|
||||
modprobe ${OPTS} $i 2>/dev/null
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting xencommons daemon"
|
||||
|
||||
# not running in Xen dom0 or domU
|
||||
if [ ! -d /proc/xen ]; then
|
||||
eend 1 "Not running in Xen mode"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# mount xenfs in dom0 or domU with a pv_ops kernel
|
||||
if ! test -f /proc/xen/capabilities && \
|
||||
! grep '^xenfs ' /proc/mounts >/dev/null;
|
||||
then
|
||||
mount -t xenfs xenfs /proc/xen
|
||||
fi
|
||||
|
||||
if ! is_privileged_domain; then
|
||||
eend 1 "Not running on a privileged domain. xencommons not started"
|
||||
return 1
|
||||
fi
|
||||
|
||||
handle_kernel_modules
|
||||
|
||||
eend $? "Failed to start xencommons"
|
||||
}
|
||||
|
||||
stop () {
|
||||
ebegin "Stopping xencommons"
|
||||
if ! is_privileged_domain; then
|
||||
eend 1 "Not running on a privileged domain. xencommons not started"
|
||||
return 1
|
||||
fi
|
||||
|
||||
handle_kernel_modules remove
|
||||
|
||||
eend $? "Failed to stop xencommons"
|
||||
}
|
||||
|
||||
2
app-emulation/xen-tools/files/xenconsoled.confd
Normal file
2
app-emulation/xen-tools/files/xenconsoled.confd
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# /etc/conf.d/xenstored
|
||||
XENCONSOLED_OPTS=""
|
||||
33
app-emulation/xen-tools/files/xenconsoled.initd
Normal file
33
app-emulation/xen-tools/files/xenconsoled.initd
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
depend() {
|
||||
need xenstored
|
||||
after lvm
|
||||
}
|
||||
|
||||
# bug #498720
|
||||
shutdown_all_domU() {
|
||||
# Note: shutdown all domU, including manually started ones
|
||||
local V=$(xl info| awk "/xen_minor/ { print \$3 }")
|
||||
# 4.2.2 do not support "-a" option
|
||||
[ $V -gt 2 ] && xl shutdown -a -w >/dev/null
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting xenconsoled daemon"
|
||||
start-stop-daemon --start --exec /usr/sbin/xenconsoled \
|
||||
--pidfile /run/xenconsoled.pid \
|
||||
-- --pid-file=/run/xenconsoled.pid \
|
||||
${XENCONSOLED_OPTS}
|
||||
eend $*
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping xenconsoled daemon"
|
||||
shutdown_all_domU
|
||||
start-stop-daemon --stop --exec /usr/sbin/xenconsoled \
|
||||
--pidfile /run/xenconsoled.pid
|
||||
eend $*
|
||||
}
|
||||
25
app-emulation/xen-tools/files/xendomains-screen.confd
Normal file
25
app-emulation/xen-tools/files/xendomains-screen.confd
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# /etc/conf.d/xendomains
|
||||
|
||||
# Directory of domains to boot. AUTODIR should contain one or more symlinks
|
||||
# to domain config files in /etc/xen
|
||||
# AUTODIR=/etc/xen/auto
|
||||
|
||||
# Send shutdown commands to all domains in parallel instead of waiting for
|
||||
# each to shutdown individually
|
||||
# PARALLEL_SHUTDOWN=yes
|
||||
|
||||
# When SCREEN="yes", domains in AUTODIR have their consoles connected to a
|
||||
# screen session named SCREEN_NAME, with output logged to individual files
|
||||
# named after each domain and written to /var/log/xen-consoles/ . These files
|
||||
# are rotated (using app-admin/logrotate) every time xendomains is started.
|
||||
|
||||
SCREEN="yes"
|
||||
SCREEN_NAME="xen"
|
||||
|
||||
# Number of seconds between writes to screen's logfiles.
|
||||
#
|
||||
# Lower values mean more disk activity and hence a possible performance
|
||||
# impact, but higher values mean a greater chance of loosing some output
|
||||
# in the event of a crash.
|
||||
|
||||
SCREEN_LOG_INTERVAL="1"
|
||||
9
app-emulation/xen-tools/files/xendomains.confd
Normal file
9
app-emulation/xen-tools/files/xendomains.confd
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# /etc/conf.d/xendomains
|
||||
|
||||
# Directory of domains to boot. AUTODIR should contain one or more symlinks
|
||||
# to domain config files in /etc/xen
|
||||
AUTODIR=/etc/xen/auto
|
||||
|
||||
# Send shutdown commands to all domains in parallel instead of waiting for
|
||||
# each to shutdown individually
|
||||
PARALLEL_SHUTDOWN=yes
|
||||
117
app-emulation/xen-tools/files/xendomains.initd-r2
Normal file
117
app-emulation/xen-tools/files/xendomains.initd-r2
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
extra_commands="status"
|
||||
|
||||
depend() {
|
||||
need xenstored
|
||||
after dhcp xend xenconsoled
|
||||
}
|
||||
|
||||
get_domname() {
|
||||
local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1)
|
||||
|
||||
if [ -z ${name_from_file} ] ; then
|
||||
basename "${1}"
|
||||
else
|
||||
echo ${name_from_file}
|
||||
fi
|
||||
}
|
||||
|
||||
is_running() {
|
||||
/usr/sbin/xl list "${1}" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
using_screen() {
|
||||
[ "${SCREEN}" = "yes" -o "${SCREEN}" = "YES" ]
|
||||
}
|
||||
|
||||
set_screen_cmd() {
|
||||
screen_cmd="screen -c ${SCREENRC:-/dev/null} -q -r ${SCREEN_NAME:=xen} -X"
|
||||
}
|
||||
|
||||
start() {
|
||||
set_screen_cmd
|
||||
|
||||
einfo "Starting Xen domains from ${AUTODIR:=/etc/xen/auto}"
|
||||
if using_screen ; then
|
||||
ebegin "Creating screen session to hold domain consoles"
|
||||
( screen -c ${SCREENRC:-/dev/null} -d -m -S ${SCREEN_NAME} -t dom0 \
|
||||
&& sleep 5 \
|
||||
&& ${screen_cmd} zombie dr \
|
||||
&& logrotate -f /etc/xen/xen-consoles.logrotate \
|
||||
&& ${screen_cmd} logfile /var/log/xen-consoles/%t.log \
|
||||
&& ${screen_cmd} logfile flush ${SCREEN_LOG_INTERVAL:-1} \
|
||||
&& ${screen_cmd} log on \
|
||||
&& ${screen_cmd} deflog on ) >/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
eend 1
|
||||
return 1
|
||||
else
|
||||
eend
|
||||
fi
|
||||
fi
|
||||
# Create all domains with config files in AUTODIR.
|
||||
for dom in $(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort); do
|
||||
name=$(get_domname ${dom})
|
||||
if ! is_running ${name} ; then
|
||||
ebegin " Starting domain ${name}"
|
||||
if using_screen ; then
|
||||
${screen_cmd} screen -t ${name} xl create ${dom} -c
|
||||
else
|
||||
xl create --quiet ${dom}
|
||||
fi
|
||||
eend $?
|
||||
else
|
||||
einfo " Not starting domain ${name} - already running"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
stop() {
|
||||
set_screen_cmd
|
||||
|
||||
einfo "Shutting down Xen domains from ${AUTODIR:=/etc/xen/auto}"
|
||||
# Stop all domains with config files in AUTODIR.
|
||||
DOMAINS="$(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort -r)"
|
||||
|
||||
if [ "$PARALLEL_SHUTDOWN" = "yes" ] ; then
|
||||
for dom in $DOMAINS ; do
|
||||
name=$(get_domname ${dom})
|
||||
if is_running ${name} ; then
|
||||
ebegin " Asking domain ${name} to shutdown in the background..."
|
||||
xl shutdown -w ${name} >/dev/null &
|
||||
else
|
||||
einfo " Not stopping domain ${name} - not running"
|
||||
fi
|
||||
done
|
||||
einfo " Waiting for shutdown of domains that are still running"
|
||||
wait
|
||||
eend $?
|
||||
else
|
||||
for dom in $DOMAINS ; do
|
||||
name=$(get_domname ${dom})
|
||||
if is_running ${name} ; then
|
||||
ebegin " Waiting for domain ${name} to shutdown"
|
||||
xl shutdown -w ${name} >/dev/null
|
||||
eend $?
|
||||
else
|
||||
einfo " Not stopping domain ${name} - not running"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if using_screen ; then
|
||||
if ${screen_cmd} sleep 0 >/dev/null 2>&1 ; then
|
||||
ebegin "Closing screen session ${SCREEN_NAME}"
|
||||
${screen_cmd} quit
|
||||
eend $?
|
||||
else
|
||||
eend 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
status() {
|
||||
/usr/sbin/xl list
|
||||
}
|
||||
7
app-emulation/xen-tools/files/xenqemudev.confd
Normal file
7
app-emulation/xen-tools/files/xenqemudev.confd
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# /etc/conf.d/xenqemudev
|
||||
|
||||
# To enable QEMU file backend, set to 'yes'
|
||||
XENQEMUDEV_FILE_BACKEND_ENABLE=""
|
||||
|
||||
# Common options for xenqemudev
|
||||
XENQEMUDEV_OPTS=""
|
||||
84
app-emulation/xen-tools/files/xenqemudev.initd
Normal file
84
app-emulation/xen-tools/files/xenqemudev.initd
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
depend() {
|
||||
need xencommons xenstored xenconsoled
|
||||
}
|
||||
|
||||
is_privileged_domain() {
|
||||
grep -qsE '^control_d$' /proc/xen/capabilities
|
||||
return $?
|
||||
}
|
||||
|
||||
xen_setvars() {
|
||||
. /etc/xen/scripts/hotplugpath.sh
|
||||
|
||||
XENQEMUDEV_PIDFILE=/run/xenqemudev.pid
|
||||
|
||||
# xen-4.5 change the path
|
||||
XEN_QEMU="${LIBEXEC}/qemu-system-i386"
|
||||
[ -e ${XEN_QEMU} ] && return
|
||||
XEN_QEMU="${LIBEXEC_BIN}/qemu-system-i386"
|
||||
}
|
||||
|
||||
xen_qemu_start() {
|
||||
if [ -z "${XENQEMUDEV_FILE_BACKEND_ENABLE}" ]; then
|
||||
ewarn " QEMU disk backend not enabled"
|
||||
ewarn " enable XENQEMUDEV_FILE_BACKEND_ENABLE in /etc/conf.d/xenqemudev"
|
||||
return 1
|
||||
fi
|
||||
|
||||
xen_setvars
|
||||
|
||||
if [ ! -c /dev/xen/gntdev ]; then
|
||||
einfo " Xen gntdev driver not loaded"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -e "${XEN_QEMU}" ]; then
|
||||
einfo " Starting QEMU as disk backend for dom0"
|
||||
|
||||
XENQEMUDEV_DEFAULT_OPTS="-xen-domid 0 -xen-attach -name dom0 \
|
||||
-nographic -M xenpv -daemonize \
|
||||
-monitor /dev/null -serial /dev/null -parallel /dev/null"
|
||||
|
||||
XENQEMUDEV_OPTS=${XENQEMUDEV_OPTS:-${XENQEMUDEV_DEFAULT_OPTS}}
|
||||
|
||||
start-stop-daemon --start --exec ${XEN_QEMU} \
|
||||
--pidfile ${XENQEMUDEV_PIDFILE} \
|
||||
-- -pidfile ${XENQEMUDEV_PIDFILE} \
|
||||
${XENQEMUDEV_OPTS}
|
||||
return $?
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting xenqemudev daemon"
|
||||
|
||||
# not running in Xen dom0 or domU
|
||||
if [ ! -d /proc/xen ]; then
|
||||
eend 1 "Not running in Xen mode"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! is_privileged_domain; then
|
||||
eend 1 "Not running on a privileged domain. xenqemudev not started"
|
||||
return 1
|
||||
fi
|
||||
|
||||
xen_qemu_start
|
||||
|
||||
eend $? "Failed to start xenqemudev"
|
||||
}
|
||||
|
||||
stop () {
|
||||
ebegin "Stopping xenqemudev"
|
||||
|
||||
xen_setvars
|
||||
|
||||
start-stop-daemon --stop --exec ${XEN_QEMU} \
|
||||
--pidfile ${XENQEMUDEV_PIDFILE}
|
||||
|
||||
eend $? "Stopping xenqemudev, as it cannot be restarted."
|
||||
}
|
||||
2
app-emulation/xen-tools/files/xenstored.confd
Normal file
2
app-emulation/xen-tools/files/xenstored.confd
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# /etc/conf.d/xenstored
|
||||
XENSTORED_OPTS=""
|
||||
44
app-emulation/xen-tools/files/xenstored.initd
Normal file
44
app-emulation/xen-tools/files/xenstored.initd
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
depend() {
|
||||
before xendomains xend sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp
|
||||
need xencommons
|
||||
}
|
||||
|
||||
xenstored_dir_check() {
|
||||
# create dir dynamically
|
||||
local i
|
||||
for i in /var/lock/subsys /run/xen /run/xend/boot /run/xenstored; do
|
||||
[ -x $i ] || mkdir -p $i
|
||||
done
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting xenstored daemon"
|
||||
xenstored_dir_check
|
||||
start-stop-daemon --start --exec /usr/sbin/xenstored \
|
||||
--pidfile /run/xenstored.pid \
|
||||
-- --pid-file=/run/xenstored.pid \
|
||||
$XENSTORED_OPTS
|
||||
until xenstore-exists / || $((15 < ++i))
|
||||
do
|
||||
echo -n .
|
||||
sleep 1
|
||||
done
|
||||
einfo "Setting domain0 name record"
|
||||
/usr/bin/xenstore-write "/local/domain/0/name" "Domain-0"
|
||||
local V=$(xl info| awk "/xen_minor/ { print \$3 }")
|
||||
[ $V -ge 4 ] && /usr/bin/xenstore-write "/local/domain/0/domid" 0
|
||||
|
||||
eend $*
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping xenstored daemon"
|
||||
start-stop-daemon --stop --exec /usr/sbin/xenstored \
|
||||
--pidfile /run/xenstored.pid
|
||||
eend $?
|
||||
}
|
||||
|
||||
42
app-emulation/xen-tools/files/xenstored.initd-r1
Normal file
42
app-emulation/xen-tools/files/xenstored.initd-r1
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
depend() {
|
||||
before xendomains xend sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp
|
||||
need xencommons
|
||||
}
|
||||
|
||||
xenstored_dir_check() {
|
||||
# create dir dynamically
|
||||
local i
|
||||
for i in /var/lock/subsys /run/xen /run/xend/boot /run/xenstored; do
|
||||
[ -x $i ] || mkdir -p $i
|
||||
done
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting xenstored daemon"
|
||||
xenstored_dir_check
|
||||
start-stop-daemon --start --exec /usr/sbin/xenstored \
|
||||
--pidfile /run/xenstored.pid \
|
||||
-- --pid-file=/run/xenstored.pid \
|
||||
$XENSTORED_OPTS
|
||||
until xenstore-exists / || $((15 < ++i))
|
||||
do
|
||||
printf "."
|
||||
sleep 1
|
||||
done
|
||||
einfo "Setting domain0 name record"
|
||||
/usr/libexec/xen/bin/xen-init-dom0
|
||||
|
||||
eend $*
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping xenstored daemon"
|
||||
start-stop-daemon --stop --exec /usr/sbin/xenstored \
|
||||
--pidfile /run/xenstored.pid
|
||||
eend $?
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue