fix: SemiOS DNS Config is not copied
Signed-off-by: sisungo <[email protected]>
This commit is contained in:
1 parent
c18fc3447f
commit
b8e7ab1d5b
1 file changed
+11
-1
+11
-1
@@ -59,8 +59,18 @@ def _prepare_build_env_base_files(root: str):
|
||||
os.makedirs(f"{root}/home/root")
|
||||
|
||||
# Copy DNS config
|
||||
os.makedirs(f"{root}/var/config/network", exist_ok=True)
|
||||
os.makedirs(f"{root}/etc", exist_ok=True)
|
||||
shutil.copy2("/etc/resolv.conf", f"{root}/etc/resolv.conf")
|
||||
if os.path.exists("/var/config/network/resolv.conf"):
|
||||
source = "/var/config/network/resolv.conf"
|
||||
elif os.path.exists("/etc/resolv.conf"):
|
||||
source = "/etc/resolv.conf"
|
||||
else:
|
||||
print("warning: no resolv.conf found, networking may be unavailable")
|
||||
source = None
|
||||
if source:
|
||||
shutil.copy2(source, f"{root}/etc/resolv.conf")
|
||||
shutil.copy2(source, f"{root}/var/config/network/resolv.conf")
|
||||
|
||||
# For atom build environments, we simply use a link to be usr-shebang-compatible to avoid problems
|
||||
os.mkdir(f"{root}/usr")
|
||||
|
||||
Reference in new issue
Block a user