replace ISO extraction with xorriso-implementation
bsdtar is no longer required as a dependency
This commit is contained in:
@@ -13,15 +13,15 @@ import subprocess
|
|||||||
|
|
||||||
|
|
||||||
def extract_iso(path_to_output_dir, path_to_input_file):
|
def extract_iso(path_to_output_dir, path_to_input_file):
|
||||||
"""Extracts the input ISO-file into the specified directory using 'bsdtar'.
|
"""Extracts the contents of the ISO-file into the specified directory.
|
||||||
|
|
||||||
Source: https://wiki.debian.org/DebianInstaller/Preseed/EditIso#Extracting_the_Initrd_from_an_ISO_Image
|
Source: https://wiki.debian.org/DebianInstaller/Preseed/EditIso#Extracting_the_Initrd_from_an_ISO_Image
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
path_to_output_dir : str or pathlike object
|
path_to_output_dir : str or pathlike object
|
||||||
Path to the directory into which the contents of the archive will be
|
Path to the directory into which the contents of the ISO archive will
|
||||||
extracted.
|
be extracted.
|
||||||
path_to_input_file : str or pathlike object
|
path_to_input_file : str or pathlike object
|
||||||
Path to the file/archive which should be extracted.
|
Path to the file/archive which should be extracted.
|
||||||
|
|
||||||
@@ -51,18 +51,16 @@ def extract_iso(path_to_output_dir, path_to_input_file):
|
|||||||
try:
|
try:
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
[
|
||||||
"bsdtar",
|
"xorriso",
|
||||||
"-C",
|
"-osirrox", "on"
|
||||||
str(path_to_output_dir),
|
"-indev", path_to_input_file.resolve(),
|
||||||
"-xf",
|
"-extract", "/",
|
||||||
str(path_to_input_file)
|
path_to_output_dir.resolve()
|
||||||
],
|
],
|
||||||
check=True
|
check=True)
|
||||||
)
|
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
f"An error occurred while extracting '{path_to_input_file}'."
|
f"An error occurred while extracting '{path_to_input_file}'.")
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def append_file_contents_to_initrd_archive(path_to_initrd_archive,
|
def append_file_contents_to_initrd_archive(path_to_initrd_archive,
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ def _assert_system_dependencies_installed():
|
|||||||
# contains the names of all unix program dependencies which must be
|
# contains the names of all unix program dependencies which must be
|
||||||
# installed on the local system and available in the local system's $PATH
|
# installed on the local system and available in the local system's $PATH
|
||||||
system_programs_required = [
|
system_programs_required = [
|
||||||
"bsdtar",
|
|
||||||
"chmod",
|
"chmod",
|
||||||
"cpio",
|
"cpio",
|
||||||
"dd",
|
"dd",
|
||||||
|
|||||||
Reference in New Issue
Block a user