-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2474: add AMD firmware to OPAL PBA if necessary #2507
Conversation
usr/share/rear/conf/GNU/Linux.conf
Outdated
# lspci output is expected to look similar to this: | ||
# 00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Device 98e4 (rev 81) | ||
if type -p lspci >/dev/null && lspci | grep --quiet ' VGA .*AMD'; then | ||
OPAL_PBA_FIRMWARE_FILES+=( amdgpu ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPAL_PBA_FIRMWARE_FILES+=( amdgpu )
will lead to
FIRMWARE_FILES=( amdgpu )
but that will not work because
find /lib*/firmware -ipath 'amdgpu'
will find nothing
cf. the code in build/GNU/Linux/420_copy_firmware_files.sh
and see the FIRMWARE_FILES description in default.conf:
# The FIRMWARE_FILES array contains filename globbing patterns
# that are used as '-ipath' arguments for 'find' calls to find
# firmware files in the /lib*/firmware/ directories that will
# get included in the rescue/recovery system for example like
# FIRMWARE_FILES=( '*rtl*' '*nvidia*' '*radeon*' )
so what should work is
OPAL_PBA_FIRMWARE_FILES+=( '*amdgpu*' )
because with that
find /lib*/firmware -ipath '*amdgpu*'
finds firmware files
(at least on my openSUSE Leap 15.1 system).
Furthermore if I understand #2474 correctly
the /lib/firmware/amdgpu/*
firmware files plus the amdgpu
kernel module
are needed in any case to boot the ReaR recovery system
on systems with AMD-GPU graphics hardware
so I think we should better have
# Explicitly add amdgup kernel module and its firmware files
# to boot the recovery system on AMD graphics hardware (if present)
# in particular for TCG Opal pre-boot authentication (PBA) images
# that do not include firmware files by default
# cf. https://github.com/rear/rear/issues/2474
# lspci output is expected to look similar to this:
# 00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Device 98e4 (rev 81)
if type -p lspci >/dev/null && lspci | grep --quiet ' VGA .*AMD'; then
MODULES+=( amdgpu )
FIRMWARE_FILES+=( '*amdgpu*' )
OPAL_PBA_FIRMWARE_FILES+=( '*amdgpu*' )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that excellent discovery! Indeed, amdgpu
being a firmware directory will not be discovered the way I thought it would.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OliverO2 I think it is not right that a single firmware file is all that is required On my openSUSE Leap 15.1 system there are 24MB of AMD GPU firmware files:
I hope this is not too much for a PBA? |
@jsmeix Note that all of the following only applies to PBA images. Standard ReaR images will contain the The PBA image on my Ubuntu 20.04 desktop is about 46 MB (
On Ubuntu 20.04 the
The spec. allows a PBA size up to 128 MB. So we could just throw in that entire firmware directory here to avoid boot-time freezes. Downside: Slows down PBA uploading to the device (can take minutes). Additional notes:
|
With 0a1ba2f on Ubuntu 20.04 desktop, the PBA size is
Looks like we get a good compression ratio on these files in |
thank you for your explanatory reply. I fully agree with your reasoning in
Yesterday I was too fast with my (false) conclusion that because of
we should have in ReaR some hardcoded
My conclusion is wrong because it would be against what I always demand: In contrast with such hardcoded things it would be ReaR that has the final power |
@rear/contributors |
@OliverO2
which hardcodedly adds amdgpu firmware files regardless what So I wonder if not something like
would be better? I know this is probably somewhat nitpicking or even over the top |
@jsmeix If we would like to give the user more control, supporting just a "no firmware" decision seems insufficient. More likely an expert user would want to include some firmware as in OPAL_PBA_FIRMWARE_FILES=( '*/amdgpu/vega20*' ) To support this, we could choose to enable AMD firmware auto-detection only if The question is, given that
is it worth it? |
@OliverO2 |
Pull Request Details:
Type: Bug Fix
Impact: Normal
Reference to related issue (URL): Opal PBA does not boot on AMD APU/GPU systems: Missing firmware for amdgpu module #2474
How was this pull request tested?
As AMD graphics hardware was not available on the test system, tests were run by mocking as follows:
Add these lines in
usr/share/rear/lib/mkopalpba-workflow.sh
afterSourceStage "prep"
:Run
usr/sbin/rear mkopalpba
with default configuration (Intel graphics), expect result:FIRMWARE_FILES=<no>
.In
default.conf
use these single-line configuration changes:FIRMWARE_FILES=( yes )
, expect result:FIRMWARE_FILES=<no>
.FIRMWARE_FILES=( a b c )
, expect result:FIRMWARE_FILES=<a b c>
.OPAL_PBA_FIRMWARE_FILES=( one two )
, expect result:FIRMWARE_FILES=<one two>
.In
usr/share/rear/conf/GNU/Linux.conf
, change grep expressionAMD
toIntel
, expect result:FIRMWARE_FILES=<amdgpu>
.Brief description of the changes in this pull request:
OPAL PBA images only:
OPAL_PBA_FIRMWARE_FILES
configuration variable.The issue report Opal PBA does not boot on AMD APU/GPU systems: Missing firmware for amdgpu module #2474 indicates that a single firmware file is all that is required to make a PBA boot with AMD graphics hardware. If field testing shows that more changes are necessary, this PR's solution should be easy to extend.