Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
6860338c
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,发现更多精彩内容 >>
提交
6860338c
编写于
12月 05, 2016
作者:
S
Simon Fels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use disk images instead of a rootfs tarball
上级
0c4668d0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
40 deletion
+40
-40
scripts/anbox-init.sh
scripts/anbox-init.sh
+0
-28
scripts/container-manager.sh
scripts/container-manager.sh
+37
-10
snapcraft.yaml
snapcraft.yaml
+3
-2
未找到文件。
scripts/anbox-init.sh
浏览文件 @
6860338c
...
...
@@ -23,34 +23,6 @@ function prepare_filesystem() {
chown
system:system /dev/
$f
chmod
0666 /dev/
$f
done
if
[
!
-e
/.anbox_setup_done
]
;
then
echo
"Fixing up all permissions ..."
# Fixup permissions of the android binaries in /system
while
read
line
do
file
=
`
echo
$line
|
cut
-d
' '
-f
1
`
user
=
`
echo
$line
|
cut
-d
' '
-f
2
`
group
=
`
echo
$line
|
cut
-d
' '
-f
3
`
mode
=
`
echo
$line
|
cut
-d
' '
-f
4
`
# Avoid changing symlinks
if
[
!
-h
/
$file
]
;
then
chmod
$mode
/
$file
chown
-h
$user
:
$group
/
$file
fi
done
<
"/filesystem_config.txt"
# Additional ones not listed in the config generated from the build
for
f
in
qemu_pipe qemu_trace goldfish_pipe
;
do
[
!
-e
/dev/
$f
]
&&
continue
chown
system:system /dev/
$f
chmod
0666 /dev/
$f
done
echo
"Setup done!"
echo
$VERSION
>
/.anbox_setup_done
fi
}
prepare_filesystem &
...
...
scripts/container-manager.sh
浏览文件 @
6860338c
...
...
@@ -5,18 +5,42 @@
# Other than that nothing should ever modify the content of the
# rootfs.
ROOTFS_PATH
=
$SNAP_COMMON
/var/lib/anbox/rootfs
ROOTFS_VERSION
=
1
if
[
!
-e
$ROOTFS_PATH
]
||
[
"
$ROOTFS_VERSION
"
!=
"
$(
cat
$ROOTFS_PATH
/.version
)
"
]
;
then
rm
-rf
$ROOTFS_PATH
echo
"Copying rootfs into
$ROOTFS_PATH
.."
mkdir
-p
$ROOTFS_PATH
tar
xf
$SNAP
/android-rootfs.tar
-C
$ROOTFS_PATH
/
--strip-components
=
1
chown
-R
root:root
$ROOTFS_PATH
echo
$ROOTFS_VERSION
>
$ROOTFS_PATH
/.version
DATA_PATH
=
$SNAP_COMMON
/var/lib/anbox
ROOTFS_PATH
=
$DATA_PATH
/rootfs
RAMDISK_PATH
=
$DATA_PATH
/ramdisk
INITRD
=
$SNAP
/ramdisk.img
SYSTEM_IMG
=
$SNAP
/system.img
ANDROID_DATA_PATH
=
$DATA_PATH
/android-data
if
[
!
-e
$INITRD
]
;
then
echo
"ERROR: boot ramdisk does not exist"
exit
1
fi
if
[
!
-e
$SYSTEM_IMG
]
;
then
echo
"ERROR: system image does not exist"
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 we keep /data in the read/write space
mkdir
-p
$ANDROID_DATA_PATH
mount
-o
bind
$ANDROID_DATA_PATH
$ROOTFS_PATH
/data
# Make sure our setup path for the container rootfs
# is present as lxc is statically configured for
# this path.
...
...
@@ -31,3 +55,6 @@ pid=$!
waitpid
$pid
$SNAP
/bin/anbox-bridge.sh stop
umount
$ROOTFS_PATH
/system
umount
$ROOTFS_PATH
/data
snapcraft.yaml
浏览文件 @
6860338c
...
...
@@ -22,11 +22,12 @@ apps:
# daemon: oneshot
parts
:
android
-rootfs
:
android
:
plugin
:
copy
source
:
.
files
:
android-rootfs.tar
:
android-rootfs.tar
system.img
:
system.img
ramdisk.img
:
ramdisk.img
anbox-common
:
plugin
:
copy
source
:
.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录