stages/fstab: add a stage to specify the fstab to be installed
This will allow us to boot in 'ro' mode, and remount later on. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
8398be54a4
commit
17d562e75f
1 changed files with 25 additions and 0 deletions
25
stages/org.osbuild.fstab
Executable file
25
stages/org.osbuild.fstab
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import json
|
||||
import sys
|
||||
|
||||
|
||||
def main(tree, options):
|
||||
filesystems = options["filesystems"]
|
||||
|
||||
with open(f"{tree}/etc/fstab", "w") as f:
|
||||
for filesystem in filesystems:
|
||||
uuid = filesystem["uuid"]
|
||||
path = filesystem["path"]
|
||||
vfs_type = filesystem.get("vfs_type", "none")
|
||||
options = filesystem.get("options", "defaults")
|
||||
freq = filesystem.get("freq", "0")
|
||||
passno = filesystem.get("passno", "0")
|
||||
|
||||
f.write(f"UUID={uuid}\t{path}\t{vfs_type}\t{options}\t{freq}\t{passno}\n")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = json.load(sys.stdin)
|
||||
r = main(args["tree"], args["options"])
|
||||
sys.exit(r)
|
||||
Loading…
Add table
Add a link
Reference in a new issue