Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing OS Image build via kiwi to running via podman and adding eib pre-processing #9507

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions susemanager-utils/susemanager-sls/salt/images/kiwi-image-build.sls
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,26 @@ mgr_buildimage_prepare_activation_key_in_source:
susemanager:
activation_key: {{ activation_key }}

mgr_buildimage_prepare_kpartx_kiwi_yml:
file.managed:
- name: /etc/kiwi.yml
- contents: |
mapper:
- part_mapper: kpartx

# EIB
#
mgr_buildimage_eib:
cmd.run:
# only run eib and extract in case eib.yaml exists
- name: "if [ -f {{ source_dir }}/eib/eib.yaml ]; then mkdir -p {{ source_dir }}/root/oem/ && podman run --rm --privileged -v {{ source_dir }}/eib:/eib docker.io/dgiebert/edge-image-builder:1.2.7 build --definition-file=eib.yaml && xorriso -osirrox on -indev {{ source_dir }}/eib/combustion.iso extract / {{ source_dir }}/root/oem; fi"

{%- if use_kiwi_ng %}
# KIWI NG
#
{%- set kiwi = 'kiwi-ng' %}
# need ca-cerrificates for kiwi to trust CA
# need /dev for losetup error during create
{%- set kiwi = 'podman run --rm --privileged -v /var/lib/ca-certificates:/var/lib/ca-certificates -v /dev:/dev -v /var/lib/Kiwi:/var/lib/Kiwi:Z -v /etc/kiwi.yml:/etc/kiwi.yml registry.suse.com/bci/kiwi:10.1.10 kiwi-ng' %}

{%- set kiwi_options = pillar.get('kiwi_options', '') %}
{%- set bootstrap_packages = ['findutils', 'rhn-org-trusted-ssl-cert-osimage'] %}
Expand All @@ -59,14 +75,17 @@ mgr_buildimage_prepare_activation_key_in_source:

mgr_buildimage_kiwi_prepare:
cmd.run:
- name: "{{ kiwi }} {{ kiwi_options }} $GLOBAL_PARAMS system prepare $PARAMS"
# need to remove rpm-md due to kiwi error during create
- name: "{{ kiwi }} {{ kiwi_options }} $GLOBAL_PARAMS system prepare $PARAMS && sed -i 's/rpm-dir/rpm-md/g' {{ chroot_dir }}/image/config.xml"
- hide_output: True
- env:
- GLOBAL_PARAMS: "--logfile={{ root_dir }}/build.log --shared-cache-dir={{ cache_dir }}"
- PARAMS: "--description {{ source_dir }} --root {{ chroot_dir }} {{ kiwi_params() }}"
- require:
- mgrcompat: mgr_buildimage_prepare_source
- file: mgr_buildimage_prepare_activation_key_in_source
- file: mgr_buildimage_prepare_kpartx_kiwi_yml
- cmd: mgr_buildimage_eib

mgr_buildimage_kiwi_create:
cmd.run:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
mgr_install_kiwi:
pkg.installed:
- pkgs:
- podman
- xorriso
{%- if use_kiwi_ng %}
- python3-kiwi
{%- else %}
Expand Down
Loading