Files
u-boot/test/py/img/ubuntu.py
Simon Glass 8863215954 test/py: Set up an Ubuntu image with space for FDE
Update one of the Ubuntu images to provide space for using full-disk
encryption.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-24 08:47:38 +01:00

53 lines
1.6 KiB
Python

# 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, version='24.04.1 LTS',
use_fde=False):
"""Create a Ubuntu disk image with a FAT partition and ext4 partition
This creates a FAT partition containing extlinux files, kernel, etc. and a
separate ext4 partition containing the root disk
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'
use_fde (bool): True to set up full-disk encryption
"""
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 %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 %s 6.8.0-53-generic (rescue target)
linux /boot/%s
initrd /boot/%s
''' % ((version, vmlinux, initrd) * 2)
setup_extlinux_image(config, log, devnum, basename, vmlinux, initrd, dtbdir,
script, part2_size=60 if use_fde else 1)