From 741ab26206000c4bb4987f0b5cfdce583049f065 Mon Sep 17 00:00:00 2001
From: Ettore Simone <ettore.simone@gmail.com>
Date: Sun, 14 Jan 2024 11:40:38 +0100
Subject: [PATCH] Cleanup uses of DIB_IMAGE_ROOT_FS_UUID variable

Since 2.4.0 disk-image-create does not export DIB_IMAGE_ROOT_FS_UUID
anymore. This patch fix documentation and the iso element.

Closes-Bug: 1699273
Change-Id: I5e926c36256e580579bfd2c5aeff4ba6193c367a
---
 diskimage_builder/elements/iso/cleanup.d/100-build-iso | 2 +-
 doc/source/developer/developing_elements.rst           | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/diskimage_builder/elements/iso/cleanup.d/100-build-iso b/diskimage_builder/elements/iso/cleanup.d/100-build-iso
index d60ea821f..81c31a1e1 100755
--- a/diskimage_builder/elements/iso/cleanup.d/100-build-iso
+++ b/diskimage_builder/elements/iso/cleanup.d/100-build-iso
@@ -168,7 +168,7 @@ elif echo $IMAGE_ELEMENT | grep -q '\bironic-python-agent\b'; then
 elif echo $IMAGE_ELEMENT | grep -q '\bbaremetal\b'; then
     EMITTED_KERNEL=${IMAGE_NAME}.vmlinuz
     EMITTED_RAMDISK=${IMAGE_NAME}.initrd
-    EMITTED_KERNEL_CMDLINE_ARGS="root=UUID=$DIB_IMAGE_ROOT_FS_UUID"
+    EMITTED_KERNEL_CMDLINE_ARGS="root=LABEL=${DIB_BOOT_LABEL}"
     DIB_BOOT_ISO_KERNEL_CMDLINE_ARGS=${DIB_BOOT_ISO_KERNEL_CMDLINE_ARGS:-}
     if [ -n "$DIB_BOOT_ISO_KERNEL_CMDLINE_ARGS" ]; then
         EMITTED_KERNEL_CMDLINE_ARGS="$EMITTED_KERNEL_CMDLINE_ARGS $DIB_BOOT_ISO_KERNEL_CMDLINE_ARGS"
diff --git a/doc/source/developer/developing_elements.rst b/doc/source/developer/developing_elements.rst
index 24cb58da5..71bf00620 100644
--- a/doc/source/developer/developing_elements.rst
+++ b/doc/source/developer/developing_elements.rst
@@ -276,10 +276,6 @@ Global image-build variables
   be attempted as the user may have an external cache able to keep the operation
   functional.
 
-``DIB_IMAGE_ROOT_FS_UUID``
-  This contains the UUID of the root filesystem, when diskimage-builder is
-  building a disk image. This works only for ext filesystems.
-
 ``DIB_IMAGE_CACHE``
   Path to where cached inputs to the build process are stored. Defaults to
   ``~/.cache/image_create``.