fix: typos in /boot replacement logic

This commit is contained in:
Rudra Saraswat 2026-04-03 22:42:22 +01:00
parent 874ae88db3
commit e439c02a0a
2 changed files with 5 additions and 3 deletions

View file

@ -37,7 +37,7 @@ class RootFS:
**kwargs: Keyword arguments list for subprocess.run().
"""
for dir in ("sys, proc", "dev"):
for dir in ("sys", "proc", "dev"):
subprocess.run(
["mount", "--bind", f"/{dir}", os.path.join(self.rootfs_path, dir)]
)

View file

@ -18,8 +18,9 @@ def update_cleanup() -> None:
for path in (
"/etc/grub.d",
"/etc/default/grub",
"/var/cache/akshara/rootfs/dev",
"/var/cache/akshara/rootfs/sys",
"/var/cache/akshara/rootfs/proc",
"/var/cache/akshara/rootfs/dev",
"/var/cache/akshara/rootfs/var/cache/blendOS",
):
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:
"""Handles /boot partition."""
subprocess.run(["rm", "-rf", "/.tmp.boot"])
subprocess.run(["cp", "-ax", os.path.join(str(new_rootfs), "boot"), "/.tmp.boot"])
if boot_config["type"] == "bios":
@ -207,7 +209,7 @@ def handle_boot(new_rootfs, boot_config) -> None:
# Replace /boot with /.tmp.boot
# FIXME: should be atomic
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])
for path in dirs + files:
subprocess.run(["rm", "-rf", "--", os.path.join(boot, path)])