fix: execute after-stages commands as host
This commit is contained in:
parent
8f5e52db05
commit
b53795bddb
1 changed files with 7 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import json
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from classes.rootfs import RootFS
|
||||
|
||||
|
|
@ -34,7 +35,12 @@ def gen_rootfs(system_config: dict, rootfs_path: str) -> RootFS:
|
|||
run_script_rootfs(rootfs, modules[stage["module"]], inputs)
|
||||
|
||||
if isinstance(system_config["distro-config"].get("after-stages"), str):
|
||||
run_script_rootfs(rootfs, system_config["distro-config"]["after-stages"], [])
|
||||
subprocess.run(
|
||||
["bash", "-s"],
|
||||
text=True,
|
||||
input=system_config["distro-config"]["after-stages"],
|
||||
cwd=str(rootfs_path),
|
||||
)
|
||||
|
||||
with open(os.path.join(rootfs_path, "usr/system.json"), "w") as system_json_file:
|
||||
json.dump(system_config, system_json_file, ensure_ascii=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue