Fix: IPA image buidling with OpenSuse.

At this moment the IPA image building with OpenSuse is broken and here, it was failing during the release check for Opensue because etc/SuSE-release is not valid anymore and deprecated for openSuse. Its renamed to /etc/os-release for openSuse rlease 15. This PR will solve the issue to build IPA image with OpenSuse base image. There is another PR opened in ironic-python-agent-builder, which adds all the missing packages, setuptools upgrade and svc mapping to do the build successful.
https://review.opendev.org/c/openstack/ironic-python-agent-builder/+/778726

Bug-Report: https://bugs.launchpad.net/diskimage-builder/+bug/1921510

Change-Id: Id2759be29bfcbf2ecf1ce67e171686924b506b1a
This commit is contained in:
smoshiur1237 2021-03-04 17:06:58 +02:00
parent b4f768117f
commit 93d11a7cf8
No known key found for this signature in database
GPG Key ID: 6460138D40A49B0C

View File

@ -216,6 +216,9 @@ function select_boot_kernel_initrd () {
elif [[ -f "${TARGET_ROOT}"/etc/gentoo-release ]]; then elif [[ -f "${TARGET_ROOT}"/etc/gentoo-release ]]; then
KERNEL="$(basename $(ls -1rv $BOOTDIR/vmlinuz-* | head -n 1))" KERNEL="$(basename $(ls -1rv $BOOTDIR/vmlinuz-* | head -n 1))"
RAMDISK="$(basename $(ls -1rv $BOOTDIR/initramfs-* | head -n 1))" RAMDISK="$(basename $(ls -1rv $BOOTDIR/initramfs-* | head -n 1))"
elif [[ $DISTRO_NAME = opensuse ]]; then
KERNEL=$(basename $(readlink -e $BOOTDIR/vmlinuz))
RAMDISK=$(basename $(readlink -e $BOOTDIR/initrd))
else else
echo "ERROR: Unable to detect operating system" echo "ERROR: Unable to detect operating system"
exit 1 exit 1