If there is no resolv.conf, create an empty file. (#423)
This commit is contained in:
parent
c536e4ea58
commit
a0ba9895c3
|
@ -34,11 +34,15 @@ def copy_resolv_conf(args, suffix="native"):
|
||||||
Use pythons super fast file compare function (due to caching)
|
Use pythons super fast file compare function (due to caching)
|
||||||
and copy the /etc/resolv.conf to the chroot, in case it is
|
and copy the /etc/resolv.conf to the chroot, in case it is
|
||||||
different from the host.
|
different from the host.
|
||||||
|
If the file doesn't exist, create an empty file with 'touch'.
|
||||||
"""
|
"""
|
||||||
host = "/etc/resolv.conf"
|
host = "/etc/resolv.conf"
|
||||||
chroot = args.work + "/chroot_" + suffix + host
|
chroot = args.work + "/chroot_" + suffix + host
|
||||||
|
if os.path.exists(host):
|
||||||
if not os.path.exists(chroot) or not filecmp.cmp(host, chroot):
|
if not os.path.exists(chroot) or not filecmp.cmp(host, chroot):
|
||||||
pmb.helpers.run.root(args, ["cp", host, chroot])
|
pmb.helpers.run.root(args, ["cp", host, chroot])
|
||||||
|
else:
|
||||||
|
pmb.helpers.run.root(args, ["touch", chroot])
|
||||||
|
|
||||||
|
|
||||||
def init(args, suffix="native"):
|
def init(args, suffix="native"):
|
||||||
|
|
Loading…
Reference in New Issue