Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
357b1a58
A
anbox
项目概览
openeuler
/
anbox
通知
24
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
anbox
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
357b1a58
编写于
12月 09, 2016
作者:
S
Simon Fels
提交者:
GitHub
12月 09, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14 from morphis/network-connectivity
Network connectivity
上级
dd458efb
cbb4beaa
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
58 addition
and
51 deletion
+58
-51
android/anboxd.rc
android/anboxd.rc
+0
-6
scripts/container-manager.sh
scripts/container-manager.sh
+56
-38
snapcraft.yaml
snapcraft.yaml
+2
-1
src/anbox/bridge/android_api_stub.cpp
src/anbox/bridge/android_api_stub.cpp
+0
-2
src/anbox/container/lxc_container.cpp
src/anbox/container/lxc_container.cpp
+0
-4
未找到文件。
android/anboxd.rc
浏览文件 @
357b1a58
service anboxd /system/bin/anboxd
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
scripts/container-manager.sh
浏览文件 @
357b1a58
...
...
@@ -21,41 +21,59 @@ if [ ! -e $SYSTEM_IMG ]; then
exit
1
fi
# Extract ramdisk content instead of trying to bind mount the
# cpio image file to allow modifications.
rm
-Rf
$RAMDISK_PATH
mkdir
-p
$RAMDISK_PATH
cd
$RAMDISK_PATH
cat
$INITRD
|
gzip
-d
| cpio
-i
# FIXME those things should be fixed in the build process
chmod
+x
$RAMDISK_PATH
/anbox-init.sh
# Setup the read-only rootfs
mkdir
-p
$ROOTFS_PATH
mount
-o
bind
,ro
$RAMDISK_PATH
$ROOTFS_PATH
mount
-o
loop,ro
$SYSTEM_IMG
$ROOTFS_PATH
/system
# but certain top-level directories need to be in a writable space
for
dir
in
cache data
;
do
mkdir
-p
$DATA_PATH
/android-
$dir
mount
-o
bind
$DATA_PATH
/android-
$dir
$ROOTFS_PATH
/
$dir
done
# Make sure our setup path for the container rootfs
# is present as lxc is statically configured for
# this path.
mkdir
-p
$SNAP_COMMON
/lxc
# We start the bridge here as long as a oneshot service unit is not
# possible. See snapcraft.yaml for further details.
$SNAP
/bin/anbox-bridge.sh start
$SNAP
/usr/sbin/aa-exec
-p
unconfined
--
$SNAP
/bin/anbox-wrapper.sh container-manager
pid
=
$!
waitpid
$pid
$SNAP
/bin/anbox-bridge.sh stop
umount
$ROOTFS_PATH
/system
umount
$ROOTFS_PATH
/data
start
()
{
# Extract ramdisk content instead of trying to bind mount the
# cpio image file to allow modifications.
rm
-Rf
$RAMDISK_PATH
mkdir
-p
$RAMDISK_PATH
cd
$RAMDISK_PATH
cat
$INITRD
|
gzip
-d
| cpio
-i
# FIXME those things should be fixed in the build process
chmod
+x
$RAMDISK_PATH
/anbox-init.sh
# Setup the read-only rootfs
mkdir
-p
$ROOTFS_PATH
mount
-o
bind
,ro
$RAMDISK_PATH
$ROOTFS_PATH
mount
-o
loop,ro
$SYSTEM_IMG
$ROOTFS_PATH
/system
# but certain top-level directories need to be in a writable space
for
dir
in
cache data
;
do
mkdir
-p
$DATA_PATH
/android-
$dir
mount
-o
bind
$DATA_PATH
/android-
$dir
$ROOTFS_PATH
/
$dir
done
# Make sure our setup path for the container rootfs
# is present as lxc is statically configured for
# this path.
mkdir
-p
$SNAP_COMMON
/lxc
# We start the bridge here as long as a oneshot service unit is not
# possible. See snapcraft.yaml for further details.
$SNAP
/bin/anbox-bridge.sh start
exec
$SNAP
/usr/sbin/aa-exec
-p
unconfined
--
$SNAP
/bin/anbox-wrapper.sh container-manager
}
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
}
case
"
$1
"
in
start
)
start
;;
stop
)
stop
;;
*
)
echo
"ERROR: Unknown command '
$1
'"
exit
1
;;
esac
snapcraft.yaml
浏览文件 @
357b1a58
...
...
@@ -12,7 +12,8 @@ apps:
anbox
:
command
:
bin/anbox-wrapper.sh
container-manager
:
command
:
bin/container-manager.sh
command
:
bin/container-manager.sh start
stop-command
:
bin/container-manager.sh stop
daemon
:
simple
# 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.
...
...
src/anbox/bridge/android_api_stub.cpp
浏览文件 @
357b1a58
...
...
@@ -121,8 +121,6 @@ void AndroidApiStub::remove_task(const std::int32_t &id) {
auto
c
=
std
::
make_shared
<
Request
<
protobuf
::
rpc
::
Void
>>
();
DEBUG
(
""
);
protobuf
::
bridge
::
RemoveTask
message
;
message
.
set_id
(
id
);
...
...
src/anbox/container/lxc_container.cpp
浏览文件 @
357b1a58
...
...
@@ -80,10 +80,6 @@ void LxcContainer::start(const Configuration &configuration) {
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
// in the end
set_config_item
(
"lxc.mount.auto"
,
"proc:mixed sys:mixed cgroup:mixed"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录