From 0e63155eef69a8cd00ed0fab6e21e77a3fd098ae Mon Sep 17 00:00:00 2001 From: Casey Connolly Date: Fri, 30 May 2025 17:21:54 +0200 Subject: [PATCH] install: write fstab/crypttab directly We are root, no need to juggle files around. Just write directly to /etc/fstab and /etc/crypttab. Signed-off-by: Casey Connolly --- pmb/install/_install.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index dfea8fc4..341425b0 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -750,8 +750,7 @@ def create_crypttab(args: PmbArgs, layout: PartitionLayout, disk: Path, chroot: luks_uuid = layout.root.uuid crypttab = f"root UUID={luks_uuid} none luks\n" - (chroot / "tmp/crypttab").open("w").write(crypttab) - pmb.chroot.root(["mv", "/tmp/crypttab", "/etc/crypttab"], chroot) + (chroot / "etc/crypttab").open("w").write(crypttab) def create_fstab(args: PmbArgs, layout: PartitionLayout, disk: Path, chroot: Chroot) -> None: @@ -782,10 +781,8 @@ def create_fstab(args: PmbArgs, layout: PartitionLayout, disk: Path, chroot: Chr boot_options += ",umask=0077,nosymfollow,codepage=437,iocharset=ascii" fstab += f"{boot_mount_point} /boot {boot_filesystem} {boot_options} 0 0\n" - with (chroot / "tmp/fstab").open("w") as f: + with (chroot / "etc/fstab").open("w") as f: f.write(fstab) - print(fstab) - pmb.chroot.root(["mv", "/tmp/fstab", "/etc/fstab"], chroot) def get_root_filesystem(args: PmbArgs) -> str: