tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xentools41 LDFLAGS Re: broken packages for 2012Q3



On Fri, Nov 23, 2012 at 11:45:20PM -0800, Aaron J. Grier wrote:
> On Fri, Nov 23, 2012 at 10:02:45PM -0800, Aaron J. Grier wrote:
> > see attached patch, which allows oxenstored to build with the
> > correct rpath.  -L seems to take care of the link rpath.  untested,
> > as I'm still getting another xen server assembled to test this on.
> 
> oxenstored compiles and runs, but falls over quickly due to some
> linuxisms in define.ml that I'm now attempting to flush out.  :)

see attached.  I can only vaguely follow ML, and did some cut-and-paste
from rosetta code to do the necessary trailing newline trimming of
/kern/xen/xsd_port.  I'm unclear of the license there, so this may need
rewriting by someone more clued before being committed.

the rc.d startup scripts will need to be modified for oxenstored, and
the path for xenstored-access.log needs to be changed.  there might be
others.

I have successfully run oxenstored on a test system, and all the other
xen tools appear to be happy with it, although it has not been put
through any sort of stringent testing.  I'm installing a domU now to see
how it goes.

anybody out there playing along?

-- 
  Aaron J. Grier | "Not your ordinary poofy goof." | 
agrier%poofygoof.com@localhost
--- ocaml/Makefile.rules.orig   2012-11-20 08:16:03.000000000 +0000
+++ ocaml/Makefile.rules        2012-11-20 08:16:48.000000000 +0000
@@ -65,7 +65,7 @@
  $(1)_stubs.a: $(foreach obj,$$($(1)_C_OBJS),$(obj).o)
        $(call mk-caml-stubs,$$@, $$+)
  lib$(1)_stubs.a: $(foreach obj,$($(1)_C_OBJS),$(obj).o)
-       $(call mk-caml-lib-stubs,$$@, $$+, $(LIBS_$(1)))
+       $(call mk-caml-lib-stubs,$$@, $$+, -ldopt -Wl,-rpath=$(PREFIX)/lib 
$(LIBS_$(1)))
 endef
 
 define OCAML_NOC_LIBRARY_template
--- ocaml/xenstored/define.ml.orig      2012-11-24 07:27:21.000000000 +0000
+++ ocaml/xenstored/define.ml   2012-11-24 07:33:59.000000000 +0000
@@ -17,13 +17,13 @@
 let xenstored_major = 1
 let xenstored_minor = 0
 
-let xenstored_proc_kva = "/proc/xen/xsd_kva"
-let xenstored_proc_port = "/proc/xen/xsd_port"
+let xenstored_proc_kva = "/dev/xsd_kva"
+let xenstored_proc_port = "/kern/xen/xsd_port"
 
 let xs_daemon_socket = "/var/run/xenstored/socket"
 let xs_daemon_socket_ro = "/var/run/xenstored/socket_ro"
 
-let default_config_dir = "/etc/xensource"
+let default_config_dir = "/usr/pkg/etc/xen"
 
 let maxwatch = ref (50)
 let maxtransaction = ref (20)
--- ocaml/xenstored/utils.ml.orig
+++ ocaml/xenstored/utils.ml
@@ -72,6 +72,22 @@ let trim_path path =
 
 let join_by_null ls = String.concat "\000" ls
 
+(* from rosetta code *)
+let right_pos s len =
+  let rec aux i =
+    if i < 0 then None
+    else match s.[i] with
+    | ' ' | '\n' | '\t' | '\r' -> aux (pred i)
+    | _ -> Some i
+  in
+  aux (pred len)
+
+let rtrim s =
+  let len = String.length s in
+  match right_pos s len with
+  | Some i -> String.sub s 0 (i + 1)
+  | None -> ""
+
 (* unix utils *)
 let create_unix_socket name =
        Unixext.unlink_safe name;
@@ -87,7 +103,7 @@ let read_file_single_integer filename =
        let buf = String.make 20 (char_of_int 0) in
        let sz = Unix.read fd buf 0 20 in
        Unix.close fd;
-       int_of_string (String.sub buf 0 sz)
+       int_of_string (rtrim (String.sub buf 0 sz))
 
 let path_complete path connection_path =
        if String.get path 0 <> '/' then


Home | Main Index | Thread Index | Old Index