IPA image building for openSuse is failing in release check.

Bug #1921510 reported by Moshiur Rahman
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
diskimage-builder
New
Undecided
Unassigned

Bug Description

The IPA image building with openSuse is failing in release check and give the following error in current setup:

2021-03-26 11:16:30.938 | + /tmp/dib_build.6y7XCCtc/hooks/cleanup.d/99-ramdisk-create:main:53 : select_boot_kernel_initrd /tmp/dib_build.6y7XCCtc/mnt
2021-03-26 11:16:30.941 | + /home/ubuntu/dib2/diskimage-builder/diskimage_builder/lib/img-functions:select_boot_kernel_initrd:179 : TARGET_ROOT=/tmp/dib_build.6y7XCCtc/mnt
2021-03-26 11:16:30.943 | + /home/ubuntu/dib2/diskimage-builder/diskimage_builder/lib/img-functions:select_boot_kernel_initrd:180 : BOOTDIR=/tmp/dib_build.6y7XCCtc/mnt/boot
2021-03-26 11:16:30.946 | + /home/ubuntu/dib2/diskimage-builder/diskimage_builder/lib/img-functions:select_boot_kernel_initrd:181 : '[' -n '' -a -n '' ']'
2021-03-26 11:16:30.948 | + /home/ubuntu/dib2/diskimage-builder/diskimage_builder/lib/img-functions:select_boot_kernel_initrd:184 : '[' -f /tmp/dib_build.6y7XCCtc/mnt/etc/redhat-release ']'
2021-03-26 11:16:30.950 | + /home/ubuntu/dib2/diskimage-builder/diskimage_builder/lib/img-functions:select_boot_kernel_initrd:201 : '[' -f /tmp/dib_build.6y7XCCtc/mnt/etc/debian_version ']'
2021-03-26 11:16:30.953 | + /home/ubuntu/dib2/diskimage-builder/diskimage_builder/lib/img-functions:select_boot_kernel_initrd:213 : '[' -f /tmp/dib_build.6y7XCCtc/mnt/etc/SuSE-release ']'
2021-03-26 11:16:30.955 | + /home/ubuntu/dib2/diskimage-builder/diskimage_builder/lib/img-functions:select_boot_kernel_initrd:216 : [[ -f /tmp/dib_build.6y7XCCtc/mnt/etc/gentoo-release ]]
2021-03-26 11:16:30.958 | + /home/ubuntu/dib2/diskimage-builder/diskimage_builder/lib/img-functions:select_boot_kernel_initrd:220 : echo 'ERROR: Unable to detect operating system'
2021-03-26 11:16:30.958 | ERROR: Unable to detect operating system
2021-03-26 11:16:30.960 | + /home/ubuntu/dib2/diskimage-builder/diskimage_builder/lib/img-functions:select_boot_kernel_initrd:221 : exit 1

The above mentioned error log refers to the diskimage_builder/lib/img-functions file line 213.
"elif [ -f $TARGET_ROOT/etc/SuSE-release ]; then"

FIX: /etc/SuSE-release is not valid anymore with current openSuse release and it was deprecated in openSuse release 13. So the renamed option for release check is /etc/os-release. Locally I have tested by changing the name to /etc/os-release and build was successful.

I have tried and use other option for example:
$IPA_DISTRO_FAMILY = "suse", but the condition was failing and build was unsuccessful. Also /etc/gentoo-release is not working for suse based distribution (check log).

Also checked by adding the following line , build is successfull.
elif [[ $DISTRO_NAME = opensuse ]]; then
    KERNEL=$(basename $(readlink -e $BOOTDIR/vmlinuz))
    RAMDISK=$(basename $(readlink -e $BOOTDIR/initrd))

I have opened a PR to do the fix in https://review.opendev.org/c/openstack/diskimage-builder/+/778723/13/diskimage_builder/lib/img-functions

Revision history for this message
Moshiur Rahman (smoshiur1237) wrote :

Opened another PR in IPA-builder which fix the missing packages installation for openSuse. IPA image building with openSuse is broken for long time and need to have the fix. Locally I have tested both PR together and build is successful. Here is my PR in ipa-builder: https://review.opendev.org/c/openstack/ironic-python-agent-builder/+/778726

The PR in ipa-builder is depending on Diskimage-Builder PR. So the bug fix in DIB needs to move first.

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.