mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
test: Convert setup_bootmenu_image() to use FsHelper
Simplify this test-setup code by using the helper. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -17,6 +17,7 @@ import pytest
|
||||
import utils
|
||||
# pylint: disable=E0611
|
||||
from tests import fs_helper
|
||||
from fs_helper import DiskHelper, FsHelper
|
||||
from test_android import test_abootimg
|
||||
|
||||
def mkdir_cond(dirname):
|
||||
@@ -45,7 +46,6 @@ def setup_bootmenu_image(ubman):
|
||||
This is modelled on Armbian 22.08 Jammy
|
||||
"""
|
||||
mmc_dev = 4
|
||||
fname, mnt = fs_helper.setup_image(ubman, mmc_dev, 0x83)
|
||||
|
||||
script = '''# DO NOT EDIT THIS FILE
|
||||
#
|
||||
@@ -121,7 +121,9 @@ booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
|
||||
# Recompile with:
|
||||
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
|
||||
'''
|
||||
bootdir = os.path.join(mnt, 'boot')
|
||||
fsh = FsHelper(ubman.config, 'ext4', 18, 'mmc')
|
||||
fsh.setup()
|
||||
bootdir = os.path.join(fsh.srcdir, 'boot')
|
||||
mkdir_cond(bootdir)
|
||||
cmd_fname = os.path.join(bootdir, 'boot.cmd')
|
||||
scr_fname = os.path.join(bootdir, 'boot.scr')
|
||||
@@ -150,13 +152,12 @@ booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
|
||||
utils.run_and_log(
|
||||
ubman, f'echo here {kernel} {symlink}')
|
||||
os.symlink(kernel, symlink)
|
||||
fsh.mk_fs()
|
||||
img = DiskHelper(ubman.config, mmc_dev, 'mmc', True)
|
||||
img.add_fs(fsh, DiskHelper.EXT4)
|
||||
img.create()
|
||||
fsh.cleanup()
|
||||
|
||||
fsfile = 'ext18M.img'
|
||||
utils.run_and_log(ubman, f'fallocate -l 18M {fsfile}')
|
||||
utils.run_and_log(ubman, f'mkfs.ext4 {fsfile} -d {mnt}')
|
||||
copy_partition(ubman, fsfile, fname)
|
||||
utils.run_and_log(ubman, f'rm -rf {mnt}')
|
||||
utils.run_and_log(ubman, f'rm -f {fsfile}')
|
||||
|
||||
def setup_bootflow_image(ubman):
|
||||
"""Create a 20MB disk image with a single FAT partition"""
|
||||
|
||||
Reference in New Issue
Block a user