diff --git a/ports/umurmur.hash b/ports/umurmur.hash new file mode 100644 index 0000000..a70c6b7 --- /dev/null +++ b/ports/umurmur.hash @@ -0,0 +1 @@ +a194b75e385ebbd429835056c75917373be5b4e1 diff --git a/ports/umurmur.port b/ports/umurmur.port new file mode 100644 index 0000000..c587c97 --- /dev/null +++ b/ports/umurmur.port @@ -0,0 +1,10 @@ +LICENSE := BSD +VERSION := 0.2.17 +DOWNLOADS := umurmur.archive + +URL(umurmur) := https://github.com/umurmur/umurmur/archive/0.2.17.tar.gz +SHA(umurmur) := e77b7b6616768f4a1c07442afe49a772692f667b00c23cc85909d4dd0ce206d2 +DIR(umurmur) := src/app/umurmur + +PATCHES := src/app/umurmur/umurmur.patch +PATCH_OPT := -p1 -d src/app/umurmur diff --git a/recipes/pkg/umurmur/README b/recipes/pkg/umurmur/README new file mode 100644 index 0000000..a87ee95 --- /dev/null +++ b/recipes/pkg/umurmur/README @@ -0,0 +1,2 @@ +uMurmur is a minimalistic Mumble server primarily targeted to run on +embedded computers. diff --git a/recipes/pkg/umurmur/archives b/recipes/pkg/umurmur/archives new file mode 100644 index 0000000..359e002 --- /dev/null +++ b/recipes/pkg/umurmur/archives @@ -0,0 +1,10 @@ +_/src/libc +_/src/libconfig +_/src/libcrypto +_/src/libssl +_/src/posix +_/src/protobuf-c +_/src/vfs +_/src/vfs_lwip +_/src/vfs_jitterentropy +_/src/zlib diff --git a/recipes/pkg/umurmur/hash b/recipes/pkg/umurmur/hash new file mode 100644 index 0000000..b1476fa --- /dev/null +++ b/recipes/pkg/umurmur/hash @@ -0,0 +1 @@ +2018-09-26 30f1f0f22c4926ab7b4fa795d1cb4d7db14c3f08 diff --git a/recipes/pkg/umurmur/runtime b/recipes/pkg/umurmur/runtime new file mode 100644 index 0000000..c40f2be --- /dev/null +++ b/recipes/pkg/umurmur/runtime @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +max_bandwidth = 48000; +welcometext = "Welcome to uMurmur!"; +# certificate = "/etc/umurmur/cert.crt"; +# private_key = "/etc/umurmur/key.key"; +password = ""; +max_users = 10; +channels = ( { + name = "Root"; + parent = ""; + description = "Root channel. No entry."; + noenter = true; + }, + { + name = "Lobby"; + parent = "Root"; + description = "Lobby channel"; + } +); +default_channel = "Lobby"; + + + + + + + + diff --git a/recipes/src/umurmur/content.mk b/recipes/src/umurmur/content.mk new file mode 100644 index 0000000..bedda1f --- /dev/null +++ b/recipes/src/umurmur/content.mk @@ -0,0 +1,12 @@ +content: src/app/umurmur LICENSE + +PORT_DIR := $(call port_dir,$(REP_DIR)/ports/umurmur) + +src/app/umurmur: + mkdir -p $@ + cp $(PORT_DIR)/src/app/umurmur/src/* $@ + cp $(REP_DIR)/src/app/umurmur/* $@ + rm $@/umurmur.patch + +LICENSE: + cp $(PORT_DIR)/src/app/umurmur/LICENSE $@ diff --git a/recipes/src/umurmur/hash b/recipes/src/umurmur/hash new file mode 100644 index 0000000..71db09d --- /dev/null +++ b/recipes/src/umurmur/hash @@ -0,0 +1 @@ +2018-09-26 9150eebfbcac451c42eef2ded043574a70959683 diff --git a/recipes/src/umurmur/used_apis b/recipes/src/umurmur/used_apis new file mode 100644 index 0000000..447d2a0 --- /dev/null +++ b/recipes/src/umurmur/used_apis @@ -0,0 +1,8 @@ +libc +libconfig +libcrypto +libssl +os +posix +protobuf-c +vfs diff --git a/run/umurmur.run b/run/umurmur.run new file mode 100644 index 0000000..2c36037 --- /dev/null +++ b/run/umurmur.run @@ -0,0 +1,133 @@ +if {![have_include power_on/qemu]} { + puts "\n Run script is not supported on this platform. \n" + exit 0 +} + +# +# Build +# + +set build_components { + core init + drivers/timer + drivers/nic + lib/vfs/lwip + app/umurmur +} + +source ${genode_dir}/repos/base/run/platform_drv.inc +append_platform_drv_build_components + +build $build_components + +create_boot_directory + +# +# Generate config +# + +set config { + + + + + + + + + + + + + + + + + + + } + +append_platform_drv_config + +append config { + + + + + + + + + + + + 2018-09-24 00:00 + 012345678 + + + + + + +max_bandwidth = 48000; +welcometext = "Welcome to uMurmur!"; +# certificate = "/etc/umurmur/cert.crt"; +# private_key = "/etc/umurmur/key.key"; +password = ""; +max_users = 10; +channels = ( { + name = "Root"; + parent = ""; + description = "Root channel. No entry."; + noenter = true; + }, + { + name = "Lobby"; + parent = "Root"; + description = "Lobby channel"; + } +); +default_channel = "Lobby"; + + + + + + + } + +append config { +} + +install_config $config + +# +# Boot modules +# + +# generic modules +set boot_modules { + core init timer nic_drv + ld.lib.so libc.lib.so vfs.lib.so vfs_lwip.lib.so + libcrypto.lib.so libssl.lib.so + libm.lib.so posix.lib.so + libconfig.lib.so protobuf-c.lib.so + umurmur +} + +# platform-specific modules +append_platform_drv_boot_modules + +build_boot_image $boot_modules + +# +# Execute test case +# + +# qemu config +append qemu_args " -nographic -net nic,model=e1000 " +append qemu_args " -net user -redir tcp:64738::64738 " + +run_genode_until forever + +# vi: set ft=tcl : diff --git a/src/app/umurmur/config.h b/src/app/umurmur/config.h new file mode 100644 index 0000000..f8d9d73 --- /dev/null +++ b/src/app/umurmur/config.h @@ -0,0 +1,52 @@ +#define DEFAULT_CONFIG "/etc/umurmur.conf" +#define HAVE_ALLOCA 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_ARPA_INET_H 1 +#define HAVE_FCNTL_H 1 +#define HAVE_FTRUNCATE 1 +#define HAVE_GETTIMEOFDAY 1 +#define HAVE_GOOGLE_PROTOBUF_C_PROTOBUF_C_H 1 +#define HAVE_INET_NTOA 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIBCONFIG 1 +#define HAVE_LIBCONFIG_H 1 +#define HAVE_LIBCRYPTO 1 +#define HAVE_LIBPROTOBUF_C 1 +#define HAVE_LIBSSL 1 +#define HAVE_LIBZ 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MEMCHR 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMORY_H 1 +#define HAVE_MEMSET 1 +#define HAVE_NETINET_TCP_H 1 +#define HAVE_OPENSSL_SSL_H 1 +#define HAVE_POLL 1 +#define HAVE_SOCKET 1 +#define HAVE_STDBOOL_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRDUP 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRRCHR 1 +#define HAVE_SYSLOG_H 1 +#define HAVE_SYS_POLL_H 1 +#define HAVE_SYS_SOCKET_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_UNAME 1 +#define HAVE_UNISTD_H 1 +#define HAVE__BOOL 1 + +#define PACKAGE "umurmur" +#define PACKAGE_BUGREPORT "https://github.com/umurmur/umurmur/issues/new" +#define PACKAGE_NAME "umurmur" +#define PACKAGE_STRING "umurmur 0.2.16" +#define PACKAGE_TARNAME "umurmur" +#define PACKAGE_URL "http://github.com/umurmur/umurmur" +#define PACKAGE_VERSION "0.2.16" +#define STDC_HEADERS 1 +#define VERSION "0.2.16" diff --git a/src/app/umurmur/dummy.c b/src/app/umurmur/dummy.c new file mode 100644 index 0000000..798829b --- /dev/null +++ b/src/app/umurmur/dummy.c @@ -0,0 +1,4 @@ +int sched_get_priority_min(int policy) +{ + return 0; +} diff --git a/src/app/umurmur/target.mk b/src/app/umurmur/target.mk new file mode 100644 index 0000000..dd1a395 --- /dev/null +++ b/src/app/umurmur/target.mk @@ -0,0 +1,32 @@ +TARGET := umurmur + +UMURMUR_DIR := $(call select_from_ports,umurmur)/src/app/umurmur/src + +SRC_C := Mumble.pb-c.c \ + ban.c \ + channel.c \ + client.c \ + conf.c \ + crypt.c \ + log.c \ + main.c \ + memory.c \ + messagehandler.c \ + messages.c \ + pds.c \ + server.c \ + ssli_openssl.c \ + timer.c \ + util.c \ + voicetarget.c + +SRC_C += dummy.c + +INC_DIR += $(UMURMUR_DIR) $(PRG_DIR) + +LIBS += libc libcrypto libssl protobuf-c libconfig posix + +vpath %.c $(UMURMUR_DIR) +vpath %.c $(PRG_DIR) + +CC_CXX_WARN_STRICT = diff --git a/src/app/umurmur/umurmur.patch b/src/app/umurmur/umurmur.patch new file mode 100644 index 0000000..7fb22b3 --- /dev/null +++ b/src/app/umurmur/umurmur.patch @@ -0,0 +1,27 @@ +--- a/src/main.c 2017-04-29 12:48:50.000000000 +0200 ++++ b/src/main.c 2018-09-25 23:02:45.496486188 +0200 +@@ -248,7 +248,7 @@ + + int main(int argc, char **argv) + { +- bool_t nodaemon = false; ++ bool_t nodaemon = true; + #ifdef POSIX_PRIORITY_SCHEDULING + bool_t realtime = false; + #endif +--- a/src/server.c 2017-04-29 12:48:50.000000000 +0200 ++++ b/src/server.c 2018-09-25 23:12:37.492917577 +0200 +@@ -71,9 +71,10 @@ + hasv4 = (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) ? false : true; + if (!(testsocket < 0)) close(testsocket); + +- testsocket = socket(PF_INET6, SOCK_STREAM, 0); +- hasv6 = (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) ? false : true; +- if (!(testsocket < 0)) close(testsocket); ++ // testsocket = socket(PF_INET6, SOCK_STREAM, 0); ++ // hasv6 = (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) ? false : true; ++ // if (!(testsocket < 0)) close(testsocket); ++ hasv6 = false; + + if(!hasv4) + {