forked from josch/mmdebstrap
Do not copy /etc/resolv.conf or /etc/hostname if the host system doesn't have them
This commit is contained in:
parent
3dc32b81b0
commit
3d3d3fe12d
1 changed files with 10 additions and 2 deletions
12
mmdebstrap
12
mmdebstrap
|
@ -1103,8 +1103,16 @@ sub setup {
|
||||||
}
|
}
|
||||||
|
|
||||||
# allow network access from within
|
# allow network access from within
|
||||||
copy("/etc/resolv.conf", "$options->{root}/etc/resolv.conf") or error "cannot copy /etc/resolv.conf: $!";
|
if (-e "/etc/resolv.conf") {
|
||||||
copy("/etc/hostname", "$options->{root}/etc/hostname") or error "cannot copy /etc/hostname: $!";
|
copy("/etc/resolv.conf", "$options->{root}/etc/resolv.conf") or error "cannot copy /etc/resolv.conf: $!";
|
||||||
|
} else {
|
||||||
|
warning("Host system does not have a /etc/resolv.conf to copy into the rootfs.")
|
||||||
|
}
|
||||||
|
if (-e "/etc/hostname") {
|
||||||
|
copy("/etc/hostname", "$options->{root}/etc/hostname") or error "cannot copy /etc/hostname: $!";
|
||||||
|
} else {
|
||||||
|
warning("Host system does not have a /etc/hostname to copy into the rootfs.")
|
||||||
|
}
|
||||||
|
|
||||||
if ($options->{havemknod}) {
|
if ($options->{havemknod}) {
|
||||||
foreach my $file (@devfiles) {
|
foreach my $file (@devfiles) {
|
||||||
|
|
Loading…
Reference in a new issue