
From: Simon Glass <sjg@chromium.org> Move setup_ubuntu_image() to its own module. Signed-off-by: Simon Glass <sjg@chromium.org> Co-authored-by <noreply@anthropic.com> --- test/py/img/ubuntu.py | 47 ++++++++++++++++++++++++++++++++++++++++ test/py/tests/test_ut.py | 41 +---------------------------------- 2 files changed, 48 insertions(+), 40 deletions(-) create mode 100644 test/py/img/ubuntu.py diff --git a/test/py/img/ubuntu.py b/test/py/img/ubuntu.py new file mode 100644 index 00000000000..4fe54cb679b --- /dev/null +++ b/test/py/img/ubuntu.py @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + +"""Create Ubuntu test disk images""" + +from img.common import setup_extlinux_image + + +def setup_ubuntu_image(config, log, devnum, basename): + """Create a 20MB Ubuntu disk image with a single FAT partition + + Args: + config (ArbitraryAttributeContainer): Configuration + log (multiplexed_log.Logfile): Log to write to + devnum (int): Device number to use, e.g. 1 + basename (str): Base name to use in the filename, e.g. 'mmc' + """ + vmlinux = 'vmlinuz-6.8.0-53-generic' + initrd = 'initrd.img-6.8.0-53-generic' + dtbdir = None + script = '''## /boot/extlinux/extlinux.conf +## +## IMPORTANT WARNING +## +## The configuration of this file is generated automatically. +## Do not edit this file manually, use: u-boot-update + +default l0 +menu title U-Boot menu +prompt 1 +timeout 50 + + +label l0 + menu label Ubuntu 24.04.1 LTS 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) + linux /boot/%s + initrd /boot/%s +''' % (vmlinux, initrd, vmlinux, initrd) + setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, + script) \ No newline at end of file diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py index 6412aaaf3bb..a586d409505 100644 --- a/test/py/tests/test_ut.py +++ b/test/py/tests/test_ut.py @@ -20,6 +20,7 @@ from test_android import test_abootimg from img.vbe import setup_vbe_image from img.common import mkdir_cond, copy_partition, setup_extlinux_image from img.fedora import setup_fedora_image +from img.ubuntu import setup_ubuntu_image def setup_bootmenu_image(config, log): @@ -144,46 +145,6 @@ booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} fsh.cleanup() -def setup_ubuntu_image(config, log, devnum, basename): - """Create a 20MB Ubuntu disk image with a single FAT partition - - Args: - config (ArbitraryAttributeContainer): Configuration - log (multiplexed_log.Logfile): Log to write to - devnum (int): Device number to use, e.g. 1 - basename (str): Base name to use in the filename, e.g. 'mmc' - """ - vmlinux = 'vmlinuz-6.8.0-53-generic' - initrd = 'initrd.img-6.8.0-53-generic' - dtbdir = None - script = '''## /boot/extlinux/extlinux.conf -## -## IMPORTANT WARNING -## -## The configuration of this file is generated automatically. -## Do not edit this file manually, use: u-boot-update - -default l0 -menu title U-Boot menu -prompt 1 -timeout 50 - - -label l0 - menu label Ubuntu 24.04.1 LTS 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) - linux /boot/%s - initrd /boot/%s -''' % (vmlinux, initrd, vmlinux, initrd) - setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir, - script) - def setup_cros_image(config, log): """Create a 20MB disk image with ChromiumOS partitions -- 2.43.0