osbuild: drop the concept of an input_dir
This removes the possibility of passing in arbitrary input data. We now restrict ourselves to explicitly specified files/directories or a base tree given by its pipeline id. This drops the tar/tree stages/assemblers, as the tree/untree ones are implicit in osbuild, and if we wish to also support compressed trees, then we should add that to osbuild core as an option. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
ffffb87dea
commit
cebed27cd9
9 changed files with 10 additions and 96 deletions
|
|
@ -43,7 +43,7 @@ def loop_device(image, size, offset=0):
|
|||
finally:
|
||||
subprocess.run(["losetup", "-d", loop], check=True)
|
||||
|
||||
def main(tree, input_dir, output_dir, options):
|
||||
def main(tree, output_dir, options):
|
||||
filename = options["filename"]
|
||||
partition_table_id = options["partition_table_id"]
|
||||
root_fs_uuid = options["root_fs_uuid"]
|
||||
|
|
@ -78,5 +78,5 @@ def main(tree, input_dir, output_dir, options):
|
|||
|
||||
if __name__ == '__main__':
|
||||
args = json.load(sys.stdin)
|
||||
r = main(args["tree"], args["input_dir"], args["output_dir"], args["options"])
|
||||
r = main(args["tree"], args["output_dir"], args["options"])
|
||||
sys.exit(r)
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
def main(tree, output_dir, options):
|
||||
filename = options["filename"]
|
||||
|
||||
subprocess.run(["tar", "-czf", f"{output_dir}/{filename}", "-C", tree, "."], stdout=subprocess.DEVNULL, check=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = json.load(sys.stdin)
|
||||
r = main(args["tree"], args["output_dir"], args["options"])
|
||||
sys.exit(r)
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
def main(tree, output_dir, options):
|
||||
output_tree = os.path.join(output_dir, options["tree"])
|
||||
|
||||
shutil.rmtree(output_tree, ignore_errors=True)
|
||||
os.makedirs(output_tree, mode=0o755)
|
||||
|
||||
# Copy the tree to the output directory
|
||||
subprocess.run(["cp", "-a", f"{tree}/.", output_tree], check=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = json.load(sys.stdin)
|
||||
r = main(args["tree"], args["output_dir"], args["options"])
|
||||
sys.exit(r)
|
||||
Loading…
Add table
Add a link
Reference in a new issue