From 157a2f9c1351e02ad369b3cee66d6ecab9f9be06 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 12 May 2017 11:47:24 +0100 Subject: [PATCH] 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 --- src/anbox/cmds/session_manager.cpp | 8 ++++++++ src/anbox/cmds/session_manager.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/anbox/cmds/session_manager.cpp b/src/anbox/cmds/session_manager.cpp index 924eadf..d0ce924 100644 --- a/src/anbox/cmds/session_manager.cpp +++ b/src/anbox/cmds/session_manager.cpp @@ -109,6 +109,9 @@ anbox::cmds::SessionManager::SessionManager(const BusFactory &bus_factory) flag(cli::make_flag(cli::Name{"standalone"}, cli::Description{"Prevents the Container Manager from starting the default container (Experimental)"}, standalone_)); + flag(cli::make_flag(cli::Name{"experimental"}, + cli::Description{"Allows users to use experimental features"}, + experimental_)); action([this](const cli::Command::Context &) { auto trap = core::posix::trap_signals_for_process( @@ -118,6 +121,11 @@ anbox::cmds::SessionManager::SessionManager(const BusFactory &bus_factory) trap->stop(); }); + if (standalone_ && !experimental_) { + ERROR("Experimental features selected, but --experimental flag not set"); + return EXIT_FAILURE; + } + if (!fs::exists("/dev/binder") || !fs::exists("/dev/ashmem")) { ERROR("Failed to start as either binder or ashmem kernel drivers are not loaded"); return EXIT_FAILURE; diff --git a/src/anbox/cmds/session_manager.h b/src/anbox/cmds/session_manager.h index 60c3d42..498f5a5 100644 --- a/src/anbox/cmds/session_manager.h +++ b/src/anbox/cmds/session_manager.h @@ -46,6 +46,7 @@ class SessionManager : public cli::CommandWithFlagsAndAction { bool single_window_ = false; graphics::Rect window_size_; bool standalone_ = false; + bool experimental_ = false; }; } // namespace cmds } // namespace anbox