diff options
author | Ulf Wiger <ulf@feuerlabs.com> | 2016-02-24 22:54:26 +0100 |
---|---|---|
committer | Ulf Wiger <ulf@feuerlabs.com> | 2016-02-24 22:54:26 +0100 |
commit | 86618c1bed88a4057daa971cbe8a84afecd8b57a (patch) | |
tree | f3ce8b8344ab37106dc104662592cab3057b08f1 | |
parent | fdda5e6608e7b4a5ccb3b4a363d7820c21696b0d (diff) | |
parent | 269d60a0545cfb86c2467a09ddb2c4b9b9e31fca (diff) | |
download | rvi_core-86618c1bed88a4057daa971cbe8a84afecd8b57a.tar.gz |
Merge remote-tracking branch 'rstreif/develop' into uw-0_5_0
-rw-r--r-- | Makefile | 25 | ||||
-rwxr-xr-x | debian_template/rules | 2 | ||||
-rw-r--r-- | priv/config/rvi_debian.config | 344 | ||||
-rw-r--r-- | priv/config/rvi_ubuntu.config | 34 | ||||
-rw-r--r-- | priv/config/rvi_yocto.config | 50 | ||||
-rw-r--r-- | raspbian_template/README.Debian | 10 | ||||
-rw-r--r-- | raspbian_template/README.source | 6 | ||||
-rw-r--r-- | raspbian_template/changelog | 5 | ||||
-rw-r--r-- | raspbian_template/compat | 1 | ||||
-rw-r--r-- | raspbian_template/control | 13 | ||||
-rw-r--r-- | raspbian_template/copyright | 11 | ||||
-rw-r--r-- | raspbian_template/docs | 0 | ||||
-rwxr-xr-x | raspbian_template/rules | 21 | ||||
-rwxr-xr-x | raspbian_template/rvi.init | 70 | ||||
-rw-r--r-- | raspbian_template/rvi.lintian-overrides | 3 | ||||
-rw-r--r-- | raspbian_template/rvi.postinst | 45 | ||||
-rw-r--r-- | raspbian_template/rvi.postrm | 40 | ||||
-rw-r--r-- | raspbian_template/rvi.service | 18 | ||||
-rw-r--r-- | raspbian_template/source/format | 1 | ||||
-rw-r--r-- | raspbian_template/source/lintian-overrides | 1 |
20 files changed, 653 insertions, 47 deletions
@@ -71,6 +71,9 @@ ubuntu_clean: debian_clean: rm -rf ./debian_build +raspbian_clean: + rm -rf ./raspbian_build + rpm_clean: rm -rf ./rpm/BUILD/* \ ./rpm/BUILDROOT/* \ @@ -137,6 +140,28 @@ debian_package: clean debian_clean escript (cd ./debian_build/rvi-$(VERSION); debuild -uc -us) +# Create a raspbian package +raspbian_package: clean raspbian_clean escript + install --mode=0755 -d ./raspbian_build + +# Pack up all relevant files, and debian/, necessary for a build. +# Add rvi-$(VERSION) at the beginning of each file so +# that they get packed up into a correctly named subdirectory +# + tar czf ./raspbian_build/rvi_$(VERSION).orig.tar.gz \ + --exclude-vcs --transform="s|^|./rvi-$(VERSION)/|" \ + $(SRC_LIST) \ + raspbian_template + rm -rf raspbian/missing-sources +# Unpack the created tar file + (cd ./raspbian_build; tar xf rvi_$(VERSION).orig.tar.gz) +# Move the debian template to be the debian package + mv ./raspbian_build/rvi-$(VERSION)/raspbian_template ./raspbian_build/rvi-$(VERSION)/debian + install -d -m 0755 ./raspbian_build/rvi-$(VERSION)/debian/missing-sources +# Descend into the unpacked directory and build. + (cd ./raspbian_build/rvi-$(VERSION); debuild --prepend-path /usr/local/bin -uc -us) + + rpm: rpmclean rpm_tarball rpmbuild --define "_topdir $$PWD/rpm" -ba rpm/SPECS/rvi-$(VERSION).spec diff --git a/debian_template/rules b/debian_template/rules index b6b8c0a..fc2f6c0 100755 --- a/debian_template/rules +++ b/debian_template/rules @@ -18,4 +18,4 @@ override_dh_auto_install: # Copy out rvi_ctl to /usr/bin install -D -m 0755 ./debian/rvi/usr/lib/rvi_core/rvi_ctl ./debian/rvi/usr/bin/rvi_ctl # Install default config - install -D -m 0644 ./priv/config/rvi_ubuntu.config ./debian/rvi/etc/rvi/rvi.config + install -D -m 0644 ./priv/config/rvi_debian.config ./debian/rvi/etc/rvi/rvi.config diff --git a/priv/config/rvi_debian.config b/priv/config/rvi_debian.config new file mode 100644 index 0000000..4e1eeb5 --- /dev/null +++ b/priv/config/rvi_debian.config @@ -0,0 +1,344 @@ +%% -*- erlang -*- + +%% Copyright (C) 2014,2015,2016 Jaguar Land Rover +%% +%% This program is licensed under the terms and conditions of the +%% Mozilla Public License, version 2.0. The full text of the +%% Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ +%% +%% Configuration file for RVI deployed on Debian systems. +%% +%% See ../CONFIGURE.md for a details on the configuration process +%% itself. +%% + +%% Parameters for simpler modification +Env = fun(V, Def) -> + case os:getenv(V) of + false -> Def; + Str when is_integer(Def) -> list_to_integer(Str); + Str when is_atom(Def) -> list_to_atom(Str); + Str -> Str + end + end. +IPPort = fun(IP, Port) -> + IP ++ ":" ++ integer_to_list(Port) + end. +MyPort = Env("RVI_PORT", 9000). +MyIP = Env("RVI_MYIP", "127.0.0.1"). +MyNodeAddr = Env("RVI_MY_NODE_ADDR", IPPort(MyIP, MyPort)). +BackendIP = Env("RVI_BACKEND", "38.129.64.31"). +BackendPort = Env("RVI_BACKEND_PORT", 8807). +LogLevel = Env("RVI_LOGLEVEL", notice). + +[ + %% All erlang apps needed to fire up a node. Do not touch. + {include_lib, "rvi_core/priv/config/rvi_common.config"}, + + %% + %% Custom environment settings + %% for all apps running on the node. + %% + {env, + [ + + %% All RVI configuration is done here. + %% + %% Please note that the rvi_node.sh launch script + %% can still override the port range and static nodes + %% through its command line parameters. + %% + %% Value substitution: + %% All string values under the rvi tuple tree are scanned + %% for specific dokens during startup. If a token is + %% found, it will be replaced with a value referenced by it. + %% Tokens can one of the following: + %% + %% $rvi_file(FileName,Default) - File content + %% When an $rvi_file() token is encountered, the first line of + %% the referenced file is read. The line (without the newline) + %% replaces the token. + %% + %% Example: + %% { node_service_prefix, "genivi.org/vin/$rvi_file(/etc/vin,default_vin)"}, + %% + %% will be substituted with the first line from the file + %% /etc/vin: + %% + %% { node_service_prefix, "genivi.org/vin/2GKEG25HXP4093669"}, + %% + %% If /etc/vin cannot be opened, the value default_vin + %% will be used instead. + %% + %% + %% $rvi_env(EnvironemtnName,Default) - Environment variable + %% When an $rvi_env() token is encountered, the value of + %% the Linux process environment variable (such as $HOME) is read + %% to replace the token. + %% + %% Example: + %% { node_service_prefix, "genivi.org/vin/$rvi_env(VIN,default_vin)"}, + %% + %% will be substituted with the value of the $VIN environment + %% variable: + %% + %% { node_service_prefix, "genivi.org/vin/2GKEG25HXP4093669"}, + %% + %% If VIN is not a defined environment variable, the value + %% default_vin will be used instead. + %% + %% + %% $rvi_uuid(Default) - Unique machine identifier + %% When an $rvi_uuid() token is encountered, the UUID of the root + %% disk used by the system is read to replace the token. + %% The UUID of the root disk is retrieved by opening /proc/cmdline + %% and extracting the root=UUID=[DiskUUID] value. + %% This value is generated at system install time and is reasonably + %% world wide unique. + %% + %% Example: + %% { node_service_prefix, "genivi.org/vin/$uuid(default_vin)"}, + %% + %% will be substituted with the value of the root disk UUID: + %% + %% { node_service_prefix, + %% "genivi.org/vin/afc0a6d8-0264-4f8a-bb3e-51ff8655b51c"}, + %% + %% If the root UUID cannot be retrieved, the value default_vin + %% will be used instead. + %% + + {rvi_core, + [ + %% Specify the node address that data_link uses to listen to + %% incoming traffic from other rvi nodes. + %% + %% This is the address that is announced to + %% other rvi nodes during service discovery and should be + %% forwarded through firewalls and port forwarding to to the port + %% specified by the configuration entry rvi -> components -> + %% data_link ->json_rpc_server (see below). + %% + %% If this node is sitting behind a firewall and cannot + %% receive incomign connections on any address, its + %% node_address should be set to "0.0.0.0:0" to inform + %% the remote node that it should not attempt to + %% connect back to self. + { node_address, MyNodeAddr }, + + %% Specify the prefix of all services that this rvi node is hosting. + %% + %% All local services regsitering with service edge will be prefixed with + %% the string below when they are announced to remote rvi nodes + %% that connect to this node (using the address specified + %% by node_address above). + %% + %% If a locally connected service registers itself as + %% "hvac/fan_speed", and the node_service_prefix is + %% "genivi.org/vin/1234/", this node will announce the service + %% "genivi.org/vin/1234/hvac/fan_speed" as being available + %% to remotely connected rvi nodes. + %% + %% Two rvi nodes should never have the same node_service_prefix + %% value unless all services add a system-wide unique name + %% to it. + %% + { node_service_prefix, "genivi.org/vin/$rvi_uuid(default_vin)/"}, + + + %% Routing rules determine how to get a message targeting a specific + %% service to its destination. + %% + %% Please note that if a remotely initiated (== client) data link is + %% available and has announced that the targeted service is available, + %% that data link will be used regardless of what it is. + %% + %% In other words, if you setup routing rules for how to reach out + %% to a vehicle using SMS, and that vehicle happens to have a 3G + %% connection up when the message is sent, the 3G connection will be used. + %% + %% We will add a blacklist feature in the future to optionally block + %% such opportunistic routing in the future. + %% + { routing_rules, + [ + %% Service name prefix that rules are specified for + %% The service prefix with the longest match against the service targeted + %% by the message will be used. + %% + %% Example: Targeted service = genivi.org/backend/sota/get_updates + %% + %% Prefix1: { "genivi.org/backend", [...]} + %% Prefix2: { "genivi.org/backend/sota", [...]} + %% + %% Prefix2 will be used. + %% + %% This allows you, for example, to setup different servers + %% for different types of services (SOTA, remote door unlock, + %% HVAC etc). + %% + + %% Make sure to have a default if you don't want your message + %% to error out immediately. With a default the message will + %% be queued until it times out, waiting for a remote node + %% to connect and announce that it can handle the targeted service. + { "", + [ + { proto_json_rpc, dlink_tcp_rpc} + ] + }, + + { "genivi.org/backend/", + %% Which protocol and data link pair to use when transmitting the message + %% to the targeted service. If a pair reports a failure, the next pair is tried. + [ + { proto_json_rpc, { dlink_tcp_rpc, + % {"38.129.64.13", 8807} + [ { target, IPPort(BackendIP, BackendPort) } ]}} + ] + }, + + %% Used to communicate with vehicles + { "genivi.org/vin/", + [ + { proto_json_rpc, { dlink_tcp_rpc, [ broadcast, { interface, "wlan0" } ] } }, + { proto_json_rpc, { server_3g, [ initiate_outbound ]} }, + + %% Protocols can have hinting as well. + %% In this case JSON-RPC should only be used if the + %% resulting message size can fit in an SMS (140 bytes). + + { { proto_json_rpc, [ { max_msg_size, 140 } ] } , server_sms } + ] + } + ] + }, + + { components, + [ + %% A note about JSON-RPC calls vs gen_server calls: + %% + %% All locally connected services communicate with Service Edge + %% through JSON-RPC. + %% + %% Communication between the internal RVI components, however, + %% can be either JSON-RPC or gen_server calls. + %% + %% JSON-RPC calls provide compatability with replacement components + %% written in languages other than Erlang. + %% + %% Gen_server calls provide native erlang inter-process calls that + %% are about 4x faster than JSON-RPC when transmitting large data volumes. + %% + %% If one or more of the components below are replaced with external + %% components, use JSON-RPC by specifying IP address and port in + %% json_rpc_address for all interfaced by the external components. + %% + %% If you are running an all-native erlang system, use gen_server calls + %% by specifying gen_server for all components + %% + %% Please note that communication between two RVI nodes are + %% not affected by this since dlink_tcp will use + %% JSON-RPC to communicate ( using the address/port specified + %% by proto_json_rpc). + %% + + {rvi_common, + [ + {rvi_log, gen_server, + [{json_rpc_address, MyPort+9}] + } + ]}, + %% Service_edge. + %% The service_edge tuple is a top level configuration + %% container for everything about service edge. + %% In theory, we can support multiple different service edge + %% components (written in different languages). + %% + %% However, until we've sorted out internal routing, we will + %% only support the native service_edge_rpc component, + %% accessed either as a gen_server or through JSON-RPC. + %% + {service_edge, + [ + %% Service_edge_rpc component is used as a gen_server + { service_edge_rpc, gen_server, + [ + %% JSON-RPC address will be translated to + %% an URL looking like this: + %% http://127.0.0.1:8801 + %% + %% This URL is used both for communication with + %% locally connected services and for intra-component + %% communication in case the access method for + %% service_edge_rpc is specified as json_rpc. + { json_rpc_address, { MyIP, MyPort+1 } }, % {"127.0.0.1",8801} + { msgpack_rpc_address, { MyIP, MyPort + 21 } }, + + %% Websocket is used for websocket access, preferably + %% through the rvi.js package available for Javascript + %% apps in browsers and crosswalk who wants to interface + %% RVI. + { websocket, [ { port, MyPort+8}]} % 9008 + ] + } + ] + }, + { service_discovery, + [ { service_discovery_rpc, gen_server, + [ + { json_rpc_address, { MyIP, MyPort+2 }} % {"127.0.0.1",9002} + ] + } + ] + }, + { schedule, + [ { schedule_rpc, gen_server, + [ + { json_rpc_address, { MyIP, MyPort+3 }} % {"127.0.0.1",9003} + ] + } + ] + }, + { authorize, + [ { authorize_rpc, gen_server, + [ + { json_rpc_address, { MyIP, MyPort+4 } } % {"127.0.0.1",9004} + ] + } + ] + }, + { protocol, + [ { proto_json_rpc, gen_server, + [ + { json_rpc_address, { MyIP, MyPort+5 } } % {"127.0.0.1",9005} + ] + } + ] + }, + { data_link, + [ { dlink_tcp_rpc, gen_server, + [ + { json_rpc_address, { MyIP, MyPort+6 } }, % 9006 + %% data link TCP server specifies the port we should + %% listen to for incoming connections + %% from other rvi nodes. + %% A specific NIC address can also be specified + %% through the {ip, "192.168.0.1" } tuple. + { server_opts, [ { port, MyPort+7 }]}, + { persistent_connections, [ IPPort(BackendIP, BackendPort) ]} + ] + }, + { dlink_tls_rpc, gen_server, + [ + { json_rpc_address, { MyIP, MyPort+11} }, + { server_opts, [ {port, MyPort+10} ]} + ] + } + ] + } + ] + } + ]} + ]} +]. diff --git a/priv/config/rvi_ubuntu.config b/priv/config/rvi_ubuntu.config index 57ffd37..65319db 100644 --- a/priv/config/rvi_ubuntu.config +++ b/priv/config/rvi_ubuntu.config @@ -1,14 +1,12 @@ %% -*- erlang -*- -%% Copyright (C) 2014, Jaguar Land Rover +%% Copyright (C) 2014,2015,2016 Jaguar Land Rover %% %% This program is licensed under the terms and conditions of the %% Mozilla Public License, version 2.0. The full text of the %% Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ %% -%% Configuration file for the (in-vehicle) IVI used by the hvac_demo -%% -%% See ../hvac_demo/README.md for details on the demo. +%% Configuration file for RVI deployed on Ubuntu systems. %% %% See ../CONFIGURE.md for a details on the configuration process %% itself. @@ -62,12 +60,12 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% replaces the token. %% %% Example: - %% { node_service_prefix, "jlr.com/vin/$rvi_file(/etc/vin,default_vin)"}, + %% { node_service_prefix, "genivi.org/vin/$rvi_file(/etc/vin,default_vin)"}, %% %% will be substituted with the first line from the file %% /etc/vin: %% - %% { node_service_prefix, "jlr.com/vin/2GKEG25HXP4093669"}, + %% { node_service_prefix, "genivi.org/vin/2GKEG25HXP4093669"}, %% %% If /etc/vin cannot be opened, the value default_vin %% will be used instead. @@ -79,12 +77,12 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% to replace the token. %% %% Example: - %% { node_service_prefix, "jlr.com/vin/$rvi_env(VIN,default_vin)"}, + %% { node_service_prefix, "genivi.org/vin/$rvi_env(VIN,default_vin)"}, %% %% will be substituted with the value of the $VIN environment %% variable: %% - %% { node_service_prefix, "jlr.com/vin/2GKEG25HXP4093669"}, + %% { node_service_prefix, "genivi.org/vin/2GKEG25HXP4093669"}, %% %% If VIN is not a defined environment variable, the value %% default_vin will be used instead. @@ -99,12 +97,12 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% world wide unique. %% %% Example: - %% { node_service_prefix, "jlr.com/vin/$uuid(default_vin)"}, + %% { node_service_prefix, "genivi.org/vin/$uuid(default_vin)"}, %% %% will be substituted with the value of the root disk UUID: %% %% { node_service_prefix, - %% "jlr.com/vin/afc0a6d8-0264-4f8a-bb3e-51ff8655b51c"}, + %% "genivi.org/vin/afc0a6d8-0264-4f8a-bb3e-51ff8655b51c"}, %% %% If the root UUID cannot be retrieved, the value default_vin %% will be used instead. @@ -137,15 +135,15 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% %% If a locally connected service registers itself as %% "hvac/fan_speed", and the node_service_prefix is - %% "jlr.com/vin/1234/", this node will announce the service - %% "jlr.com/vin/1234/hvac/fan_speed" as being available + %% "genivi.org/vin/1234/", this node will announce the service + %% "genivi.org/vin/1234/hvac/fan_speed" as being available %% to remotely connected rvi nodes. %% %% Two rvi nodes should never have the same node_service_prefix %% value unless all services add a system-wide unique name %% to it. %% - { node_service_prefix, "jlr.com/vin/$rvi_uuid(default_vin)/"}, + { node_service_prefix, "genivi.org/vin/$rvi_uuid(default_vin)/"}, %% Routing rules determine how to get a message targeting a specific @@ -168,10 +166,10 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% The service prefix with the longest match against the service targeted %% by the message will be used. %% - %% Example: Targeted service = jlr.com/backend/sota/get_updates + %% Example: Targeted service = genivi.org/backend/sota/get_updates %% - %% Prefix1: { "jlr.com/backend", [...]} - %% Prefix2: { "jlr.com/backend/sota", [...]} + %% Prefix1: { "genivi.org/backend", [...]} + %% Prefix2: { "genivi.org/backend/sota", [...]} %% %% Prefix2 will be used. %% @@ -190,7 +188,7 @@ LogLevel = Env("RVI_LOGLEVEL", notice). ] }, - { "jlr.com/backend/", + { "genivi.org/backend/", %% Which protocol and data link pair to use when transmitting the message %% to the targeted service. If a pair reports a failure, the next pair is tried. [ @@ -201,7 +199,7 @@ LogLevel = Env("RVI_LOGLEVEL", notice). }, %% Used to communicate with vehicles - { "jlr.com/vin/", + { "genivi.org/vin/", [ { proto_json_rpc, { dlink_tcp_rpc, [ broadcast, { interface, "wlan0" } ] } }, { proto_json_rpc, { server_3g, [ initiate_outbound ]} }, diff --git a/priv/config/rvi_yocto.config b/priv/config/rvi_yocto.config index 6e7863a..76a1064 100644 --- a/priv/config/rvi_yocto.config +++ b/priv/config/rvi_yocto.config @@ -1,14 +1,13 @@ %% -*- erlang -*- -%% Copyright (C) 2014, Jaguar Land Rover +%% Copyright (C) 2014,2015,2016 Jaguar Land Rover %% %% This program is licensed under the terms and conditions of the %% Mozilla Public License, version 2.0. The full text of the %% Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ %% -%% Configuration file for the (in-vehicle) IVI used by the hvac_demo -%% -%% See ../hvac_demo/README.md for details on the demo. +%% Configuration file for RVI built and deployed with the +%% Yocto Project %% %% See ../CONFIGURE.md for a details on the configuration process %% itself. @@ -23,14 +22,14 @@ Env = fun(V, Def) -> Str -> Str end end. +IPPort = fun(IP, Port) -> + IP ++ ":" ++ integer_to_list(Port) + end. MyPort = Env("RVI_PORT", 9000). MyIP = Env("RVI_MYIP", "127.0.0.1"). -MyNodeAddr = Env("RVI_MY_NODE_ADDR", "0.0.0.0:0"). +MyNodeAddr = Env("RVI_MY_NODE_ADDR", IPPort(MyIP, MyPort)). BackendIP = Env("RVI_BACKEND", "38.129.64.31"). BackendPort = Env("RVI_BACKEND_PORT", 8807). -IPPort = fun(IP, Port) -> - IP ++ ":" ++ integer_to_list(Port) - end. LogLevel = Env("RVI_LOGLEVEL", notice). [ @@ -62,12 +61,12 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% replaces the token. %% %% Example: - %% { node_service_prefix, "jlr.com/vin/$rvi_file(/etc/vin,default_vin)"}, + %% { node_service_prefix, "genivi.org/vin/$rvi_file(/etc/vin,default_vin)"}, %% %% will be substituted with the first line from the file %% /etc/vin: %% - %% { node_service_prefix, "jlr.com/vin/2GKEG25HXP4093669"}, + %% { node_service_prefix, "genivi.org/vin/2GKEG25HXP4093669"}, %% %% If /etc/vin cannot be opened, the value default_vin %% will be used instead. @@ -79,12 +78,12 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% to replace the token. %% %% Example: - %% { node_service_prefix, "jlr.com/vin/$rvi_env(VIN,default_vin)"}, + %% { node_service_prefix, "genivi.org/vin/$rvi_env(VIN,default_vin)"}, %% %% will be substituted with the value of the $VIN environment %% variable: %% - %% { node_service_prefix, "jlr.com/vin/2GKEG25HXP4093669"}, + %% { node_service_prefix, "genivi.org/vin/2GKEG25HXP4093669"}, %% %% If VIN is not a defined environment variable, the value %% default_vin will be used instead. @@ -99,12 +98,12 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% world wide unique. %% %% Example: - %% { node_service_prefix, "jlr.com/vin/$uuid(default_vin)"}, + %% { node_service_prefix, "genivi.org/vin/$uuid(default_vin)"}, %% %% will be substituted with the value of the root disk UUID: %% %% { node_service_prefix, - %% "jlr.com/vin/afc0a6d8-0264-4f8a-bb3e-51ff8655b51c"}, + %% "genivi.org/vin/afc0a6d8-0264-4f8a-bb3e-51ff8655b51c"}, %% %% If the root UUID cannot be retrieved, the value default_vin %% will be used instead. @@ -112,12 +111,6 @@ LogLevel = Env("RVI_LOGLEVEL", notice). {rvi_core, [ - - {key_pair, {openssl_pem, "rvi_core/priv/sample_keys/insecure_device_bkey_priv.pem"}}, - {provisioning_key, "rvi_core/priv/sample_keys/insecure_root_key_pub.pem"}, - {authorize_jwt, "rvi_core/priv/sample_keys/insecure_device_key_pub_sign.jwt"}, - {cert_dir, "rvi_core/priv/sample_certs"}, - %% Specify the node address that data_link uses to listen to %% incoming traffic from other rvi nodes. %% @@ -143,15 +136,15 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% %% If a locally connected service registers itself as %% "hvac/fan_speed", and the node_service_prefix is - %% "jlr.com/vin/1234/", this node will announce the service - %% "jlr.com/vin/1234/hvac/fan_speed" as being available + %% "genivi.org/vin/1234/", this node will announce the service + %% "genivi.org/vin/1234/hvac/fan_speed" as being available %% to remotely connected rvi nodes. %% %% Two rvi nodes should never have the same node_service_prefix %% value unless all services add a system-wide unique name %% to it. %% - { node_service_prefix, "jlr.com/vin/$rvi_uuid(default_vin)/"}, + { node_service_prefix, "genivi.org/vin/$rvi_uuid(default_vin)/"}, %% Routing rules determine how to get a message targeting a specific @@ -174,10 +167,10 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% The service prefix with the longest match against the service targeted %% by the message will be used. %% - %% Example: Targeted service = jlr.com/backend/sota/get_updates + %% Example: Targeted service = genivi.org/backend/sota/get_updates %% - %% Prefix1: { "jlr.com/backend", [...]} - %% Prefix2: { "jlr.com/backend/sota", [...]} + %% Prefix1: { "genivi.org/backend", [...]} + %% Prefix2: { "genivi.org/backend/sota", [...]} %% %% Prefix2 will be used. %% @@ -196,7 +189,7 @@ LogLevel = Env("RVI_LOGLEVEL", notice). ] }, - { "jlr.com/backend/", + { "genivi.org/backend/", %% Which protocol and data link pair to use when transmitting the message %% to the targeted service. If a pair reports a failure, the next pair is tried. [ @@ -207,7 +200,7 @@ LogLevel = Env("RVI_LOGLEVEL", notice). }, %% Used to communicate with vehicles - { "jlr.com/vin/", + { "genivi.org/vin/", [ { proto_json_rpc, { dlink_tcp_rpc, [ broadcast, { interface, "wlan0" } ] } }, { proto_json_rpc, { server_3g, [ initiate_outbound ]} }, @@ -281,6 +274,7 @@ LogLevel = Env("RVI_LOGLEVEL", notice). %% communication in case the access method for %% service_edge_rpc is specified as json_rpc. { json_rpc_address, { MyIP, MyPort+1 } }, % {"127.0.0.1",8801} + { msgpack_rpc_address, { MyIP, MyPort + 21 } }, %% Websocket is used for websocket access, preferably %% through the rvi.js package available for Javascript diff --git a/raspbian_template/README.Debian b/raspbian_template/README.Debian new file mode 100644 index 0000000..f80c683 --- /dev/null +++ b/raspbian_template/README.Debian @@ -0,0 +1,10 @@ +rvi for Debian +-------------- + +Will rely on existing Erlang installation to work. + +We will copy out the Erlang VM BEAM files to /opt/rvi and the configuration files to /etc/opt/rvi + +/opt/rvi/rvi.sh is the main control program. + + -- Magnus Feuer <mfeuer@jaguarlandrover.com> Fri, 27 Nov 2015 15:34:39 -0800 diff --git a/raspbian_template/README.source b/raspbian_template/README.source new file mode 100644 index 0000000..9e3c927 --- /dev/null +++ b/raspbian_template/README.source @@ -0,0 +1,6 @@ +rvi for Debian +-------------- + + + -- Magnus Feuer <mfeuer@jaguarlandrover.com> Fri, 27 Nov 2015 15:34:39 -0800 + diff --git a/raspbian_template/changelog b/raspbian_template/changelog new file mode 100644 index 0000000..3d774a4 --- /dev/null +++ b/raspbian_template/changelog @@ -0,0 +1,5 @@ +rvi (0.5.0-1) jessie; urgency=low + + * Initial release + + -- Magnus Feuer <mfeuer@jaguarlandrover.com> Fri, 27 Nov 2015 15:34:39 -0800 diff --git a/raspbian_template/compat b/raspbian_template/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/raspbian_template/compat @@ -0,0 +1 @@ +9 diff --git a/raspbian_template/control b/raspbian_template/control new file mode 100644 index 0000000..f0836a6 --- /dev/null +++ b/raspbian_template/control @@ -0,0 +1,13 @@ +Source: rvi +Section: net +Priority: optional +Maintainer: Magnus Feuer <mfeuer@jaguarlandrover.com> +Build-Depends: debhelper (>= 9), libbluetooth-dev +Standards-Version: 3.9.6 +Homepage: https://github.com/PDXostc/rvi_core + +Package: rvi +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, bluez, python-jsonrpclib (>= 0.1.3-1), python (>= 2.7.9-1) +Description: Remote Vehicle Interaction + GENIVI Remote Vehicle Interaction Core diff --git a/raspbian_template/copyright b/raspbian_template/copyright new file mode 100644 index 0000000..89597cf --- /dev/null +++ b/raspbian_template/copyright @@ -0,0 +1,11 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: rvi +Source: http://github.com/PDXostc/rvi_core + +Files: * +Copyright: Copyright 2014,2015,2016 Jaguar Land Rover +License: MPL-2.0 + This program is licensed under the terms and conditions of the + Mozilla Public License, version 2.0. The full text of the + Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ + diff --git a/raspbian_template/docs b/raspbian_template/docs new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/raspbian_template/docs diff --git a/raspbian_template/rules b/raspbian_template/rules new file mode 100755 index 0000000..b6b8c0a --- /dev/null +++ b/raspbian_template/rules @@ -0,0 +1,21 @@ +#!/usr/bin/make -f +# -*- makefile --* + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +%: + dh $@ + +override_dh_auto_install: + ./scripts/rvi_install \ + -s ./debian/rvi \ + -k priv/keys/insecure_device_key.pem \ + -r priv/certificates/insecure_root_cert.crt \ + -d priv/certificates/insecure_device_cert.crt \ + -c priv/credentials/insecure_credential.jwt \ + -l ./debian/rvi/var/log/rvi ./debian/rvi/usr/lib/rvi_core +# Copy out rvi_ctl to /usr/bin + install -D -m 0755 ./debian/rvi/usr/lib/rvi_core/rvi_ctl ./debian/rvi/usr/bin/rvi_ctl +# Install default config + install -D -m 0644 ./priv/config/rvi_ubuntu.config ./debian/rvi/etc/rvi/rvi.config diff --git a/raspbian_template/rvi.init b/raspbian_template/rvi.init new file mode 100755 index 0000000..9cd4e59 --- /dev/null +++ b/raspbian_template/rvi.init @@ -0,0 +1,70 @@ +#!/bin/sh +# +# Copyright (C) 2014, Jaguar Land Rover +# +# This program is licensed under the terms and conditions of the +# Mozilla Public License, version 2.0. The full text of the +# Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ +# +# +# Init.d script to start and stop an RVI system installed +# through an RPM. +# +### BEGIN INIT INFO +# Provides: rvi +# Required-Start: $network $syslog $remote_fs +# Required-Stop: $network $syslog $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start/Stop RVI node at boot time +# Description: Manage Remote Vehicle Interaction Node run state. +### END INIT INFO + +export PATH="/bin/:/usr/bin:/sbin:/usr/sbin" +export HOME=/usr/lib/rvi_core +. /lib/lsb/init-functions + +set -e + +case "$1" in + start) + log_daemon_msg "Starting Remote Vehicle Interaction Node..." "rvi" + if /usr/bin/rvi_ctl -c /etc/rvi/rvi.config start; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + stop) + log_daemon_msg "Stopping Remote Vehicle Interaction Node..." "rvi" + if /usr/bin/rvi_ctl stop; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + + restart) + log_daemon_msg "Restarting Remote Vehicle Interaction Node..." "rvi" + if /usr/bin/rvi_ctl restart; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + + force-reload) + log_daemon_msg "Restarting Remote Vehicle Interaction Node..." "rvi" + if /usr/bin/rvi_ctl restart; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + *) + log_action_msg "Usage: /etc/init.d/rvi {start|stop|restart}" + exit 1 +esac + +exit 0 + diff --git a/raspbian_template/rvi.lintian-overrides b/raspbian_template/rvi.lintian-overrides new file mode 100644 index 0000000..c307106 --- /dev/null +++ b/raspbian_template/rvi.lintian-overrides @@ -0,0 +1,3 @@ +executable-not-elf-or-script +missing-dep-for-interpreter +binary-without-manpage
\ No newline at end of file diff --git a/raspbian_template/rvi.postinst b/raspbian_template/rvi.postinst new file mode 100644 index 0000000..10c11fe --- /dev/null +++ b/raspbian_template/rvi.postinst @@ -0,0 +1,45 @@ +#!/bin/sh +# postinst script for rvi +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# source debconf library +. /usr/share/debconf/confmodule + +case "$1" in + + configure) + # Set up our config + cat /proc/sys/kernel/random/uuid > /etc/rvi/device_id + echo "RVI Device ID set to $(cat /etc/rvi/device_id) in /etc/rvi/device_id" + #DEBHELPER# + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + exit 0 + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; + +esac + +db_stop + +exit 0 diff --git a/raspbian_template/rvi.postrm b/raspbian_template/rvi.postrm new file mode 100644 index 0000000..a0c5d5b --- /dev/null +++ b/raspbian_template/rvi.postrm @@ -0,0 +1,40 @@ +#!/bin/sh +# postrm script for rvi +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <overwriter> +# <overwriter-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# source debconf library +. /usr/share/debconf/confmodule + +case "$1" in + + remove|purge|upgrde|disappear) + rm -f /etc/init.d/rvi + #DEBHELPER# + ;; + + *) + exit 0 + ;; + + +esac + +db_stop + +exit 0 diff --git a/raspbian_template/rvi.service b/raspbian_template/rvi.service new file mode 100644 index 0000000..d9ae979 --- /dev/null +++ b/raspbian_template/rvi.service @@ -0,0 +1,18 @@ +# systemd(8) setup for Debian + +[Unit] +Description=Remote Vehicle Interaction Service +Wants=network-online.target + +[Service] +Environment="HOME=/usr/lib/rvi_core" +Type=forking +StandardOutput=journal +StandardError=journal +ExecStart=/usr/bin/rvi_ctl -c /etc/rvi/rvi.config start +ExecStop=/usr/bin/rvi_ctl stop +GuessMainPID=yes +RemainAfterExit=yes + +[Install] +WantedBy=graphical.target multi-user.target diff --git a/raspbian_template/source/format b/raspbian_template/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/raspbian_template/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/raspbian_template/source/lintian-overrides b/raspbian_template/source/lintian-overrides new file mode 100644 index 0000000..463abe9 --- /dev/null +++ b/raspbian_template/source/lintian-overrides @@ -0,0 +1 @@ +source-is-missing |