FDS/OS 1.0

This commit is contained in:
2026-09-21 22:29:23 +08:00
commit 99bc3d15c5
430 changed files with 34876 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env python3
"""Apply the FDS-owned layout to a new, empty image staging directory."""
import json
import pathlib
import sys
root = pathlib.Path(sys.argv[1])
layout = json.loads(pathlib.Path(sys.argv[2]).read_text())
if any(root.iterdir()):
sys.exit("ERROR: layout must be applied to an empty root")
for path, mode in layout["directories"].items():
target = root / path
target.mkdir(parents=True, exist_ok=True)
target.chmod(int(mode, 8))
for path, target in layout["symlinks"].items():
(root / path).symlink_to(target)