]> rtime.felk.cvut.cz Git - frescor/frsh.git/commitdiff
forb: added scripts executing dynamic shared libraries
authorPetr Benes <benesp16@fel.cvut.cz>
Tue, 22 Feb 2011 09:54:47 +0000 (10:54 +0100)
committerPetr Benes <benesp16@fel.cvut.cz>
Tue, 22 Feb 2011 09:54:47 +0000 (10:54 +0100)
The scripts are responsible for a backward compatibility.
orb_id is now being passed to forbrun from the scripts.

However, the scripts do not pass the make. Omk accepts .sh
extension instead of no extension scripts.

Minor bugs fixed also.

21 files changed:
fres/cbroker/Makefile.omk
fres/cbroker/fcb [new file with mode: 0755]
fres/cbroker/fcb.c
resources/cluster_tree/Makefile.omk
resources/cluster_tree/frm_cluster_tree [new file with mode: 0755]
resources/cluster_tree/frm_cluster_tree.c
resources/cpu_aquosa/mngr/Makefile.omk
resources/cpu_aquosa/mngr/frm_aqcpu [new file with mode: 0755]
resources/cpu_aquosa/mngr/frm_aqcpu.c
resources/cpucg/mngr/Makefile.omk
resources/cpucg/mngr/frm_cgcpu [new file with mode: 0755]
resources/cpucg/mngr/frm_cgcpu.c
resources/dummy/Makefile.omk
resources/dummy/frm_dummy [new file with mode: 0755]
resources/dummy/frm_dummy.c
resources/fpga/Makefile.omk
resources/fpga/frm_fpga [new file with mode: 0755]
resources/fpga/frm_fpga.c
resources/item/Makefile.omk
resources/item/frm_item [new file with mode: 0755]
resources/item/frm_item.c

index efcd8aab1d611f1169a878c29b2abe076ec53786..55015f51d33775e5841f2daed6e040a30b4c07cf 100644 (file)
@@ -18,6 +18,8 @@ default_CONFIG += CONFIG_FCB=y        # Hack to let FORB automatically register referen
 
 LOCAL_CONFIG_H = fcb_config.h
 
+bin_SCRIPTS += fcb
+
 # include-pass_HOOKS = fcb_contract_gavl.inc
 
 # fcb_contract_gavl.inc: $(SOURCES_DIR)/fcb_contract_gavl.c
diff --git a/fres/cbroker/fcb b/fres/cbroker/fcb
new file mode 100755 (executable)
index 0000000..2594e3e
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./forbrun -i "org.frescor.fcb" ../lib/libcbroker.so "$@"
index f931d2eb4573fe4aa0eec574baf91772f455ed1d..489dbe43c074983936cd02a8b0f5ce9b42655062 100644 (file)
@@ -1493,7 +1493,6 @@ int forb_main(forb_orb orb, int argc, char *argv[])
        forb_executor_t executor;
        int ret;
        forb_init_attr_t attr = {
-               .orb_id = "org.frescor.fcb",
                .peer_discovery_callback = peer_discovery_callback,
                .peer_dead_callback = peer_dead_callback,
                .fixed_tcp_port = FCB_TCP_PORT,
@@ -1528,8 +1527,7 @@ int forb_main(forb_orb orb, int argc, char *argv[])
        memset(&fcb_data, 0, sizeof(fcb_data));
        fosa_clock_get_time(CLOCK_REALTIME, &start_time);
 
-       if (opt_daemon)
-               forb_daemon_prepare(opt_pidfile);
+
 
 #if CONFIG_FCB_INET && !CONFIG_FORB_PROTO_INET_DEFAULT
        ret = register_inet_port(orb);
index 2d3a5765aaa72e75221b3b53fb90d48b303dff48..f05d9d64cc7ad7fa3161bb70ce007919b13097c9 100644 (file)
@@ -17,4 +17,6 @@ frm_cluster_tree_LIBS = frm forb contract fosa rt ulut fcb_client m
 include_HEADERS = cluster_tree.h
 include_GEN_HEADERS = cluster_tree_idl.h
 
+bin_SCRIPTS += cluster_tree
+
 endif 
diff --git a/resources/cluster_tree/frm_cluster_tree b/resources/cluster_tree/frm_cluster_tree
new file mode 100755 (executable)
index 0000000..3fcb12e
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./forbrun -i "org.frescor.frm.cluster_tree" ../lib/libfrm_cluster_tree.so "$@"
index edf7a936fa3e0039390d77e9735f085da06e64b0..785e233d0bd97694a39cf3c327dca7bc192e6d50 100644 (file)
@@ -169,8 +169,6 @@ static const struct fres_res_manager frm = {
 int forb_main(forb_orb orb, int argc, char *argv[])
 {
        int ret;
-       forb_init_attr_t attr = { .orb_id = "org.frescor.frm.cluster_tree" };
-
        fres_block_register_cluster_tree();
 
        ret = frm_register_and_run(orb, &frm);
index 79f6cc8ada2f013a6bea6425372fb31a5c546e91..5a647534ff1e641dcd8a1856103f7928cba7d649 100644 (file)
@@ -4,3 +4,5 @@ LOADLIBES += -L $(AQUOSA_ROOT)/lib -lqreslib -lqsuplib
 LOADLIBES += -Xlinker -rpath -Xlinker $(AQUOSA_ROOT)/lib
 frm_aqcpu_LIBS = frm forb contract fosa rt ulut fcb_client qreslib qsuplib
 lib_LOADLIBES+= frsh
+
+bin_SCRIPTS += frm_aqcpu
\ No newline at end of file
diff --git a/resources/cpu_aquosa/mngr/frm_aqcpu b/resources/cpu_aquosa/mngr/frm_aqcpu
new file mode 100755 (executable)
index 0000000..3d945a4
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./forbrun -i "org.frescor.frm.aqcpu" ../lib/libfrm_aqcpu.so "$@"
index 51c32d7817d6eaeeaf6ec80e83ffee63759a09a9..2c6d8c47981d21ef5c58da0a0f819daaf4873862 100644 (file)
@@ -122,7 +122,6 @@ usage(void)
 int forb_main(forb_orb orb, int argc, char *argv[])
 {
        int ret;
-       forb_init_attr_t attr = { .orb_id = "org.frescor.frm.aqcpu" };
        int  opt;
        bool opt_daemon = false;
        char *opt_pidfile = NULL;
index 6cb7aebee6899ba20eb00c5c95ff9567ba816f17..db8c82daf08d6c0c313faccba9e083996a7adbd4 100644 (file)
@@ -2,3 +2,5 @@ shared_LIBRARIES = frm_cgcpu
 frm_cgcpu_SOURCES = frm_cgcpu.c
 frm_cgcpu_LIBS = frm forb contract fosa rt ulut fcb_client
 lib_LOADLIBES+= frsh
+
+bin_SCRIPTS += frm_cgcpu
\ No newline at end of file
diff --git a/resources/cpucg/mngr/frm_cgcpu b/resources/cpucg/mngr/frm_cgcpu
new file mode 100755 (executable)
index 0000000..2a224f9
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./forbrun -i "org.frescor.frm.cgcpu" ../lib/libfrm_cgcpu.so "$@"
index 00b7b8d851fb9ced8f20d0ce6fb5d4cf09d866fe..a48ec0be7be7ef4e7c192cfead44810cf3218a0d 100644 (file)
@@ -132,7 +132,6 @@ int forb_main(forb_orb orb, int argc, char *argv[])
        FILE* fd;
        int ret;
        int  opt;
-       forb_init_attr_t attr = { .orb_id = "org.frescor.frm.cgcpu" };
        bool opt_daemon = false;
        char *opt_pidfile = NULL;
 
index f29d52c1bdb0fe8068a90f7f01761e89d5fe8061..b571dbb0943c765575f589ae8f772173be985156 100644 (file)
@@ -14,3 +14,5 @@ fra_dummy_CLIENT_IDL = res_dummy_idl.idl
 
 include_HEADERS = res_dummy.h
 include_GEN_HEADERS = res_dummy_idl.h
+
+bin_SCRIPTS += frm_dummy
\ No newline at end of file
diff --git a/resources/dummy/frm_dummy b/resources/dummy/frm_dummy
new file mode 100755 (executable)
index 0000000..1d474cc
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./forbrun -i "org.frescor.frm.dummy" ../lib/libfrm_dummy.so "$@"
index 1314d03ff5c46701b27b3cd0344a072c0993a2ea..441f9b10e5bea0105b7cc1fc176fd659fc1c6131 100644 (file)
@@ -163,7 +163,7 @@ static struct fres_res_manager frm = {
 
 static struct option long_opts[] = {
     { "loglevel", 1, 0, 'l' },
-//     { "id",           required_argument, 0, 'i' },
+    { "id",      required_argument, 0, 'i' },
     { "accept-all", 0, 0, 'a' },
     { "help", 0, 0, 'h' },
     { 0, 0, 0, 0}
@@ -175,7 +175,7 @@ usage(void)
        printf("usage: frm_dummy [ options ]\n");
        printf("  -a, --accept-all   Accepts all contracts\n");
        printf("  -d, --daemon [pid-file]   go to background after FORB initialization\n");
-/*     printf("  -i, --id <resource id>    Use a different id that the default (%d)\n", DUMMY_RESOURCE_ID);*/
+       printf("  -i, --id <resource id>    Use a different id that the default (%d)\n", DUMMY_RESOURCE_ID);
        printf("  -h, --help         Display this help\n");
        printf("  -l, --loglevel <number>|<domain>=<number>,...\n");
 }
@@ -183,7 +183,6 @@ usage(void)
 int forb_main(forb_orb orb, int argc, char *argv[])
 {
        int ret;
-       forb_init_attr_t attr = { .orb_id = "org.frescor.frm.dummy" };
        int  opt;
 
        while ((opt = getopt_long(argc, argv, "ai:l:h", &long_opts[0], NULL)) != EOF) {
@@ -194,9 +193,9 @@ int forb_main(forb_orb orb, int argc, char *argv[])
                                opt_daemon = true;
                                opt_pidfile = optarg;
                                break;
-//                     case 'i':
-//                             opt_res_id = atoi(optarg);
-//                             break;
+                       case 'i':
+                               opt_res_id = atoi(optarg);
+                               break;
                        case 'l':
                                ul_log_domain_arg2levels(optarg);
                                break;
index 7cdeca81fbc2b221637d7aa002c49af06664afd0..f9d0977a0719e8f7605a35cf63113239d0430233 100644 (file)
@@ -16,4 +16,6 @@ fra_fpga_CLIENT_IDL = res_fpga_idl.idl
 
 include_HEADERS = res_fpga.h
 include_GEN_HEADERS = res_fpga_idl.h
+
+bin_SCRIPTS += fpga
 endif
diff --git a/resources/fpga/frm_fpga b/resources/fpga/frm_fpga
new file mode 100755 (executable)
index 0000000..6e5da6f
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./forbrun -i "org.frescor.frm.fpga" ../lib/libfrm_fpga.so "$@"
index 2609e10674a94d4f71f0cee01475519d97c5bdd1..c78c472e7f3f192dfc7a885340e6ed175db8eb7d 100644 (file)
@@ -113,7 +113,6 @@ static const struct fres_res_manager frm = {
 int forb_main(forb_orb orb, int argc, char *argv[])
 {
        int ret;
-       forb_init_attr_t attr = { .orb_id = "org.frescor.frm.fpga" };
 
        /* Register fres_block_fpga to contract handling
         * functions */
index aec0af99864fb6a44dc2417d2953f55de35edbad..435f3c29391f811d60efdfeca6ffd8ca5a6df47b 100644 (file)
@@ -16,5 +16,7 @@ fra_item_CLIENT_IDL = item_idl.idl
 include_HEADERS = item.h
 include_GEN_HEADERS = item_idl.h
 
+bin_SCRIPTS += item
+
 SUBDIRS=tests
 endif
diff --git a/resources/item/frm_item b/resources/item/frm_item
new file mode 100755 (executable)
index 0000000..b5dfb37
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./forbrun -i "org.frescor.frm.item" ../lib/libfrm_item.so "$@"
index 04eb850979f6eb9335f9484963dfc98e542f5422..6ab2ee23a6290edf16d3e7decb8bf203c9fd88de 100644 (file)
@@ -238,8 +238,6 @@ int forb_main(forb_orb orb, int argc, char *argv[])
        char platform[]="telosb";       
        char *parametrsITEM[] ={NULL,device,platform};
 
-       forb_init_attr_t attr = { .orb_id = "org.frescor.frm.item" };
-
        fres_block_register_item();