rwx/rwx/deb/__init__.py
2024-09-17 22:08:14 +02:00

31 lines
728 B
Python

"""Wrap Debian commands."""
from pathlib import Path
from rwx import cmd, ps
cmd.need("debootstrap")
BOOTSTRAP_ARCHITECTURE = "amd64"
BOOTSTRAP_VARIANT = "minbase"
def bootstrap(root_path: Path, suite: str, mirror_location: str) -> None:
"""Boostrap a base operating filesystem.
:param root_path: target output path
:type root_path: Path
:param suite: target distribution name
:type suite: str
:param mirror_location: source input repository
:type mirror_location: str
"""
command = (
"debootstrap",
("--arch", BOOTSTRAP_ARCHITECTURE),
("--variant", BOOTSTRAP_VARIANT),
suite,
str(root_path),
mirror_location,
)
ps.run(*command)