
From: Simon Glass <sjg@chromium.org> Move setup_fedora_image() to its own module. Signed-off-by: Simon Glass <sjg@chromium.org> Co-authored-by: Claude <noreply@anthropic.com> --- test/py/img/fedora.py | 35 +++++++++++++++++++++++++++++++++++ test/py/tests/test_ut.py | 29 +---------------------------- 2 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 test/py/img/fedora.py diff --git a/test/py/img/fedora.py b/test/py/img/fedora.py new file mode 100644 index 00000000000..ffa546d1cfe --- /dev/null +++ b/test/py/img/fedora.py @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + +"""Create Fedora test disk images""" + +from img.common import setup_extlinux_image + + +def setup_fedora_image(config, log, devnum, basename): + """Create a 20MB Fedora 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-5.3.7-301.fc31.armv7hl' + initrd = 'initramfs-5.3.7-301.fc31.armv7hl.img' + dtbdir = 'dtb-5.3.7-301.fc31.armv7hl' + script = '''# extlinux.conf generated by appliance-creator +ui menu.c32 +menu autoboot Welcome to Fedora-Workstation-armhfp-31-1.9. Automatic boot in # second{,s}. Press a key for options. +menu title Fedora-Workstation-armhfp-31-1.9 Boot Options. +menu hidden +timeout 20 +totaltimeout 600 + +label Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) + kernel /%s + append ro root=UUID=9732b35b-4cd5-458b-9b91-80f7047e0b8a rhgb quiet LANG=en_US.UTF-8 cma=192MB cma=256MB + fdtdir /%s/ + initrd /%s''' % (vmlinux, dtbdir, 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 9d619eab30d..6412aaaf3bb 100644 --- a/test/py/tests/test_ut.py +++ b/test/py/tests/test_ut.py @@ -19,6 +19,7 @@ from fs_helper import DiskHelper, FsHelper 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 def setup_bootmenu_image(config, log): @@ -143,34 +144,6 @@ booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} fsh.cleanup() -def setup_fedora_image(config, log, devnum, basename): - """Create a 20MB Fedora 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-5.3.7-301.fc31.armv7hl' - initrd = 'initramfs-5.3.7-301.fc31.armv7hl.img' - dtbdir = 'dtb-5.3.7-301.fc31.armv7hl' - script = '''# extlinux.conf generated by appliance-creator -ui menu.c32 -menu autoboot Welcome to Fedora-Workstation-armhfp-31-1.9. Automatic boot in # second{,s}. Press a key for options. -menu title Fedora-Workstation-armhfp-31-1.9 Boot Options. -menu hidden -timeout 20 -totaltimeout 600 - -label Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) - kernel /%s - append ro root=UUID=9732b35b-4cd5-458b-9b91-80f7047e0b8a rhgb quiet LANG=en_US.UTF-8 cma=192MB cma=256MB - fdtdir /%s/ - initrd /%s''' % (vmlinux, dtbdir, initrd) - setup_extlinux_image(config, log, devnum, basename, vmlinux, - initrd, dtbdir, script) - def setup_ubuntu_image(config, log, devnum, basename): """Create a 20MB Ubuntu disk image with a single FAT partition -- 2.43.0