Skip to content

Commit

Permalink
Make rootfs readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
anodos325 committed Sep 22, 2023
1 parent 0785669 commit 5ad3ad1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions truenas_install/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,9 @@ def main():
run_command(["zfs", "set", f"mountpoint={mp}", this_ds])
run_command(["zfs", "set", 'org.zectl:bootloader=""', this_ds])

run_command(["zfs", "set", "readonly=on", dataset_name])
run_command(["zfs", "snapshot", f"{dataset_name}@pristine"])

except Exception:
if old_bootfs_prop != "-":
run_command(["zpool", "set", f"bootfs={old_bootfs_prop}", pool_name])
Expand Down
5 changes: 5 additions & 0 deletions truenas_install/fhs.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@
},
{
'name': 'opt',
'options': ['NOSUID', 'NOACL', 'RO'],
'snap': True
},
{
'name': 'root',
'options': ['NOSUID', 'NOACL'],
'snap': True
},
Expand Down

0 comments on commit 5ad3ad1

Please sign in to comment.