erofs: Add ability to set the cluster size
`cluster-size` sets the maximum size of compress physical cluster size in bytes.
This commit is contained in:
parent
1ab098fbf9
commit
902c4f7d71
3 changed files with 12 additions and 3 deletions
|
|
@ -21,9 +21,13 @@ def main(inputs, output_dir, options):
|
||||||
method += f",{compression['level']}"
|
method += f",{compression['level']}"
|
||||||
cmd += ["-z", method]
|
cmd += ["-z", method]
|
||||||
|
|
||||||
options = options.get("options")
|
erofs_options = options.get("options")
|
||||||
if options:
|
if erofs_options:
|
||||||
cmd += ["-E", ",".join(options)]
|
cmd += ["-E", ",".join(erofs_options)]
|
||||||
|
|
||||||
|
cluster_size = options.get("cluster-size")
|
||||||
|
if cluster_size:
|
||||||
|
cmd += ["-C", f"{cluster_size}"]
|
||||||
|
|
||||||
subprocess.run(cmd, check=True)
|
subprocess.run(cmd, check=True)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"cluster-size": {
|
||||||
|
"description": "Maximum size of the compress physical cluster in bytes",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"description": "Extended options for the filesystem, see mkfs.erofs(1)",
|
"description": "Extended options for the filesystem, see mkfs.erofs(1)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ TEST_INPUT = [
|
||||||
({"compression": {"method": "lz4hc", "level": 9}}, ["-z", "lz4hc,9"]),
|
({"compression": {"method": "lz4hc", "level": 9}}, ["-z", "lz4hc,9"]),
|
||||||
({"options": ["dedupe"]}, ["-E", "dedupe"]),
|
({"options": ["dedupe"]}, ["-E", "dedupe"]),
|
||||||
({"options": ["all-fragments", "force-inode-compact"]}, ["-E", "all-fragments,force-inode-compact"]),
|
({"options": ["all-fragments", "force-inode-compact"]}, ["-E", "all-fragments,force-inode-compact"]),
|
||||||
|
({"cluster-size": 131072, "options": ["dedupe"]}, ["-E", "dedupe", "-C", "131072"]),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue