diff --git a/README.md b/README.md index e036e77..0b17d36 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Set up your development environment and run the image build (substitute ` --image-profile= --output-dir ./outdir +[]$ sudo ./kiwi-build --kiwi-file=Fedora.kiwi --image-type= --image-profile= --output-dir ./outdir ``` ## CI information diff --git a/VARIANTS.md b/VARIANTS.md index 57a81cd..fb67c7b 100644 --- a/VARIANTS.md +++ b/VARIANTS.md @@ -1,5 +1,7 @@ ## Image variants +### For the `Fedora.kiwi` kiwi file + | Name | Image type | Image profiles | |--------------------------------|------------|----------------------------------| | Base Cloud Edition for clouds | `oem` | `Cloud-Base-Generic` | diff --git a/kiwi-build b/kiwi-build index bc0db7b..b65640d 100755 --- a/kiwi-build +++ b/kiwi-build @@ -8,28 +8,31 @@ set -eu -o pipefail kiwibuildsh="$(basename "$0")" usage() { - echo >&2 "usage: $kiwibuildsh [--kiwi-description-dir=DIR] [--isolated] --output-dir=DIR --image-type=TYPE --image-profile=PROFILE [--debug]" - echo >&2 " eg: $kiwibuildsh --kiwi-description-dir=/var/tmp/desc --output-dir=/var/tmp/work --image-type=oem --image-profile=Cloud-Base-Generic --debug" + echo >&2 "usage: $kiwibuildsh [--kiwi-description-dir=DIR] [--kiwi-file=FILE] [--isolated] --output-dir=DIR --image-type=TYPE --image-profile=PROFILE [--debug]" + echo >&2 " eg: $kiwibuildsh --kiwi-description-dir=/var/tmp/desc --kiwi-file=config.kiwi --output-dir=/var/tmp/work --image-type=oem --image-profile=Cloud-Base-Generic --debug" echo >&2 " eg: $kiwibuildsh --output-dir=/var/tmp/work --image-type=oem --image-profile=Cloud-Base-Generic" echo >&2 " eg: $kiwibuildsh --isolated --output-dir=/var/tmp/work --image-type=oem --image-profile=Cloud-Base-Generic" exit 255 } -optTemp=$(getopt --options '+k:,i,o:,t:,p:,d,h' --longoptions 'isolated,kiwi-description-dir:,output-dir:,image-type:,image-profile:,debug,help' --name "$kiwibuildsh" -- "$@") +optTemp=$(getopt --options '+k:,f:,i,o:,t:,p:,d,h' --longoptions 'kiwi-description-dir:,kiwi-file:,isolated,output-dir:,image-type:,image-profile:,debug,help' --name "$kiwibuildsh" -- "$@") eval set -- "$optTemp" unset optTemp -kiwi_isolated= -kiwi_description_dir="./" output_dir= image_type= image_profile= debug= +kiwi_isolated= +# For compatibility with older scripts where these did not exist +kiwi_description_dir="./" +kiwi_file="Fedora.kiwi" while true; do case "$1" in -i|--isolated) kiwi_isolated=1; shift ;; -k|--kiwi-description-dir) kiwi_description_dir="$2" ; shift 2 ;; + -f|--kiwi-file) kiwi_file="$2" ; shift 2 ;; -o|--output-dir) output_dir="$2" ; shift 2 ;; -t|--image-type) image_type="$2" ; shift 2 ;; -p|--image-profile) image_profile="$2" ; shift 2 ;; @@ -39,7 +42,7 @@ while true; do esac done -if [ -z "$output_dir" ] || [ -z "$image_type" ] || [ -z "$image_profile" ]; then +if [ -z "$output_dir" ] || [ -z "$image_type" ] || [ -z "$image_profile" ] || [ -z "$kiwi_file" ]; then echo "Options not set!" usage fi @@ -54,9 +57,9 @@ fi set +e if [ ! ${kiwi_isolated} ]; then -kiwi-ng ${debug} --type="${image_type}" --profile="${image_profile}" --color-output system build --description "${kiwi_description_dir}" --target-dir "${output_dir}" +kiwi-ng ${debug} --type="${image_type}" --profile="${image_profile}" --kiwi-file="${kiwi_file}" --color-output system build --description "${kiwi_description_dir}" --target-dir "${output_dir}" else -kiwi-ng ${debug} --type="${image_type}" --profile="${image_profile}" --color-output system boxbuild --box universal --sshfs-sharing -- --description "${kiwi_description_dir}" --target-dir "${output_dir}" +kiwi-ng ${debug} --type="${image_type}" --profile="${image_profile}" --kiwi-file="${kiwi_file}" --color-output system boxbuild --box universal --sshfs-sharing -- --description "${kiwi_description_dir}" --target-dir "${output_dir}" fi kiwi_status=$? set -e diff --git a/tmt/plans/cloud/base/build-aws.fmf b/tmt/plans/cloud/base/build-aws.fmf index f2d2fe4..758a3a0 100644 --- a/tmt/plans/cloud/base/build-aws.fmf +++ b/tmt/plans/cloud/base/build-aws.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oem image_profile: Cloud-Base-AmazonEC2 + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/cloud/base/build-azure.fmf b/tmt/plans/cloud/base/build-azure.fmf index 970ee9a..4cc66ed 100644 --- a/tmt/plans/cloud/base/build-azure.fmf +++ b/tmt/plans/cloud/base/build-azure.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oem image_profile: Cloud-Base-Azure + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/cloud/base/build-gcp.fmf b/tmt/plans/cloud/base/build-gcp.fmf index abe823c..e5ed99e 100644 --- a/tmt/plans/cloud/base/build-gcp.fmf +++ b/tmt/plans/cloud/base/build-gcp.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oem image_profile: Cloud-Base-GCE + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/cloud/base/build-generic.fmf b/tmt/plans/cloud/base/build-generic.fmf index 752bf11..864e137 100644 --- a/tmt/plans/cloud/base/build-generic.fmf +++ b/tmt/plans/cloud/base/build-generic.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oem image_profile: Cloud-Base-Generic + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/cloud/base/build-uefi-uki.fmf b/tmt/plans/cloud/base/build-uefi-uki.fmf index dd37f00..3d1ad3c 100644 --- a/tmt/plans/cloud/base/build-uefi-uki.fmf +++ b/tmt/plans/cloud/base/build-uefi-uki.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oem image_profile: Cloud-Base-UEFI-UKI + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/container/base/build-generic-init.fmf b/tmt/plans/container/base/build-generic-init.fmf index 6f17366..3a0e82a 100644 --- a/tmt/plans/container/base/build-generic-init.fmf +++ b/tmt/plans/container/base/build-generic-init.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oci image_profile: Container-Base-Generic-Init + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/container/base/build-generic-minimal.fmf b/tmt/plans/container/base/build-generic-minimal.fmf index ac82294..9c192da 100644 --- a/tmt/plans/container/base/build-generic-minimal.fmf +++ b/tmt/plans/container/base/build-generic-minimal.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oci image_profile: Container-Base-Generic-Minimal + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/container/base/build-generic.fmf b/tmt/plans/container/base/build-generic.fmf index 07b4eb5..c6c71db 100644 --- a/tmt/plans/container/base/build-generic.fmf +++ b/tmt/plans/container/base/build-generic.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oci image_profile: Container-Base-Generic + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/container/toolbox/build-toolbox.fmf b/tmt/plans/container/toolbox/build-toolbox.fmf index b30ed97..76f0567 100644 --- a/tmt/plans/container/toolbox/build-toolbox.fmf +++ b/tmt/plans/container/toolbox/build-toolbox.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oci image_profile: Container-Toolbox + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/desktop/kde/build-desktop-disk.fmf b/tmt/plans/desktop/kde/build-desktop-disk.fmf index fa3837e..11fcffb 100644 --- a/tmt/plans/desktop/kde/build-desktop-disk.fmf +++ b/tmt/plans/desktop/kde/build-desktop-disk.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oem image_profile: KDE-Desktop-Disk + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/desktop/kde/build-desktop-live.fmf b/tmt/plans/desktop/kde/build-desktop-live.fmf index bdde89d..190c1e1 100644 --- a/tmt/plans/desktop/kde/build-desktop-live.fmf +++ b/tmt/plans/desktop/kde/build-desktop-live.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: iso image_profile: KDE-Desktop-Live + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/vagrant/base/build-libvirt.fmf b/tmt/plans/vagrant/base/build-libvirt.fmf index 8c49c19..5dc2751 100644 --- a/tmt/plans/vagrant/base/build-libvirt.fmf +++ b/tmt/plans/vagrant/base/build-libvirt.fmf @@ -4,5 +4,6 @@ discover: environment: image_type: oem image_profile: Cloud-Base-Vagrant-libvirt + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/plans/vagrant/base/build-virtualbox.fmf b/tmt/plans/vagrant/base/build-virtualbox.fmf index 9fcd97e..22878fe 100644 --- a/tmt/plans/vagrant/base/build-virtualbox.fmf +++ b/tmt/plans/vagrant/base/build-virtualbox.fmf @@ -7,5 +7,6 @@ adjust: environment: image_type: oem image_profile: Cloud-Base-Vagrant-VirtualBox + kiwi_file: Fedora.kiwi execute: how: tmt diff --git a/tmt/tests/build-image.fmf b/tmt/tests/build-image.fmf index fb93d3e..f8003f5 100644 --- a/tmt/tests/build-image.fmf +++ b/tmt/tests/build-image.fmf @@ -9,6 +9,6 @@ require: framework: shell path: / test: | - ./kiwi-build --debug --image-type="$image_type" --image-profile="$image_profile" --kiwi-description-dir="${TMT_TREE}" --output-dir="${TMT_TEST_DATA}" + ./kiwi-build --debug --image-type="$image_type" --image-profile="$image_profile" --kiwi-description-dir="${TMT_TREE}" --kiwi-file="$kiwi_file" --output-dir="${TMT_TEST_DATA}" rm -rf "${TMT_TEST_DATA}/build/image-root" duration: 60m