Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
f51669d1
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,发现更多精彩内容 >>
提交
f51669d1
编写于
2月 07, 2017
作者:
S
Simon Fels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Drop classic scripts used for kernel module building
上级
2222eb8d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
0 addition
and
149 deletion
+0
-149
scripts/classic
scripts/classic
+0
-63
scripts/classic-create
scripts/classic-create
+0
-61
scripts/classic-reset
scripts/classic-reset
+0
-19
snapcraft.yaml
snapcraft.yaml
+0
-6
未找到文件。
scripts/classic
已删除
100755 → 0
浏览文件 @
2222eb8d
#!/bin/sh
set
-e
ROOT
=
$SNAP_COMMON
/classic
# $1: source
# $2: target
# $3: if not empty, bind mount will be read-only
# note that we do NOT clean these up at the end, as the user might start many
# classic shells in parallel; we could start all of them in their own mount
# namespace, but that would make the classic shell less useful for
# developing/debugging the snappy host
do_bindmount
()
{
if
!
mountpoint
-q
"
$ROOT
/
$2
"
;
then
if
[
-d
"
$1
"
-a
!
-L
"
$1
"
]
;
then
mkdir
-p
"
$ROOT
/
$2
"
fi
mount
--make-rprivate
--rbind
-o
rbind
"
$1
"
"
$ROOT
/
$2
"
if
[
-n
"
${
3
:-}
"
]
;
then
mount
--rbind
-o
remount,ro
"
$1
"
"
$ROOT
/
$2
"
fi
fi
}
if
[
"
$(
id
-u
)
"
!=
"0"
]
;
then
echo
"needs to run as root"
exit
1
fi
if
[
!
-d
$ROOT
]
;
then
# IMPORTANT: do not run the classic.create as this will run it with
# snap-confine again and this will cause havoc with current
# snap-confine
$SNAP
/bin/create
fi
# FIXME: confinement will prevent this
do_bindmount /home /home
do_bindmount /run /run
do_bindmount /proc /proc
do_bindmount /sys /sys
do_bindmount /dev /dev
do_bindmount / /snappy
SUDO_USER
=
root
# fix LP: #1619455
cp
-a
/var/lib/extrausers/
*
$ROOT
/var/lib/extrausers/
cp
-a
/etc/sudoers.d/
*
$ROOT
/etc/sudoers.d/
# assemble command line
DEVPTS
=
"mount -o mode=666,ptmxmode=666 -t devpts devpts /dev/pts"
SUDOCMD
=
"sudo debian_chroot=classic -u
${
SUDO_USER
}
-i
$@
"
# FIXME: workaround for https://bugs.launchpad.net/snappy/+bug/1611493
SCRIPT
=
"script --quiet --return --command
\"
$SUDOCMD
\"
/dev/null"
CMD
=
"
$DEVPTS
;
$SCRIPT
"
systemd-run
--quiet
--scope
--unit
=
classic-
$$
.scope
--description
=
"Classic shell"
chroot
"
$ROOT
"
sh
-c
"
$CMD
"
# kill leftover processes after exiting, if it's still around
systemctl stop classic-
$$
.scope 2>/dev/null
||
true
scripts/classic-create
已删除
100755 → 0
浏览文件 @
2222eb8d
#!/bin/sh
set
-eu
ROOT
=
$SNAP_COMMON
/classic
if
[
-d
$ROOT
]
;
then
echo
"classic already enabled"
exit
1
fi
if
[
$(
id
-u
)
-ne
0
]
;
then
echo
"This script needs to be called as root"
>
&2
exit
1
fi
CORE
=
""
if
[
-e
/snap/core/current
]
;
then
CORE
=
"core"
elif
[
-e
/snap/ubuntu-core/current
]
;
then
CORE
=
"ubuntu-core"
else
echo
"Cannot find core snap"
exit
1
fi
# FIXME: confinement will prevent this
echo
"Creating classic environment"
VERSION
=
"
$(
/bin/readlink /snap/
${
CORE
}
/current
)
"
SNAPROOT
=
"/var/lib/snapd/snaps/
${
CORE
}
_
${
VERSION
}
.snap"
/usr/bin/unsquashfs
-d
$ROOT
$SNAPROOT
mkdir
$ROOT
/snappy
# enable
sudo chroot
$ROOT
/var/lib/classic/enable.sh
# copy important config
for
f
in
hostname
timezone localtime
;
do
cp
-a
/etc/writable/
$f
$ROOT
/etc/writable
done
for
f
in
hosts
;
do
cp
-a
/etc/
$f
$ROOT
/etc/
done
# don't start services in the chroot on apt-get install
cat
<<
EOF
> "
$ROOT
/usr/sbin/policy-rc.d"
#!/bin/sh
while true; do
case "
\$
1" in
-*) shift ;;
makedev) exit 0;;
x11-common) exit 0;;
*) exit 101;;
esac
done
EOF
chmod
755
"
$ROOT
/usr/sbin/policy-rc.d"
# workaround bug in livecd-rootfs
chmod
1777
"
$ROOT
/tmp"
scripts/classic-reset
已删除
100755 → 0
浏览文件 @
2222eb8d
#!/bin/sh
set
-eu
ROOT
=
$SNAP_COMMON
/classic
if
[
"
$(
id
-u
)
"
!=
"0"
]
;
then
echo
"needs to run as root"
exit
1
fi
for
d
in
/home /run /proc /sys /dev /var/lib/extrausers /etc/sudoers /etc/sudoers.d /snappy
;
do
if
mountpoint
-q
"
$ROOT
/
$d
"
;
then
umount
"
$ROOT
/
$d
"
fi
done
# cleanup
rm
-rf
$ROOT
snapcraft.yaml
浏览文件 @
f51669d1
...
...
@@ -29,16 +29,10 @@ parts:
scripts/snap-wrapper.sh
:
bin/anbox-wrapper.sh
scripts/container-manager.sh
:
bin/container-manager.sh
scripts/anbox-bridge.sh
:
bin/anbox-bridge.sh
scripts/classic
:
bin/classic
scripts/classic-create
:
bin/classic-create
scripts/classic-reset
:
bin/classic-reset
snap
:
-
bin/anbox-bridge.sh
-
bin/anbox-wrapper.sh
-
bin/container-manager.sh
-
bin/classic
-
bin/classic-create
-
bin/classic-reset
apparmor
:
plugin
:
nil
stage-packages
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录