From 14d202e821273af77e1a092321b1deda774c24e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20de=20Souza=20Pinto?= Date: Mon, 10 Feb 2025 17:32:46 +0000 Subject: [PATCH] mkimage-iso-efi: Wait for root device inside the initrd script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When installing EVE on devices with Virtual Media CD/DVD-ROM emulation it can take a few seconds to kernel to detect the installer media device. This is an issue when booting from an ISO because GRUB will boot kernel + initrd, but when initrd script tries to find the installer media's filesystem, the Virtual CD/DVD-ROM can be not yet available. This commit implements a retry mechanism in order to wait for the root device for up to 10 seconds. Signed-off-by: RenĂª de Souza Pinto --- pkg/mkimage-iso-efi/initrd.sh | 74 ++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/pkg/mkimage-iso-efi/initrd.sh b/pkg/mkimage-iso-efi/initrd.sh index 0df5e4d95e..9a0b03b4ee 100755 --- a/pkg/mkimage-iso-efi/initrd.sh +++ b/pkg/mkimage-iso-efi/initrd.sh @@ -31,40 +31,52 @@ fi echo "searching for root filesystem with value: $root_value" rootdev="" -blkid=$(blkid) -# Determine if the root_value is a LABEL, UUID, or direct device path -while read -r line; do - case "$root_value" in - LABEL=*) - label=${root_value#LABEL=} - if echo "$line" | grep -q "LABEL=\"$label\""; then - rootdev=$(echo "$line" | cut -d: -f1) - break - fi - ;; - UUID=*) - uuid=${root_value#UUID=} - if echo "$line" | grep -q "UUID=\"$uuid\""; then - rootdev=$(echo "$line" | cut -d: -f1) - break - fi - ;; - PARTUUID=*) - partuuid=${root_value#PARTUUID=} - if echo "$line" | grep -q "PARTUUID=\"$partuuid\""; then - rootdev=$(echo "$line" | cut -d: -f1) - break - fi - ;; - *) - rootdev="$root_value" - ;; - esac -done <