Merge pull request #546 from marineam/xenserver

Xenserver block device hack
This commit is contained in:
Michael Marineau 2014-04-14 18:34:46 -07:00
commit 6fb33eddc5
6 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,18 @@
[Unit]
Description=Set fake PV driver version for XenServer
DefaultDependencies=false
Requires=proc-xen.mount
After=proc-xen.mount
IgnoreOnIsolate=true
ConditionVirtualization=xen
[Service]
Type=oneshot
RemainAfterExit=true
# Only attempt the write if 'attr' exists, it may not.
ExecStart=/bin/sh -c \
'if xenstore exists attr; then xenstore write \
attr/PVAddons/MajorVersion @@MAJOR@@ \
attr/PVAddons/MinorVersion @@MINOR@@ \
attr/PVAddons/MicroVersion @@MICRO@@ \
data/updated 1; fi'

View File

@ -0,0 +1,35 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
inherit systemd versionator
DESCRIPTION="Fake data for XenServer's PV driver version detection."
HOMEPAGE="http://xenserver.org/"
SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64"
IUSE=""
DEPEND=""
RDEPEND="app-emulation/xenstore"
S="${WORKDIR}"
src_prepare() {
local split=($(get_version_components))
sed -e "s/@@MAJOR@@/${split[0]}/" \
-e "s/@@MINOR@@/${split[1]}/" \
-e "s/@@MICRO@@/${split[2]}/" \
"${FILESDIR}"/xenserver-pv-version.service \
> "${T}"/xenserver-pv-version.service || die
}
src_install() {
systemd_dounit "${T}"/xenserver-pv-version.service
systemd_enable_service sysinit.target xenserver-pv-version.service
}

View File

@ -0,0 +1,9 @@
[Unit]
Before=local-fs.target
DefaultDependencies=false
ConditionVirtualization=xen
[Mount]
What=xenfs
Where=/proc/xen
Type=xenfs

View File

@ -6,7 +6,7 @@ EAPI=5
PYTHON_COMPAT=( python2_7 )
inherit multilib python-any-r1 toolchain-funcs
inherit multilib python-any-r1 systemd toolchain-funcs
MY_PV=${PV/_/-}
S="${WORKDIR}/xen-${MY_PV}"
@ -70,4 +70,7 @@ src_compile() {
src_install() {
dolib.so tools/xenstore/libxenstore.so*
dobin tools/xenstore/xenstore
systemd_dounit "${FILESDIR}"/proc-xen.mount
systemd_enable_service local-fs.target proc-xen.mount
}

View File

@ -95,6 +95,7 @@ RDEPEND="${RDEPEND}
RDEPEND="${RDEPEND}
app-emulation/xenstore
app-emulation/xenserver-pv-version
sys-apps/findutils
sys-apps/which
app-admin/fleet