mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 19:39:51 +03:00
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 <kcxt@postmarketos.org>
This commit is contained in:
parent
806231b257
commit
0e63155eef
1 changed files with 2 additions and 5 deletions
|
@ -750,8 +750,7 @@ def create_crypttab(args: PmbArgs, layout: PartitionLayout, disk: Path, chroot:
|
||||||
luks_uuid = layout.root.uuid
|
luks_uuid = layout.root.uuid
|
||||||
crypttab = f"root UUID={luks_uuid} none luks\n"
|
crypttab = f"root UUID={luks_uuid} none luks\n"
|
||||||
|
|
||||||
(chroot / "tmp/crypttab").open("w").write(crypttab)
|
(chroot / "etc/crypttab").open("w").write(crypttab)
|
||||||
pmb.chroot.root(["mv", "/tmp/crypttab", "/etc/crypttab"], chroot)
|
|
||||||
|
|
||||||
|
|
||||||
def create_fstab(args: PmbArgs, layout: PartitionLayout, disk: Path, chroot: Chroot) -> None:
|
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"
|
boot_options += ",umask=0077,nosymfollow,codepage=437,iocharset=ascii"
|
||||||
fstab += f"{boot_mount_point} /boot {boot_filesystem} {boot_options} 0 0\n"
|
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)
|
f.write(fstab)
|
||||||
print(fstab)
|
|
||||||
pmb.chroot.root(["mv", "/tmp/fstab", "/etc/fstab"], chroot)
|
|
||||||
|
|
||||||
|
|
||||||
def get_root_filesystem(args: PmbArgs) -> str:
|
def get_root_filesystem(args: PmbArgs) -> str:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue