This commit is contained in:
Marc Beninca 2024-02-17 01:35:53 +01:00
parent 778f43dadc
commit 508872059a
13 changed files with 1 additions and 4 deletions

15
rwx/cmd/__init__.py Normal file
View file

@ -0,0 +1,15 @@
commands: list[str] = []
packages: list[str] = []
def need(command: str) -> None:
match command:
case 'debootstrap':
package = 'debootstrap'
case 'mksquashfs' | 'unsquashfs':
package = 'squashfs-tools'
case _:
package = None
if package:
if package not in packages:
packages.append(package)

View file

@ -0,0 +1,14 @@
import cmd
import ps
cmd.need('mksquashfs')
def mksquashfs(input_root: str, output_file: str):
ps.run([
'mksquashfs',
input_root,
output_file,
'-comp', 'zstd',
'-Xcompression-level', str(18),
])