我正在尝试使用schroot来处理多个chroot环境,以便为特定版本的ubuntu生成干净的开发版本。主机环境为Ubuntu 16.04。
我创建了/etc/schroot/chroot.d/test.conf,配置如下:
[test]
description=ubuntu trusty
type=directory # DO NOT FORGET THIS LINE
directory=/var/chroot/test
shell=/bin/bash
groups=sudo
profile=desktop
personality=linux
preserve-environment=true
message-verbosity=verbose然后,我使用以下命令创建chroot:
sudo debootstrap --arch amd64 --variant=buildd trusty /var/chroot/test http://archive.ubuntu.com/ubuntu该命令运行良好,并且创建了chroot。然后我这样输入chroot:
schroot -c test
groups: cannot find name for group ID 1000
groups: cannot find name for group ID 108
groups: cannot find name for group ID 124
groups: cannot find name for group ID 135
groups: cannot find name for group ID 137
I have no name!@xps-dev:/$ 无论我做了什么尝试,我都无法正确地复制/etc/passwd、/etc/group、/etc/hosts之类的文件,或者使其与chrooted环境同步。在本例中,我将配置文件设置为“桌面”,这应该利用/etc/schroot/ setup中的设置信息,但我也尝试创建自己的配置文件,但没有成功。在任何情况下,桌面配置文件都会指定它应该复制或同步这些文件:
awake@xps-dev:/etc/schroot/desktop$ cat copyfiles
# Files to copy into the chroot from the host system.
#
# <source and destination>
/etc/resolv.conf
awake@xps-dev:/etc/schroot/desktop$ cat nssdatabases
# System databases to copy into the chroot from the host system.
#
# <database name>
passwd
shadow
group
gshadow
services
protocols
networks
hosts我试着从but数据库文件中删除"passwd“和"group”,将"/etc/passwd“和"/etc/group”添加到复制文件中,这样文件就可以直接复制过来,而不是同步,但不起作用。
我尝试了以下命令,以root用户身份输入chroot,并输入详细输出:
sudo schroot -v --debug=notice -c test -u root日志在这里:http://pastie.org/10947460
我在日志中看不到任何确认安装脚本已执行的内容。
很明显,我做错了什么。有谁有主意吗?
谢谢!
发布于 2016-10-23 04:11:00
我找到了问题的解决方案:如果test.conf文件中没有"type=directory“行,类型就会变成”普通“,这意味着配置文件中的安装脚本不会被调用。添加行之后,安装脚本开始被调用,现在一切都正常工作。
https://stackoverflow.com/questions/40178297
复制相似问题