Skip to content

Commit

Permalink
configure kiwi 10's mapper to kpartx
Browse files Browse the repository at this point in the history
Kiwi 10 switched to use partx, which requires udev to operate. As we don't have
udev in the container, we create a custom config file that forces the usage of
kpartx
  • Loading branch information
dirkmueller committed Nov 8, 2024
1 parent fb4a918 commit a596f0f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/bci_build/package/kiwi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@
from bci_build.os_version import ALL_NONBASE_OS_VERSIONS
from bci_build.os_version import CAN_BE_LATEST_OS_VERSION
from bci_build.os_version import OsVersion
from bci_build.package import DOCKERFILE_RUN
from bci_build.package import DevelopmentContainer
from bci_build.package import ParseVersion
from bci_build.package import generate_disk_size_constraints
from bci_build.package.helpers import generate_package_version_check
from bci_build.package.versions import format_version
from bci_build.package.versions import get_pkg_version


def generate_kiwi_10_config():
"""force part_mapper to be kpartx rather than the default udev, which we don't run in the image."""
return f"""
{DOCKERFILE_RUN} cat - > /etc/kiwi.yml <<EOF
mapper:
- part_mapper: kpartx
EOF
"""


KIWI_CONTAINERS = [
DevelopmentContainer(
name="kiwi",
Expand Down Expand Up @@ -54,7 +66,10 @@
*os_version.release_package_names,
]
+ os_version.common_devel_packages,
custom_end=f"{generate_package_version_check('python3-kiwi', kiwi_minor, ParseVersion.MINOR)}",
custom_end=(
f"{generate_package_version_check('python3-kiwi', kiwi_minor, ParseVersion.MINOR)}"
)
+ (generate_kiwi_10_config() if float(kiwi_minor) >= 10 else ""),
build_recipe_type=BuildType.DOCKER,
_min_release_counter=(15 if os_version.is_sle15 else None),
extra_labels={
Expand Down

0 comments on commit a596f0f

Please sign in to comment.