Allow ISO-Level configuration within the config file

In order to enable this feature set "iso_level=<Value from 1 to 4>"
in config file

Jira: RHELCMP-6880

Signed-off-by: Ozan Unsal <ounsal@redhat.com>
This commit is contained in:
Ozan Unsal 2021-10-08 15:53:27 +02:00
parent ac061b2ea8
commit 7475d2a3a9
6 changed files with 16 additions and 0 deletions

View File

@ -1267,6 +1267,9 @@ Options
meaning size in bytes, or it can be a string with ``k``, ``M``, ``G`` meaning size in bytes, or it can be a string with ``k``, ``M``, ``G``
suffix (using multiples of 1024). suffix (using multiples of 1024).
**iso_level**
(*int*) [optional] -- Set the ISO9660 conformance level. Valid numbers are 1 to 4.
**split_iso_reserve** = 10MiB **split_iso_reserve** = 10MiB
(*int|str*) -- how much free space should be left on each disk. The format (*int|str*) -- how much free space should be left on each disk. The format
is the same as for ``iso_size`` option. is the same as for ``iso_size`` option.

View File

@ -746,6 +746,10 @@ def make_schema():
), ),
"createiso_break_hardlinks": {"type": "boolean", "default": False}, "createiso_break_hardlinks": {"type": "boolean", "default": False},
"createiso_use_xorrisofs": {"type": "boolean", "default": False}, "createiso_use_xorrisofs": {"type": "boolean", "default": False},
"iso_level": {
"type": "number",
"enum": [1, 2, 3, 4],
},
"iso_hfs_ppc64le_compatible": {"type": "boolean", "default": True}, "iso_hfs_ppc64le_compatible": {"type": "boolean", "default": True},
"multilib": _variant_arch_mapping( "multilib": _variant_arch_mapping(
{"$ref": "#/definitions/list_of_strings"} {"$ref": "#/definitions/list_of_strings"}

View File

@ -25,6 +25,7 @@ CreateIsoOpts = namedtuple(
"os_tree", "os_tree",
"hfs_compat", "hfs_compat",
"use_xorrisofs", "use_xorrisofs",
"iso_level",
], ],
) )
CreateIsoOpts.__new__.__defaults__ = (None,) * len(CreateIsoOpts._fields) CreateIsoOpts.__new__.__defaults__ = (None,) * len(CreateIsoOpts._fields)
@ -77,6 +78,7 @@ def make_image(f, opts):
exclude=["./lost+found"], exclude=["./lost+found"],
graft_points=opts.graft_points, graft_points=opts.graft_points,
use_xorrisofs=opts.use_xorrisofs, use_xorrisofs=opts.use_xorrisofs,
iso_level=opts.iso_level,
**mkisofs_kwargs **mkisofs_kwargs
) )
emit(f, cmd) emit(f, cmd)

View File

@ -172,6 +172,7 @@ class CreateisoPhase(PhaseLoggerMixin, PhaseBase):
supported=self.compose.supported, supported=self.compose.supported,
hfs_compat=self.compose.conf["iso_hfs_ppc64le_compatible"], hfs_compat=self.compose.conf["iso_hfs_ppc64le_compatible"],
use_xorrisofs=self.compose.conf.get("createiso_use_xorrisofs"), use_xorrisofs=self.compose.conf.get("createiso_use_xorrisofs"),
iso_level=self.compose.conf.get("iso_level"),
) )
if bootable: if bootable:

View File

@ -115,6 +115,7 @@ class ExtraIsosThread(WorkerThread):
supported=compose.supported, supported=compose.supported,
hfs_compat=compose.conf["iso_hfs_ppc64le_compatible"], hfs_compat=compose.conf["iso_hfs_ppc64le_compatible"],
use_xorrisofs=compose.conf.get("createiso_use_xorrisofs"), use_xorrisofs=compose.conf.get("createiso_use_xorrisofs"),
iso_level=compose.conf.get("iso_level"),
) )
if compose.conf["create_jigdo"]: if compose.conf["create_jigdo"]:
jigdo_dir = compose.paths.compose.jigdo_dir(arch, variant) jigdo_dir = compose.paths.compose.jigdo_dir(arch, variant)

View File

@ -146,6 +146,7 @@ def get_mkisofs_cmd(
input_charset="utf-8", input_charset="utf-8",
graft_points=None, graft_points=None,
use_xorrisofs=False, use_xorrisofs=False,
iso_level=None,
): ):
# following options are always enabled # following options are always enabled
untranslated_filenames = True untranslated_filenames = True
@ -155,6 +156,10 @@ def get_mkisofs_cmd(
rock = True rock = True
cmd = ["/usr/bin/xorrisofs" if use_xorrisofs else "/usr/bin/genisoimage"] cmd = ["/usr/bin/xorrisofs" if use_xorrisofs else "/usr/bin/genisoimage"]
if iso_level:
cmd.extend(["-iso-level", str(iso_level)])
if appid: if appid:
cmd.extend(["-appid", appid]) cmd.extend(["-appid", appid])