sysroot: add a set of base system files

This commit is contained in:
2026-02-21 23:21:52 +00:00
parent c476b08c03
commit cff399fdba
5 changed files with 88 additions and 7 deletions

View File

@@ -16,6 +16,24 @@ def reset():
return 0
def set_base():
if len(sys.argv) < 4:
print("USAGE: {} set-base <manifest-path> <base-directory>".format(sys.argv[0]))
return -1
manifest_path = sys.argv[2]
base_path = sys.argv[3]
manifest = Manifest(manifest_path)
manifest.load()
manifest.set_base(base_path)
manifest.save()
return 0
def add_headers():
if len(sys.argv) < 6:
print("USAGE: {} add-headers <manifest-path> <component-name> <dest-directory> <source-directory>".format(sys.argv[0]))
@@ -73,6 +91,13 @@ def build_sysroot():
manifest = Manifest(manifest_path)
manifest.load()
base_dir = manifest.get_base()
if base_dir is not None:
shutil.copytree(
base_dir,
sysroot_path,
dirs_exist_ok=True)
for n, c in manifest.get_all_components().items():
for h in c.get_headers():
header_src = h['src']
@@ -122,6 +147,7 @@ if len(sys.argv) < 2:
commands = {
'reset': reset,
'set-base': set_base,
'add-headers': add_headers,
'add-binary': add_binary,
'build-sysroot': build_sysroot,