Merge pull request #14 from morphis/network-connectivity

Network connectivity
This commit is contained in:
Simon Fels 2016-12-09 17:24:58 +01:00 • committed by GitHub
commit 357b1a58ec
5 changed files with 50 additions and 43 deletions

View file

@ -1,8 +1,2 @@
service anboxd /system/bin/anboxd service anboxd /system/bin/anboxd
class core class core
# We will ever only have a single network interface we need to care
# about so we can add static setup for this one here.
service anbox-network /system/bin/dhcptool eth0
class main
oneshot

View file

@ -21,6 +21,7 @@ if [ ! -e $SYSTEM_IMG ]; then
exit 1 exit 1
fi fi
start() {
# Extract ramdisk content instead of trying to bind mount the # Extract ramdisk content instead of trying to bind mount the
# cpio image file to allow modifications. # cpio image file to allow modifications.
rm -Rf $RAMDISK_PATH rm -Rf $RAMDISK_PATH
@ -51,11 +52,28 @@ mkdir -p $SNAP_COMMON/lxc
# possible. See snapcraft.yaml for further details. # possible. See snapcraft.yaml for further details.
$SNAP/bin/anbox-bridge.sh start $SNAP/bin/anbox-bridge.sh start
$SNAP/usr/sbin/aa-exec -p unconfined -- $SNAP/bin/anbox-wrapper.sh container-manager exec $SNAP/usr/sbin/aa-exec -p unconfined -- $SNAP/bin/anbox-wrapper.sh container-manager
pid=$! }
waitpid $pid
stop() {
for dir in cache data; do
umount $ROOTFS_PATH/$dir
done
umount $ROOTFS_PATH/system
umount $ROOTFS_PATH
$SNAP/bin/anbox-bridge.sh stop $SNAP/bin/anbox-bridge.sh stop
}
umount $ROOTFS_PATH/system case "$1" in
umount $ROOTFS_PATH/data start)
start
;;
stop)
stop
;;
*)
echo "ERROR: Unknown command '$1'"
exit 1
;;
esac

View file

@ -12,7 +12,8 @@ apps:
anbox: anbox:
command: bin/anbox-wrapper.sh command: bin/anbox-wrapper.sh
container-manager: container-manager:
command: bin/container-manager.sh command: bin/container-manager.sh start
stop-command: bin/container-manager.sh stop
daemon: simple daemon: simple
# FIXME: a oneshot unit with start/stop commands needs also RemainAfterExit=yes # FIXME: a oneshot unit with start/stop commands needs also RemainAfterExit=yes
# but this isn't supported by snapd yet. See LP #1647169 for details. # but this isn't supported by snapd yet. See LP #1647169 for details.

View file

@ -121,8 +121,6 @@ void AndroidApiStub::remove_task(const std::int32_t &id) {
auto c = std::make_shared<Request<protobuf::rpc::Void>>(); auto c = std::make_shared<Request<protobuf::rpc::Void>>();
DEBUG("");
protobuf::bridge::RemoveTask message; protobuf::bridge::RemoveTask message;
message.set_id(id); message.set_id(id);

View file

@ -80,10 +80,6 @@ void LxcContainer::start(const Configuration &configuration) {
if (container_->is_running(container_)) container_->stop(container_); if (container_->is_running(container_)) container_->stop(container_);
} }
// We drop all not needed capabilities
set_config_item("lxc.cap.drop",
"mac_admin mac_override sys_time sys_module sys_rawio");
// We can mount proc/sys as rw here as we will run the container unprivileged // We can mount proc/sys as rw here as we will run the container unprivileged
// in the end // in the end
set_config_item("lxc.mount.auto", "proc:mixed sys:mixed cgroup:mixed"); set_config_item("lxc.mount.auto", "proc:mixed sys:mixed cgroup:mixed");