mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 01:45:36 -04:00
[manchineid] proper cleanup
This commit is contained in:
parent
24c0da3fb1
commit
ca9f4bc053
1 changed files with 6 additions and 7 deletions
|
@ -34,19 +34,18 @@ def run():
|
||||||
enable_dbus = libcalamares.job.configuration["dbus"]
|
enable_dbus = libcalamares.job.configuration["dbus"]
|
||||||
enable_symlink = libcalamares.job.configuration["symlink"]
|
enable_symlink = libcalamares.job.configuration["symlink"]
|
||||||
target_systemd_machineid_file = "{}/etc/machine-id".format(root_mount_point)
|
target_systemd_machineid_file = "{}/etc/machine-id".format(root_mount_point)
|
||||||
|
target_dbus_machineid_file = "{}/var/lib/dbus/machine-id".format(root_mount_point)
|
||||||
|
|
||||||
if os.path.exists(target_systemd_machineid_file):
|
if enable_systemd or enable_dbus:
|
||||||
os.remove(target_systemd_machineid_file)
|
|
||||||
|
|
||||||
if os.path.exists(target_dbus_machineid_file):
|
if os.path.exists(target_dbus_machineid_file):
|
||||||
os.remove(target_dbus_machineid_file)
|
os.remove(target_dbus_machineid_file)
|
||||||
|
|
||||||
if enable_systemd:
|
if enable_systemd:
|
||||||
|
if os.path.exists(target_systemd_machineid_file):
|
||||||
|
os.remove(target_systemd_machineid_file)
|
||||||
check_target_env_call("systemd-machine-id-setup")
|
check_target_env_call("systemd-machine-id-setup")
|
||||||
|
|
||||||
if enable_dbus:
|
if enable_dbus:
|
||||||
target_dbus_machineid_file = "{}/var/lib/dbus/machine-id".format(root_mount_point)
|
|
||||||
|
|
||||||
if enable_symlink and os.path.exists(target_systemd_machineid_file):
|
if enable_symlink and os.path.exists(target_systemd_machineid_file):
|
||||||
check_target_env_call(["ln", "-s", "/etc/machine-id", "/var/lib/dbus/machine-id"])
|
check_target_env_call(["ln", "-s", "/etc/machine-id", "/var/lib/dbus/machine-id"])
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue