Skip to content

Commit e8aa10f

Browse files
author
Jon Ludlam
committed
Move everything over to using Fhs.ml / @ substitution
Note that there should be no user visible change in this changeset; everything should be the same as it was before. Signed-off-by: Jon Ludlam <[email protected]>
1 parent a55c1ef commit e8aa10f

File tree

139 files changed

+312
-302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+312
-302
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,5 @@ ocaml/xenops/memory_breakdown
197197
ocaml/xenops/squeezed
198198
ocaml/xenops/squeezed_client
199199
xapi.spec
200+
201+
ocaml/fhs.*

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ PLUGINDIR=/etc/xapi.d/plugins
3232
HOOKSDIR=/etc/xapi.d
3333
INVENTORY=/etc/xensource-inventory
3434
XAPICONF=/etc/xapi.conf
35-
LIBEXECDIR=$(OPTDIR)/libexec
35+
LIBEXECDIR=/opt/xensource/libexec
3636
SCRIPTSDIR=/etc/xensource/scripts
37+
SHAREDIR=/opt/xensource
38+
WEBDIR=/opt/xensource/www
39+
XHADIR=/opt/xensource/xha
40+
BINDIR=/opt/xensource/bin
3741

38-
export VARDIR ETCDIR OPTDIR PLUGINDIR HOOKSDIR INVENTORY VARPATCHDIR LIBEXECDIR XAPICONF SCRIPTSDIR
42+
export VARDIR ETCDIR OPTDIR PLUGINDIR HOOKSDIR INVENTORY VARPATCHDIR LIBEXECDIR XAPICONF SCRIPTSDIR SHAREDIR WEBDIR XHADIR BINDIR
3943

4044
.PHONY: all
41-
all: version
45+
all: version ocaml/fhs.ml
4246
omake phase1
4347
omake phase2
4448
omake phase3
@@ -116,9 +120,13 @@ ocaml/fhs.ml :
116120
let libexecdir=\"$(LIBEXECDIR)\"\n \
117121
let xapiconf=\"$(XAPICONF)\"\n \
118122
let scriptsdir=\"$(SCRIPTSDIR)\"\n \
119-
let varpatchdir=\"$(VARPATCHDIR)\"\n" \
123+
let varpatchdir=\"$(VARPATCHDIR)\"\n \
124+
let webdir=\"$(WEBDIR)\"\n \
125+
let xhadir=\"$(XHADIR)\"\n \
126+
let bindir=\"$(BINDIR)\"\n \
127+
let sharedir=\"$(SHAREDIR)\"\n" \
120128
> ocaml/fhs.ml
121-
129+
122130
.PHONY: clean
123131
clean:
124132

OMakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export
7979
.PHONY: none
8080

8181
# Ocaml #############################################################################
82-
OCAML_PHASE1= generate_constants autogen_idl
82+
OCAML_PHASE1= autogen_idl
8383
OCAML_PHASE2= $(if $(BYTE_ENABLED), ocaml/idl/ocaml_backend/xapi_client.cma) $(if $(NATIVE_ENABLED), ocaml/idl/ocaml_backend/xapi_client.cmxa)
8484

8585
# JS ################################################################################

ocaml/OMakefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# You must set your XEN_ROOT env var before building
22
XEN_CFLAGS = -I$(XEN_ROOT)/usr/include
33
OCAMLINCLUDES = +ocamldoc
4-
OCAML_LIBS = $(ROOT)/ocaml/util/version $(ROOT)/ocaml/util/stats
4+
OCAML_LIBS = $(ROOT)/ocaml/fhs $(ROOT)/ocaml/util/version $(ROOT)/ocaml/util/stats
55
OCAMLPACKS = stdext log
66

7+
OCamlLibrary(fhs, fhs)
8+
79
.SUBDIRS: \
810
ptoken \
911
autogen \

ocaml/auth/OMakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
OTHER_CLIBS = -cclib -lpam
2-
OCAMLINCLUDES += ../autogen ../idl/ocaml_backend ../idl ../xapi
2+
OCAMLINCLUDES += ../autogen ../idl/ocaml_backend ../idl ../xapi ..
33

44
StaticCLibrary(auth_stubs, xa_auth xa_auth_stubs)
55
OCamlLibraryClib(pam, pam, auth_stubs)

ocaml/auth/extauth.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct
7474
end
7575

7676
(* some constants *)
77-
let extauth_hook_script_name = "extauth-hook" (* script name in /etc/xapi.d/plugins/ *)
77+
let extauth_hook_script_name = "extauth-hook" (* script name in @PLUGINDIR@/ *)
7878
let event_name_after_subject_add = "after-subject-add"
7979
let event_name_after_subject_remove = "after-subject-remove"
8080
let event_name_after_xapi_initialize = "after-xapi-initialize"
@@ -102,10 +102,10 @@ let can_execute_extauth_hook_script ~__context host event_name =
102102
(* use the generic call below to avoid concurrency problems between the script and host.{enable,disable}_extauth *)
103103
let call_extauth_hook_script_in_host_wrapper ~__context host event_name ~call_plugin_fn =
104104
(* CP-709: call extauth-hook-script *)
105-
(* Forkhelpers.execute_command_get_output hook-script "/etc/xapi.d/plugins/extauth-hook" *)
105+
(* Forkhelpers.execute_command_get_output hook-script "@PLUGINDIR@/extauth-hook" *)
106106
(* fork a new thread and call new xapi.host.call-subject-add-hook-script method *)
107107
(* see xapi_sync.ml *)
108-
(* host.call-plugins scriptname (calls /etc/xapi.d/plugins/scriptname*)
108+
(* host.call-plugins scriptname (calls @PLUGINDIR@/scriptname*)
109109

110110
if can_execute_extauth_hook_script ~__context host event_name
111111
then begin
@@ -148,7 +148,7 @@ let call_extauth_hook_script_in_host ~__context host event_name =
148148
let call_plugin_fn () =
149149
Helpers.call_api_functions ~__context (fun rpc session_id ->
150150
Client.Client.Host.call_plugin rpc session_id host (* will call extauth plugin with mutex *)
151-
extauth_hook_script_name (* script name in /etc/xapi.d/plugins/ *)
151+
extauth_hook_script_name (* script name in @PLUGINDIR@/ *)
152152
event_name (* event name sent to script *)
153153
event_params (* parameters sent to event name *)
154154
)

ocaml/auth/extauth_plugin_ADlikewise.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ let on_disable config_params =
700700
debug "Doing a manual Likewise domain-leave cleanup...";
701701
(* When likewise raises an exception during domain-leave, we try again, using *)
702702
(* some of the command-line workarounds that Kyle describes in CA-27627: *)
703-
let lw_force_domain_leave_script = Xapi_globs.base_path ^ "/libexec/lw-force-domain-leave" in
703+
let lw_force_domain_leave_script = Filename.concat Fhs.libexecdir "lw-force-domain-leave" in
704704
(try
705705
let output, stderr = Forkhelpers.execute_command_get_output lw_force_domain_leave_script [] in
706706
debug "execute %s: stdout=[%s],stderr=[%s]" lw_force_domain_leave_script (Stringext.String.replace "\n" ";" output) (Stringext.String.replace "\n" ";" stderr)

ocaml/cdrommon/OMakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
OCAML_LIBS = ../util/version ../idl/ocaml_backend/common
1+
OCAML_LIBS = ../fhs ../util/version ../idl/ocaml_backend/common
22
OCAMLINCLUDES = ../xapi
33
OCAMLPACKS += unix cdrom
44

ocaml/database/OMakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
OCAMLINCLUDES = ../idl/ocaml_backend ../xapi ../idl ../util ../autogen
2+
OCAMLINCLUDES = ../idl/ocaml_backend ../xapi ../idl ../util ../autogen ..
33
OCAMLPACKS = xml-light2 stdext stunnel http-svr log sexpr rpc-light
44
#OCAMLPPFLAGS = -pp "camlp4o"
55
#OCAMLDEPFLAGS = -pp "camlp4o"
@@ -13,7 +13,7 @@ OCamlProgram(unit_test_sql, unit_test_sql)
1313
BLOCK_DEVICE_IO_FILES = \
1414
block_device_io_errors \
1515
block_device_io \
16-
../xapi/config_constants ../xapi/xapi_globs ../idl/ocaml_backend/ref \
16+
../xapi/xapi_globs ../idl/ocaml_backend/ref \
1717
../xapi/helper_process ../xapi/helper_hostname ../idl/api_errors
1818

1919
OCamlProgram(block_device_io, $(BLOCK_DEVICE_IO_FILES))
@@ -28,7 +28,7 @@ section:
2828
OCamlProgram(database_test, $(DATABASE_TEST_FILES))
2929

3030
section:
31-
OCAML_LIBS += ../idl/ocaml_backend/common ../idl/ocaml_backend/client ../idl/ocaml_backend/server
31+
OCAML_LIBS += ../idl/ocaml_backend/common ../idl/ocaml_backend/client ../idl/ocaml_backend/server
3232
OCamlProgram(unit_test_marshall, unit_test_marshall db_remote_cache_access_v1)
3333

3434
.PHONY: install

ocaml/database/redo_log.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ let string_to_redo_log_entry str =
202202
exception RedoLogFailure of string
203203
exception CommunicationsProblem of string
204204

205-
let prog = Xapi_globs.base_path ^ "/libexec/block_device_io"
205+
let prog = Filename.concat Fhs.libexecdir "block_device_io"
206206

207207
let generation_size = 16
208208
let length_size = 16

0 commit comments

Comments
 (0)