From 70c14684535c1f4d00e99b901f6f36f25ad52959 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Tue, 23 Oct 2018 16:03:32 +0200 Subject: [PATCH] in fakechroot mode, do not create symlinks to non-existing /proc --- mmdebstrap | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mmdebstrap b/mmdebstrap index 96d17df..9a3bb2a 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -698,6 +698,10 @@ sub setup { } elsif ($type == 1) { # hardlink die "type 1 not implemented"; } elsif ($type == 2) { # symlink + if ($options->{mode} eq 'fakechroot' and $linkname =~ /^\/proc/) { + # there is no /proc in fakechroot mode + next; + } symlink $linkname, "$options->{root}/$fname" or die "cannot create symlink $fname"; next; # chmod cannot work on symlinks } elsif ($type == 3) { # character special @@ -1110,6 +1114,10 @@ sub setup { die "type 1 not implemented"; } elsif ($type == 2) { # symlink if (!$options->{havemknod}) { + if ($options->{mode} eq 'fakechroot' and $linkname =~ /^\/proc/) { + # there is no /proc in fakechroot mode + next; + } symlink $linkname, "$options->{root}/$fname" or die "cannot create symlink $fname"; } } elsif ($type == 3 or $type == 4) { # character/block special @@ -1179,6 +1187,10 @@ sub setup { die "type 1 not implemented"; } elsif ($type == 2) { # symlink if (!$options->{havemknod}) { + if ($options->{mode} eq 'fakechroot' and $linkname =~ /^\/proc/) { + # there is no /proc in fakechroot mode + next; + } unlink "$options->{root}/$fname" or die "cannot unlink $fname: $!"; } } elsif ($type == 3 or $type == 4) { # character/block special