--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -22,6 +22,8 @@
 import curses, _curses, curses.wrapper, curses.textpad, curses.ascii
 import getopt
 
+sys.path.insert(1, sys.path[0] + '/../lib/python')
+
 import fsimage
 import grub.GrubConf
 import grub.LiloConf
--- a/tools/pygrub/setup.py
+++ b/tools/pygrub/setup.py
@@ -4,11 +4,13 @@
 import sys
 
 extra_compile_args  = [ "-fno-strict-aliasing", "-Werror" ]
+extra_link_args = [ "-Wl,-rpath,${ORIGIN}/.." ]
 
 XEN_ROOT = "../.."
 
 fsimage = Extension("fsimage",
     extra_compile_args = extra_compile_args,
+    extra_link_args = extra_link_args,
     include_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ],
     library_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ],
     libraries = ["fsimage"],
