Merge pull request #2209 from lubuntu-team/lubuntu/netplan-configs
Quick vendor patch to add support for Netplan-based configs
This commit is contained in:
commit
cf9f283a8e
@ -14,6 +14,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import glob
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
import libcalamares
|
import libcalamares
|
||||||
@ -131,6 +132,21 @@ def run():
|
|||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# Also install netplan files
|
||||||
|
source_netplan = "/etc/netplan"
|
||||||
|
root_mount_point = libcalamares.globalstorage.value("rootMountPoint")
|
||||||
|
target_netplan = os.path.join(root_mount_point, source_netplan.lstrip('/'))
|
||||||
|
|
||||||
|
if os.path.exists(source_netplan) and os.path.exists(target_netplan):
|
||||||
|
for cfg in glob.glob(os.path.join(source_netplan, "90-NM-*")):
|
||||||
|
source_cfg = os.path.join(source_netplan, cfg)
|
||||||
|
target_cfg = os.path.join(target_netplan, os.path.basename(cfg))
|
||||||
|
|
||||||
|
if os.path.exists(target_cfg):
|
||||||
|
continue
|
||||||
|
|
||||||
|
shutil.copy(source_cfg, target_cfg)
|
||||||
|
|
||||||
# We need to overwrite the default resolv.conf in the chroot.
|
# We need to overwrite the default resolv.conf in the chroot.
|
||||||
source_resolv, target_resolv = path_pair(root_mount_point, "etc/resolv.conf")
|
source_resolv, target_resolv = path_pair(root_mount_point, "etc/resolv.conf")
|
||||||
if source_resolv != target_resolv and os.path.exists(source_resolv):
|
if source_resolv != target_resolv and os.path.exists(source_resolv):
|
||||||
|
Loading…
Reference in New Issue
Block a user