[Concept,08/22] test: Allow creating disks with a different Ubuntu version

Message ID 20250925174753.3429102-9-sjg@u-boot.org
State New
Headers
Series efi: Tidy up some commands and provide a keyboard driver |

Commit Message

Simon Glass Sept. 25, 2025, 5:47 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Add a way to specify the (fake) Ubuntu release being used, so that we
can (later) add more tests for this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 test/py/img/ubuntu.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/test/py/img/ubuntu.py b/test/py/img/ubuntu.py
index 06e8251c05b..1247ec134d5 100644
--- a/test/py/img/ubuntu.py
+++ b/test/py/img/ubuntu.py
@@ -6,7 +6,7 @@ 
 from img.common import setup_extlinux_image
 
 
-def setup_ubuntu_image(config, log, devnum, basename):
+def setup_ubuntu_image(config, log, devnum, basename, version='24.04.1 LTS'):
     """Create a 20MB Ubuntu disk image with a single FAT partition
 
     Args:
@@ -32,16 +32,16 @@  timeout 50
 
 
 label l0
-	menu label Ubuntu 24.04.1 LTS 6.8.0-53-generic
+	menu label Ubuntu %s 6.8.0-53-generic
 	linux /boot/%s
 	initrd /boot/%s
 
 	append root=/dev/disk/by-uuid/bcfdda4a-8249-4f40-9f0f-7c1a76b6cbe8 ro earlycon
 
 label l0r
-	menu label Ubuntu 24.04.1 LTS 6.8.0-53-generic (rescue target)
+	menu label Ubuntu %s 6.8.0-53-generic (rescue target)
 	linux /boot/%s
 	initrd /boot/%s
-''' % (vmlinux, initrd, vmlinux, initrd)
+''' % ((version, vmlinux, initrd) * 2)
     setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir,
                          script)