Skip to content

Commit

Permalink
Add temporary patch to work around NVIDIA-330
Browse files Browse the repository at this point in the history
Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
  • Loading branch information
simonjbeaumont committed May 27, 2015
1 parent 1dc2c0e commit 409b02c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -137,6 +137,8 @@ srpm: xapi.spec
make -C $(REPO) version
rm -f $(RPM_SOURCESDIR)/xapi-version.patch
(cd $(REPO); diff -u /dev/null ocaml/util/version.ml > $(RPM_SOURCESDIR)/xapi-version.patch) || true
rm -f $(RPM_SOURCESDIR)/0001-Workaround-for-NVIDIA-330.patch
cp scripts/0001-Workaround-for-NVIDIA-330.patch $(RPM_SOURCESDIR)/0001-Workaround-for-NVIDIA-330.patch
cp -f xapi.spec $(RPM_SPECSDIR)/
chown root.root $(RPM_SPECSDIR)/xapi.spec || true
$(RPMBUILD) -bs --nodeps $(RPM_SPECSDIR)/xapi.spec
Expand Down
35 changes: 35 additions & 0 deletions scripts/0001-Workaround-for-NVIDIA-330.patch
@@ -0,0 +1,35 @@
From a9b490309edf1bc7c86daf1a307c610f9bcb8aef Mon Sep 17 00:00:00 2001
From: Si Beaumont <simon.beaumont@citrix.com>
Date: Wed, 27 May 2015 17:05:31 +0100
Subject: [PATCH] Workaround for NVIDIA-130

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
---
ocaml/xapi/xapi.ml | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/ocaml/xapi/xapi.ml b/ocaml/xapi/xapi.ml
index c9919df..98eaf6d 100644
--- a/ocaml/xapi/xapi.ml
+++ b/ocaml/xapi/xapi.ml
@@ -787,8 +787,17 @@ let server_init() =

try
Server_helpers.exec_with_new_task "server_init" (fun __context ->
+ let nvidia_130_workaround () =
+ let source = "/usr/share/nvidia/pci.ids" in
+ let dest = "/usr/share/hwdata/pci.ids.d/nvidia.ids" in
+ debug "Creating symlink: %s -> %s" dest source;
+ let ignore_exists f = try f () with Unix.Unix_error (Unix.EEXIST, _, _) -> () in
+ ignore_exists (fun () -> Unix.mkdir (Filename.dirname dest) 0o700);
+ ignore_exists (fun () -> Unix.symlink source dest)
+ in
Startup.run ~__context [
"XAPI SERVER STARTING", [], print_server_starting_message;
+ "NVIDIA-130 workaround", [], nvidia_130_workaround;
"Parsing inventory file", [], Xapi_inventory.read_inventory;
"Setting stunnel timeout", [], set_stunnel_timeout;
"Initialising local database", [], init_local_database;
--
1.9.1

2 changes: 2 additions & 0 deletions xapi.spec.in
Expand Up @@ -11,6 +11,7 @@ Source0: xapi-%{version}.tar.bz2
Source1: jquery-1.1.3.1.pack.js
Source2: jquery.treeview.zip
Patch0: xapi-version.patch
Patch1: scripts/0001-Workaround-for-NVIDIA-330.patch
BuildRequires: ocaml
BuildRequires: ocaml-camlp4-devel
BuildRequires: ocaml-findlib
Expand Down Expand Up @@ -129,6 +130,7 @@ This package contains Xen-API documentation and examples in several programming
%prep
%setup -q
%patch0 -p0 -b xapi-version.patch
%patch1 -p1
cp $RPM_SOURCE_DIR/jquery* $RPM_BUILD_DIR/xapi-%{version}/ocaml/idl


Expand Down

0 comments on commit 409b02c

Please sign in to comment.