fix: typos in /boot replacement logic
This commit is contained in:
parent
874ae88db3
commit
e439c02a0a
2 changed files with 5 additions and 3 deletions
|
|
@ -37,7 +37,7 @@ class RootFS:
|
||||||
**kwargs: Keyword arguments list for subprocess.run().
|
**kwargs: Keyword arguments list for subprocess.run().
|
||||||
"""
|
"""
|
||||||
|
|
||||||
for dir in ("sys, proc", "dev"):
|
for dir in ("sys", "proc", "dev"):
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
["mount", "--bind", f"/{dir}", os.path.join(self.rootfs_path, dir)]
|
["mount", "--bind", f"/{dir}", os.path.join(self.rootfs_path, dir)]
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,9 @@ def update_cleanup() -> None:
|
||||||
for path in (
|
for path in (
|
||||||
"/etc/grub.d",
|
"/etc/grub.d",
|
||||||
"/etc/default/grub",
|
"/etc/default/grub",
|
||||||
"/var/cache/akshara/rootfs/dev",
|
"/var/cache/akshara/rootfs/sys",
|
||||||
"/var/cache/akshara/rootfs/proc",
|
"/var/cache/akshara/rootfs/proc",
|
||||||
|
"/var/cache/akshara/rootfs/dev",
|
||||||
"/var/cache/akshara/rootfs/var/cache/blendOS",
|
"/var/cache/akshara/rootfs/var/cache/blendOS",
|
||||||
):
|
):
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
|
|
@ -145,6 +146,7 @@ def merge_var(new_rootfs: RootFS, overrides_keep_new: dict) -> None:
|
||||||
def handle_boot(new_rootfs, boot_config) -> None:
|
def handle_boot(new_rootfs, boot_config) -> None:
|
||||||
"""Handles /boot partition."""
|
"""Handles /boot partition."""
|
||||||
|
|
||||||
|
subprocess.run(["rm", "-rf", "/.tmp.boot"])
|
||||||
subprocess.run(["cp", "-ax", os.path.join(str(new_rootfs), "boot"), "/.tmp.boot"])
|
subprocess.run(["cp", "-ax", os.path.join(str(new_rootfs), "boot"), "/.tmp.boot"])
|
||||||
|
|
||||||
if boot_config["type"] == "bios":
|
if boot_config["type"] == "bios":
|
||||||
|
|
@ -207,7 +209,7 @@ def handle_boot(new_rootfs, boot_config) -> None:
|
||||||
# Replace /boot with /.tmp.boot
|
# Replace /boot with /.tmp.boot
|
||||||
# FIXME: should be atomic
|
# FIXME: should be atomic
|
||||||
for tmp_boot, dirs, files in os.walk("/.tmp.boot"):
|
for tmp_boot, dirs, files in os.walk("/.tmp.boot"):
|
||||||
boot = tmp_boot.replace("/tmp.boot", "/boot", 1)
|
boot = tmp_boot.replace("/.tmp.boot", "/boot", 1)
|
||||||
subprocess.run(["mkdir", "-p", boot])
|
subprocess.run(["mkdir", "-p", boot])
|
||||||
for path in dirs + files:
|
for path in dirs + files:
|
||||||
subprocess.run(["rm", "-rf", "--", os.path.join(boot, path)])
|
subprocess.run(["rm", "-rf", "--", os.path.join(boot, path)])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue