This commit is contained in:
Marc Beninca 2024-02-16 21:11:28 +01:00
parent 07a596711d
commit ba03b50992
3 changed files with 39 additions and 0 deletions

15
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,10 @@
from ... import cmd
from ... import ps
cmd.need('debootstrap')
def debootstrap(input_mirror: str, output_root: str):
ps.run([
'debootstrap',
])

14
cmd/squashfs/__init__.py Normal file
View file

@ -0,0 +1,14 @@
from ... import cmd
from ... 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),
])