build aarch64 centos 8.3 partition image with element iscsi-boot fails

Bug #1911120 reported by xinliang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Fix Committed
Undecided
Unassigned

Bug Description

build aarch64 centos 8.3 partition image with element iscsi-boot fails.

log:
...
2021-01-12 07:11:02.396 | INFO:root:dracut regenerate done
2021-01-12 07:11:02.427 | dib-run-parts 50-dracut-regenerate completed
2021-01-12 07:11:02.427 | dib-run-parts Running /tmp/in_target.d/finalise.d/51-open-iscsi-config
2021-01-12 07:11:02.434 | + set -eu
2021-01-12 07:11:02.434 | + set -o pipefail
2021-01-12 07:11:02.434 | + [[ centos =~ centos ]]
2021-01-12 07:11:02.434 | + sed -i -E 's/(GRUB_CMDLINE_LINUX_DEFAULT=")(.+)(")/\1\2 rd.iscsi.firmware=1"/' /etc/default/grub
2021-01-12 07:11:02.439 | + grub2-mkconfig -o /boot/grub2/grub.cfg
2021-01-12 07:11:02.654 | /usr/bin/grub2-editenv: error: cannot rename the file /boot/grub2/grubenv.new to /boot/grub2/grubenv: No such file or directory.
2021-01-12 07:11:02.665 | Generating grub configuration file ...
2021-01-12 07:11:03.112 | /usr/bin/grub2-editenv: error: cannot rename the file /boot/grub2/grubenv.new to /boot/grub2/grubenv: No such file or directory.
2021-01-12 07:11:03.129 | ++ /home/linaro/diskimage-builder/diskimage_builder/lib/img-functions:run_in_target:59 : check_break after-error run_in_target bash
...

Revision history for this message
xinliang (xin3liang) wrote :

It seems like the cause is that centos 8.3 moves grub things into efi partition.
Related bug: https://bugs.launchpad.net/diskimage-builder/+bug/1893029

summary: - build centos 8.3 with element iscsi-boot fails
+ build centos/rhel 8.3 with element iscsi-boot fails
description: updated
Revision history for this message
xinliang (xin3liang) wrote : Re: build centos/rhel 8.3 with element iscsi-boot fails

centos <=8.2 no this issue.

8.2 building log:
2021-01-12 09:35:41.539 | INFO:root:dracut regenerate done
2021-01-12 09:35:41.571 | dib-run-parts 50-dracut-regenerate completed
2021-01-12 09:35:41.571 | dib-run-parts Running /tmp/in_target.d/finalise.d/51-open-iscsi-config
2021-01-12 09:35:41.818 | Generating grub configuration file ...
2021-01-12 09:35:43.200 | device-mapper: reload ioctl on osprober-linux-sda1 (253:11) failed: Device or resource busy
2021-01-12 09:35:43.201 | Command failed.
2021-01-12 09:35:43.402 | device-mapper: reload ioctl on osprober-linux-sda3 (253:11) failed: Device or resource busy
2021-01-12 09:35:43.404 | Command failed.
2021-01-12 09:35:43.988 | done

Revision history for this message
xinliang (xin3liang) wrote :

element bootloader's workaround works for element iscsi-boot. Do we want to land this workaround for now?

$ git diff
diff --git a/diskimage_builder/elements/iscsi-boot/finalise.d/51-open-iscsi-config b/diskimage_builder/elements/iscsi-boot/finalise.d/51-open-iscsi-config
index 440f3179..f5bc4777 100755
--- a/diskimage_builder/elements/iscsi-boot/finalise.d/51-open-iscsi-config
+++ b/diskimage_builder/elements/iscsi-boot/finalise.d/51-open-iscsi-config
@@ -8,6 +8,9 @@ set -eu
 set -o pipefail

 if [[ $DISTRO_NAME =~ "centos" ]]; then
+ if [[ -L /boot/grub2/grubenv ]]; then
+ rm -f /boot/grub2/grubenv
+ fi
     sed -i -E 's/(GRUB_CMDLINE_LINUX_DEFAULT=")(.+)(")/\1\2 rd.iscsi.firmware=1"/' /etc/default/grub
     grub2-mkconfig -o /boot/grub2/grub.cfg
 fi

Revision history for this message
xinliang (xin3liang) wrote :

As diskimage-builder creating its own efi partition, I think we can use the same workaround[1] to fix it.

[1]: https://review.opendev.org/c/openstack/diskimage-builder/+/750279

summary: - build centos/rhel 8.3 with element iscsi-boot fails
+ build centos/rhel 8.3 partition image with element iscsi-boot fails
summary: - build centos/rhel 8.3 partition image with element iscsi-boot fails
+ build centos 8.3 partition image with element iscsi-boot fails
description: updated
summary: - build centos 8.3 partition image with element iscsi-boot fails
+ build aarch64 centos 8.3 partition image with element iscsi-boot fails
description: updated
Revision history for this message
xinliang (xin3liang) wrote :
Changed in diskimage-builder:
status: New → Fix Committed
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.