From a8f254dac6a0f4282ae9a8ddd4180f05a749e155 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 24 Oct 2024 12:06:41 -0500 Subject: [PATCH 1/5] Add missing -thread link. Links added in earlier commit, but one instance missed. Cf. https://github.com/ocamllabs/ocaml-ctypes/pull/651 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 810ccd6..5c798c3 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ $(BUILDDIR)/%.o: %.c $(CC) -c -o $@ -fPIC -I $(shell ocamlfind query ctypes) -I $(OCAMLDIR) -I $(OCAMLDIR)/../ctypes $< $(BUILDDIR)/%.cmx: %.ml - ocamlfind opt -c -o $@ -I $(BUILDDIR)/generated -I $(BUILDDIR)/lib -package $(PACKAGES) $< + ocamlfind opt -c -o $@ -I $(BUILDDIR)/generated -I $(BUILDDIR)/lib -thread -package $(PACKAGES) $< $(GENERATOR): $(GENERATOR_FILES) ocamlfind opt -o $@ -I $(BUILDDIR)/lib -linkpkg -thread -package $(PACKAGES) $^ From 6bf2175b7169a8628dea25b6eea797eb774e7e55 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 24 Oct 2024 12:06:41 -0500 Subject: [PATCH 2/5] T6718: add internal_cache arg to binding --- lib/bindings.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bindings.ml b/lib/bindings.ml index 02f606a..052495d 100644 --- a/lib/bindings.ml +++ b/lib/bindings.ml @@ -224,9 +224,9 @@ let tree_union c_ptr_l c_ptr_r = with CD.Nonexistent_child -> error_message := "Nonexistent child"; Ctypes.null -let reference_tree_to_json from_dir to_file = +let reference_tree_to_json internal_cache from_dir to_file = try - Generate.reference_tree_to_json from_dir to_file; 0 + Generate.reference_tree_to_json ~internal_cache:internal_cache from_dir to_file; 0 with | Generate.Load_error msg -> let s = Printf.sprintf "Load_error \'%s\'" msg in @@ -276,6 +276,6 @@ struct let () = I.internal "diff_tree" (string @-> (ptr void) @-> (ptr void) @-> returning (ptr void)) diff_tree let () = I.internal "show_diff" (bool @-> string @-> (ptr void) @-> (ptr void) @-> returning string) show_diff let () = I.internal "tree_union" ((ptr void) @-> (ptr void) @-> returning (ptr void)) tree_union - let () = I.internal "reference_tree_to_json" (string @-> string @-> returning int) reference_tree_to_json + let () = I.internal "reference_tree_to_json" (string @-> string @-> string @-> returning int) reference_tree_to_json let () = I.internal "mask_tree" ((ptr void) @-> (ptr void) @-> returning (ptr void)) mask_tree end From 31455210b12b840aa48a6fba62342fbdbf7b7f96 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 24 Oct 2024 12:06:41 -0500 Subject: [PATCH 3/5] T6718: install files needed by vyconfd --- debian/libvyosconfig0.install | 3 +++ debian/rules | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/libvyosconfig0.install b/debian/libvyosconfig0.install index 40b3a73..dbd9fb6 100644 --- a/debian/libvyosconfig0.install +++ b/debian/libvyosconfig0.install @@ -1 +1,4 @@ usr/lib/libvyosconfig.so.0 +usr/share/vyos/vyconf +etc/vyos +usr/libexec/vyos/vyconf diff --git a/debian/rules b/debian/rules index ae59417..1b049d1 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,11 @@ #!/usr/bin/make -f DIR := debian/tmp +OCAML_DIR := /opt/opam/${OCAML_VERSION} +VYCONF := usr/libexec/vyos/vyconf +VYCONF_CONF := $(VYCONF)/config +VYCONF_DATA := usr/share/vyos/vyconf +VYCONF_DEF := etc/vyos %: dh $@ --with quilt @@ -9,6 +14,13 @@ override_dh_auto_build: ./build.sh $(DIR) override_dh_auto_install: + mkdir -p $(DIR)/$(VYCONF_CONF) + mkdir -p $(DIR)/$(VYCONF_DATA) + mkdir -p $(DIR)/$(VYCONF_DEF) + cp $(OCAML_DIR)/share/vyconf/vyconf.proto $(DIR)/$(VYCONF_DATA) + cp $(OCAML_DIR)/share/vyconf/vyconfd.conf $(DIR)/$(VYCONF_DEF) + cp $(OCAML_DIR)/bin/vyconfd $(DIR)/$(VYCONF) + # mkdir -p $(DIR)/usr/lib cp _build/libvyosconfig.so $(DIR)/usr/lib/libvyosconfig.so.0 dh_makeshlibs From 6f56f3b2e2342743da87836929453ecbdf84cd2c Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 24 Oct 2024 12:06:41 -0500 Subject: [PATCH 4/5] T6718: install vy_set/vy_delete --- debian/rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/rules b/debian/rules index 1b049d1..8d4a32b 100755 --- a/debian/rules +++ b/debian/rules @@ -20,6 +20,8 @@ override_dh_auto_install: cp $(OCAML_DIR)/share/vyconf/vyconf.proto $(DIR)/$(VYCONF_DATA) cp $(OCAML_DIR)/share/vyconf/vyconfd.conf $(DIR)/$(VYCONF_DEF) cp $(OCAML_DIR)/bin/vyconfd $(DIR)/$(VYCONF) + cp $(OCAML_DIR)/bin/vy_set $(DIR)/$(VYCONF) + cp $(OCAML_DIR)/bin/vy_delete $(DIR)/$(VYCONF) # mkdir -p $(DIR)/usr/lib cp _build/libvyosconfig.so $(DIR)/usr/lib/libvyosconfig.so.0 From bd71aa6b728f037ad5d85d9310f3380342714348 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 20 Nov 2024 13:18:35 -0600 Subject: [PATCH 5/5] T6718: pin required packages in build.sh --- build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sh b/build.sh index ce21827..6cebac8 100755 --- a/build.sh +++ b/build.sh @@ -2,6 +2,9 @@ DIR=$1 +sudo sh -c 'eval $(opam env --root=/opt/opam --set-root) && opam pin add vyos1x-config https://github.com/vyos/vyos1x-config.git#acfac8d809 -y' +sudo sh -c 'eval $(opam env --root=/opt/opam --set-root) && opam pin add vyconf https://github.com/vyos/vyconf.git#196fdd7fdf -y' + eval `opam config env` make clean make