Commit 2a469628 authored by Simon McVittie's avatar Simon McVittie
Browse files

tests/manual/ Bind-mount in some more host files

These are the same ones special-cased by Flatpak, although Flatpak
would generate a minimal /etc/passwd and /etc/group rather than using
the ones from the host system.

Signed-off-by: Simon McVittie's avatarSimon McVittie <>
parent 5318d2ed
......@@ -885,8 +885,13 @@ foreach my $mutable (qw(/etc /var)) {
while (defined(my $member = readdir $dir)) {
next if $member eq '.' || $member eq '..';
next if "$mutable/$member" eq '/etc/group';
next if "$mutable/$member" eq '/etc/host.conf';
next if "$mutable/$member" eq '/etc/hosts';
next if "$mutable/$member" eq '/etc/localtime';
next if "$mutable/$member" eq '/etc/machine-id';
next if "$mutable/$member" eq '/etc/passwd';
next if "$mutable/$member" eq '/etc/resolv.conf';
no autodie 'readlink';
my $target = readlink "$container_tree$mutable/$member";
......@@ -912,7 +917,23 @@ elsif (-e '/var/lib/dbus/machine-id') {
push @bwrap, '--symlink', '/etc/machine-id', '/var/lib/dbus/machine-id';
push @bwrap, '--ro-bind', '/etc/passwd', '/etc/passwd';
if (-e '/etc/localtime') {
no autodie 'readlink';
my $target = readlink '/etc/localtime';
if (defined $target && $target =~ m{^/usr/}) {
push @bwrap, '--symlink', $target, '/etc/localtime';
else {
push @bwrap, '--ro-bind', '/etc/localtime', '/etc/localtime';
foreach my $file (qw(resolv.conf host.conf hosts passwd group)) {
if (-e "/etc/$file") {
push @bwrap, '--ro-bind', "/etc/$file", "/etc/$file";
push @bwrap, bind_usr($container_tree);
push @bwrap, bind_usr($gl_provider_tree, '/gl-provider');
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment