Commit graph

557 commits

Author SHA1 Message Date
Lee Jones
e492cd1af8 cmds: session_manager: Handle the Container Client class using pointers
We can now start the Session Manager in Stand Alone Mode.  This means
that the Container Manager is not required, since the assumption is
that the user will provide their own container.  The issue is that
the container related calls are spread throughout the Session
Manager's code base.  So if we attempt to take an instance of the
Container Client class in one if-ed out area, by the time we reach
the next, it will be out of scope.

One solution is to take the instance of the Container Client class
globally, then only make use of it if it's required.  This works
great if the Container Manager is running in the background.
However, since a connection is made to the Container Manager
during the constructor, if the Container Manager is not running,
the side-effect is the following error:

  Failed to connect to socket /run/anbox-container.socket: Connection refused

To solve this problem we will use a global (actually private to
the Session Manager) pointer which will always be in scope.  It
will only be initialised and used when required though.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-05-12 15:40:40 +01:00
Lee Jones
157a2f9c13 cmds: session_manager: Introduce an Experimental Mode flag
Some features which Anbox offer may be useful to users, but can not
be officially supported.  For example, the recently added Stand-Alone
Mode can be utilised to make use of different types of independent
containers where Anbox does not control the complete life cycle, but
since these types of setups can be widely varying and complex, it
would not be impossible to provide support.  Thus, when running in
these modes, it's important for the user to show knowledge that they
are operating in an experimental way.  This functionality provided
by issuing the --experimental flag when starting the Session Manager.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-05-12 15:40:40 +01:00
Lee Jones
c0393a6713 cmds: session_manager: Provide an option to use any container
Normally Anbox will use the default container provided by the
Anbox Container Manager, but some users may wish to run their
own container.  Here we're adding a --standalone flag which
tells the Session Manager not to interact (configure/start)
the Container Manager.  This allows the user to utilise any
other bespoke container of their choosing.  For instance,
this new feature was tested using a Docker container running
the android.img provided by Anbox.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-05-12 15:40:40 +01:00
Simon Fels
a21233cb38 Merge pull request #252 from morphis/f/warn-on-cm-start
Print warning if user starts container manager manually
2017-05-11 18:35:59 +02:00
Simon Fels
5c1418b849 Merge pull request #251 from morphis/f/static-network-config
Use a static IP configuration for Android instead of a full blown DHCP setup
2017-05-11 18:35:46 +02:00
Simon Fels
e73ea080c4 Rename write_unsigned_{long,short} to write_uint{16,32} 2017-05-11 18:06:24 +02:00
Simon Fels
dd21e8fa1d Make never change value static and const 2017-05-11 18:05:38 +02:00
Simon Fels
e83cc1e5fd Use geteuid instead of getuid 2017-05-11 18:00:06 +02:00
Simon Fels
e60e020413 Remove double 'or' from warning message 2017-05-11 17:59:54 +02:00
Simon Fels
69733b1843 Merge pull request #244 from morphis/f/use-host-os-release
Read host os-release file when running inside the snap
2017-05-11 17:58:37 +02:00
Simon Fels
22fcbabb64 Print warning if user starts container manager manually 2017-05-11 07:45:24 +02:00
Simon Fels
7530bf9246 Use class instead of struct for IpConfigBuilder 2017-05-11 07:44:10 +02:00
Simon Fels
e441f3d42b Extend BinaryWriter test cases to cover all necessary things 2017-05-11 07:42:01 +02:00
Simon Fels
2fb4067da9 Add more constants for various static configuration items 2017-05-11 07:07:47 +02:00
Simon Fels
54499f0135 Simply bridge implementation to provide just a static configuration 2017-05-10 19:06:38 +02:00
Simon Fels
5bc93f76fe Create static IP configuration for Android 2017-05-10 19:06:12 +02:00
Simon Fels
c5f1a2724b Implement BinaryWriter class to allow writing binary data 2017-05-10 19:05:56 +02:00
Simon Fels
385bf94d51 Integrate review feedback 2017-05-09 09:51:38 +02:00
Simon Fels
fdbd63efa3 Merge pull request #245 from morphis/f/print-snap-revision
Print snap revision if running inside a snap
2017-05-09 09:43:51 +02:00
Simon Fels
a8045e0c8c Print snap revision if running inside a snap 2017-05-09 07:27:21 +02:00
Simon Fels
41530325ec Read host os-release file when running inside the snap 2017-05-09 07:20:56 +02:00
Simon Fels
ee38b6a181 Merge pull request #239 from matlink/patch-2
Adding libsdl2-image-dev dependency
2017-05-08 10:26:50 +02:00
Matlink
8d4c9dadc4 Adding libsdl2-image-dev dependency 2017-05-08 10:16:38 +02:00
Simon Fels
da20611a6c Merge pull request #214 from morphis/f/fork-session-mgr
Start session manager when not already running
2017-05-07 12:05:53 +02:00
Simon Fels
dbcc5cfba0 Fix incorrect logical expression for intent check 2017-05-07 11:46:59 +02:00
Simon Fels
459716ca6f Merge pull request #227 from morphis/f/correct-versioning
Set version we're building from snapcraft
2017-05-07 11:46:02 +02:00
Simon Fels
8c1247c0a8 Use boost::filesystem::path correctly 2017-05-05 18:46:07 +02:00
Simon Fels
189003ef95 Correct exception handling 2017-05-05 18:41:52 +02:00
Simon Fels
7b737733ba Rework version string initialization 2017-05-05 18:36:58 +02:00
Simon Fels
6c65da7a2c Add missing version source file 2017-05-05 08:15:34 +02:00
Simon Fels
16831f100e Integrate review feedback 2017-05-05 08:09:52 +02:00
Simon Fels
68dba196ba Add libsdl2-image-dev as build dependency for travis 2017-05-05 07:53:43 +02:00
Simon Fels
45ac3ecf6a Set version we're building from snapcraft 2017-05-05 07:51:55 +02:00
Simon Fels
dfdad4aa6c Integrate review feedback 2017-05-05 07:05:25 +02:00
Simon Fels
3c70c4a80d Merge pull request #221 from berolinux/static-helper-libs
Make sure helper libraries get built as static libs
2017-05-04 18:38:48 +02:00
Simon Fels
7d5f6e0d81 Merge pull request #215 from lag-linaro/master
docs: build-android.md: Add missing step to initialise the build env
2017-05-04 18:29:52 +02:00
Bernhard Rosenkränzer
ee4d0b9c49 Make sure helper libraries get built as static libs
Make sure helper libraries get built as static libs regardless
of the cmake version being used.

This fixes issue 217.

Signed-off-by: Bernhard Rosenkränzer <bero@lindev.ch>
2017-05-04 15:44:37 +02:00
Simon Fels
7fe8cfeb38 Use already defined width and height variables 2017-05-03 21:09:30 +02:00
Simon Fels
352d774760 Prefer empty check over length one 2017-05-03 20:48:15 +02:00
Simon Fels
f61a7f91d6 Use a full screen loading image which includes some text 2017-05-03 20:47:40 +02:00
Lee Jones
15067054c8 rpc: connection_creator: Fix formatting error
Warning currently prints out:

[WW 2017-05-03 15:15:30] [connection_creator.cpp:47@create_connection_for]
A second client tried to connect. Denied request as we already have oneand only allow a single client
                                                                       ^
Due to the way in which the code is formatted, we end up missing fudging
the words 'one' and 'and'.  Also the 3rd line in the source file seems
somewhat superfluous.  Let's fix that too.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-05-03 16:30:44 +01:00
Lee Jones
7432fb15b3 docs: build-android.md: Add missing step to initialise the build env
Setting up the build environment is a required step.

Without it, the subsequent step `lunch` will not be available.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-05-03 09:42:06 +01:00
Simon Fels
817f80d6bd Add missing build dependency on libsdl2-image-dev 2017-05-03 08:28:56 +02:00
Simon Fels
48758d8955 Set correct resource path when starting from within a snap 2017-05-03 08:25:33 +02:00
Simon Fels
f838e759d8 Install necessary resource files 2017-05-03 08:25:12 +02:00
Simon Fels
f094550279 Use correct resource path and check for errors on splash screen creation 2017-05-03 08:20:31 +02:00
Simon Fels
f4df33efe4 Improve launch and splash screen interactions 2017-05-03 07:57:54 +02:00
Simon Fels
bcb00e31af Add necessary dependency on SDL2 image 2017-05-03 07:57:33 +02:00
Simon Fels
ee105c3963 Hook splash screen into our launcher 2017-05-03 07:57:00 +02:00
Simon Fels
c44e2a84d8 Add simple splash screen implementation 2017-05-03 07:50:28 +02:00