stdlib: Give user's disk_device priority when setting root val
In `get_default_kernel_root_val()`, now prioiritizes the explicit disk_device passed from the user over the default implemented by the board. Also adjusts syntax for selecting this value in `set_kernel_disk_workload()` for consistency. Change-Id: Icddcf438f5b96c2288c3cc608782f191df2c394e
This commit is contained in:
@@ -126,16 +126,15 @@ class KernelDiskWorkload:
|
||||
) -> str:
|
||||
"""
|
||||
Get the default kernel root value to be passed to the kernel. This is
|
||||
determined by the value implemented in the ``get_disk_device()``
|
||||
function, and the disk image partition, obtained from
|
||||
``get_disk_root_partition()``
|
||||
determined by the user-passed or board-default ``disk_device``, and
|
||||
the disk image partition obtained from ``get_disk_root_partition()``.
|
||||
|
||||
:param disk_image: The disk image to be added to the system.
|
||||
|
||||
:returns: The default value for the ``root`` argument to be passed to the
|
||||
kernel.
|
||||
"""
|
||||
return self.get_disk_device() + (
|
||||
return (self._disk_device or self.get_disk_device()) + (
|
||||
self.get_disk_root_partition(disk_image) or ""
|
||||
)
|
||||
|
||||
@@ -196,11 +195,7 @@ class KernelDiskWorkload:
|
||||
" ".join(kernel_args or self.get_default_kernel_args())
|
||||
).format(
|
||||
root_value=self.get_default_kernel_root_val(disk_image=disk_image),
|
||||
disk_device=(
|
||||
self._disk_device
|
||||
if self._disk_device
|
||||
else self.get_disk_device()
|
||||
),
|
||||
disk_device=self._disk_device or self.get_disk_device(),
|
||||
)
|
||||
|
||||
# Setting the bootloader information for ARM board. The current
|
||||
|
||||
Reference in New Issue
Block a user