From: Justin Cinkelj <justin.cink...@xlab.si>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

update cloudinit to use the new libhttpserver-api

The c446634acbb354497f21fba0149c5ca716b277f1 splited httpserver into
httpserver-api and httpserver-html5-gui. The new httpserver-api module
uploads binary libhttpserver-api.so to /libhttpserver.so, and old
httpserver module then runs the /libhttpserver.so.

This broke cloud-init module. At link time libhttpserver.so was not found.
Fix this by linking aginst -lhttpserver-api. Also, upload
libhttpserver-api.so with unmodified name, so that cloud-init is able
to find it during ELF loading.

Signed-off-by: Justin Cinkelj <justin.cink...@xlab.si>
Message-Id: <20170919123700.30966-1-justin.cink...@xlab.si>

---
diff --git a/modules/cloud-init/Makefile b/modules/cloud-init/Makefile
--- a/modules/cloud-init/Makefile
+++ b/modules/cloud-init/Makefile
@@ -18,7 +18,7 @@ OBJ_FILES := $(addprefix obj/,$(CPP_FILES:.cc=.o))
 DEPS := $(OBJ_FILES:.o=.d)

 STUB_HTTPSERVER_LIBS = $(HTTPSERVER_API_DIR)/httpserver-stub.so
-LIBS = -lpthread $(boost-libs) $(DEPEDNDS_LIBS) -lyaml-cpp -L$(HTTPSERVER_API_DIR)/ -lhttpserver +LIBS = -lpthread $(boost-libs) $(DEPEDNDS_LIBS) -lyaml-cpp -L$(HTTPSERVER_API_DIR)/ -lhttpserver-api

 quiet = $(if $V, $1, @echo " $2"; $1)
 very-quiet = $(if $V, $1, @$1)
diff --git a/modules/httpserver-api/module.py b/modules/httpserver-api/module.py
--- a/modules/httpserver-api/module.py
+++ b/modules/httpserver-api/module.py
@@ -5,7 +5,7 @@

 _module = '${OSV_BASE}/modules/httpserver-api'

-_exe = '/libhttpserver.so'
+_exe = '/libhttpserver-api.so'

 usr_files = FileMap()
 usr_files.add(os.path.join(_module, 'libhttpserver-api.so')).to(_exe)
diff --git a/modules/httpserver/module.py b/modules/httpserver/module.py
--- a/modules/httpserver/module.py
+++ b/modules/httpserver/module.py
@@ -2,9 +2,9 @@

 api.require('httpserver-html5-gui')

-fg = api.run('/libhttpserver.so')
+fg = api.run('/libhttpserver-api.so')

 # httpserver will run regardless of an explicit command line
 # passed with "run.py -e".
-daemon = api.run_on_init('/libhttpserver.so &!')
+daemon = api.run_on_init('/libhttpserver-api.so &!')
 default = daemon

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to