Skip to contentSkip to conversation

Yocto on AMD Zen target ?

DISCUSSION Joel GUITTET 7 participants 14 messages Apr 4, 2025 – Apr 14, 2025 5 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hello,

A customer ask us if it is possible to build a Yocto distro for an AMD EPYC 7502P CPU. Seems to be a Ryzen Zen architecture according to Wikipedia.

Has Yocto any support for this kind of targets ? I don't find any relevant information. Is it just supposed to work with the "genericx86-64.conf" machine provided in poky ?

Thanks
Joel

#1 lore raw
Quoted 8 lines · Joel GUITTET via lists.yoctoproject.org

Hello,

A customer ask us if it is possible to build a Yocto distro for an AMD EPYC 7502P CPU. Seems to be a Ryzen Zen architecture according to Wikipedia.

Has Yocto any support for this kind of targets ? I don't find any relevant information. Is it just supposed to work with the "genericx86-64.conf" machine provided in poky ?

Generally yes, if you want specific machine maybe use meta-amd see
https://web.git.yoctoproject.org/meta-amd/tree/meta-amd-bsp/conf/machine
I think milan is the one that you will use for this machine.

Quoted 13 lines

Thanks
Joel

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
You automatically follow any topics you start or reply to. View/Reply Online (#65097): https://lists.yoctoproject.org/g/yocto/message/65097
Mute This Topic: https://lists.yoctoproject.org/mt/112080706/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 9 lines · Khem Raj via lists.yoctoproject.org
Quoted 5 lines

A customer ask us if it is possible to build a Yocto distro for an AMD EPYC 7502P CPU. Seems to be a Ryzen Zen architecture according to Wikipedia.

Has Yocto any support for this kind of targets ? I don't find any relevant information. Is it just supposed to work with the "genericx86-64.conf" machine provided in poky ?

Generally yes, if you want specific machine maybe use meta-amd see
https://web.git.yoctoproject.org/meta-amd/tree/meta-amd-bsp/conf/machine
I think milan is the one that you will use for this machine.

Also, generix86-64 isn't tested on any actual x86 hardware, and lacks many important tweaks that make a useful image. If meta-amd doesn't work, there's also meta-intel. X86 builds are broadly compatible between them.

Alex

#3 lore raw

Hello Khem and Alex,

Thanks for these answers and pointing the meta-amd, I have found the tune-zen include files, seems fine.

Joel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

warn if a variable is not used

Hello,

In a .bbappend file, I want to send a warning if a variable is not set/exist and set it to a default value. I use BitBake Build Tool Core version 2.0.0.

If I try to test it like:

if [[ -z "${MY_VARIABLE}" ]]

I get an error like:

Log data follows:

| DEBUG: Executing shell function do_compile 
| /<path>/run.do_compile.352486: 153: MY_VARIABLE: not found 
| WARNING: exit code 127 from a shell command. 

ERROR: Task (/<path>/rpi-u-boot-scr.bb:do_compile) failed with exit code '1'

When I use:
isempty="${@bb.utils.contains('MY_VARIABLE', '', 'false', 'true', d)}" bbwarn "isempty=$isempty"
if [[ $isempty == true ]]; then
MY_VARIABLE = "value"
bbwarn "MY_VARIABLE is not defined, used default: ${MY_VARIABLE}" else
bbwarn "?????"
fi

it print:
WARNING: rpi-u-boot-scr-1.0-r0 do_compile: isempty=true
WARNING: rpi-u-boot-scr-1.0-r0 do_compile: ?????

I already try with quote or not, but when I test it in a shell by setting the isempty variable it work properly.

Best regards.

#6 lore raw

Re: [yocto] warn if a variable is not used

Quoted 2 lines

| /<path>/run.do_compile.352486: 153: MY_VARIABLE: not found

<snip>

Quoted 1 line

           MY_VARIABLE = "value"

Note that when you are in do_compile, that's a shell script. You shouldn't put space around the equal sign here, because that's not a valid syntax to assign a value to a variable in shell.

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

Re: [yocto] warn if a variable is not used

You can check what is actually executed by bitbake. Open the run.do_compile file to see the actual script after a failure, and see how it is parsed and where it goes astray.

Quoted 28 lines · On 4/8/25 15:06, [email protected] wrote:

Thank you, but branch is never reached because the previous condition is never true in this code (and I don't know why). Even if bbwarn print 'WARNING: rpi-u-boot-scr-1.0-r0 do_compile: isempty=true'.

isempty="${@bb.utils.contains('MY_VARIABLE', '', 'false', 'true', d)}" bbwarn "isempty=$isempty"
if [[ $isempty == true ]]; then
MY_VARIABLE = "value"
bbwarn "MY_VARIABLE is not defined, used default: ${MY_VARIABLE}"
else

            bbwarn "?????"

fi

But maybe bitbake provide some syntax to print a warning when a variable is not set outside bash code. Or it is easier to use some python code.

----- Mail original -----
De: "Gyorgy Sarvari" <[email protected]>
À: "yocto at lists yoctoproject org proffesionaladdress2" <[email protected]>, [email protected] Envoyé: Mardi 8 Avril 2025 14:56:24
Objet: Re: [yocto] warn if a variable is not used

Quoted 1 line

| /<path>/run.do_compile.352486: 153: MY_VARIABLE: not found

<snip>

Quoted 1 line

           MY_VARIABLE = "value"

Note that when you are in do_compile, that's a shell script. You shouldn't put space around the equal sign here, because that's not a valid syntax to assign a value to a variable in shell.

#10 lore raw

Re: [yocto] warn if a variable is not used

In reply to a message not in the archive

Thank you, but branch is never reached because the previous condition is never true in this code (and I don't know why). Even if bbwarn print 'WARNING: rpi-u-boot-scr-1.0-r0 do_compile: isempty=true'.

isempty="${@bb.utils.contains('MY_VARIABLE', '', 'false', 'true', d)}" bbwarn "isempty=$isempty"
if [[ $isempty == true ]]; then
MY_VARIABLE = "value"
bbwarn "MY_VARIABLE is not defined, used default: ${MY_VARIABLE}"
else

            bbwarn "?????"

fi

But maybe bitbake provide some syntax to print a warning when a variable is not set outside bash code. Or it is easier to use some python code.

----- Mail original -----
De: "Gyorgy Sarvari" <[email protected]>
À: "yocto at lists yoctoproject org proffesionaladdress2" <[email protected]>, [email protected] Envoyé: Mardi 8 Avril 2025 14:56:24
Objet: Re: [yocto] warn if a variable is not used

Quoted 2 lines

| /<path>/run.do_compile.352486: 153: MY_VARIABLE: not found

<snip>

Quoted 1 line

           MY_VARIABLE = "value"

Note that when you are in do_compile, that's a shell script. You shouldn't put space around the equal sign here, because that's not a valid syntax to assign a value to a variable in shell.

#11 lore raw

Re: [yocto] warn if a variable is not used

Hi,

Quoted 6 lines · On 4/8/25 3:12 PM, proffesionaladdress2 via lists.yoctoproject.org wrote:

Thank you, but branch is never reached because the previous condition is never true in this code (and I don't know why). Even if bbwarn print 'WARNING: rpi-u-boot-scr-1.0-r0 do_compile: isempty=true'.

isempty="${@bb.utils.contains('MY_VARIABLE', '', 'false', 'true', d)}" bbwarn "isempty=$isempty"
if [[ $isempty == true ]]; then

This syntax is not supported by BitBake, please use POSIX condition here instead. (i.e. not the [[ ]], but [ ]).

Cheers,
Quentin

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw

Re: [yocto] warn if a variable is not used

Thank you for reply, I also tried the [ ] syntax without success.

I made it like following, but it print a lot of warning with BitBake Build Tool Core version 2.0.0 (the ":=" doesn't expand once in .bb file?). In a check_variable.bbclass:

# warn_and_set_variable_default function take as parameters, the BitBake datastore "d", the variable to check "var" and the value to set if the variable "var" is empty.
# It shall be set to a variable like: MY_VAR := "${@warn_and_set_variable_default(d, 'MY_VAR', "default")}"
# to avoid multiple variable expansion according to bitbake documentation:
# https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-metadata.html#inline-python-variable-expansion
def warn_and_set_variable_default(d, var, defaultvalue):
    variable_value = d.getVar(var)
    if not variable_value:
        bb.warn('The variable %s is empty or not defined, it will be set to "%s"' % (var, defaultvalue))
        return defaultvalue
    else:
        return variable_value
# fail_if_variable_empty function take as parameters, the BitBake datastore "d", the variable to check "var".
# It shall be set to a variable like warn_and_set_variable_default function.
def fail_if_variable_empty(d, var):
    variable_value = d.getVar(var)
    if not variable_value:
        bb.fatal('The variable %s is empty and shall be set' %var)
        return None
    else:
        return variable_value

Then in recipe:

include classes/check_variable.bbclass

# Parse mandatory variables
MY_VAR_MANDATORY_PARSED := "${@fail_if_variable_empty(d, 'MY_VAR_MANDATORY')}"

# Parse optional variables
MY_VAR_OPTIONAL_PARSED := "${@warn_and_set_variable_default(d, 'MY_VAR_OPTIONAL', 'default')}"

#usage

do_install:append() {
      sed -i "s#@MY_VAR_MANDATORY@#\"${MY_VAR_MANDATORY_PARSED}\"#g" ${D}${bindir}/myfile.file
      sed -i "s#@MY_VAR_OPTIONAL@#\"${MY_VAR_OPTIONAL_PARSED}\"#g" ${D}${bindir}/myfile.file
}

And in local.conf (to avoid error from bbfatal):

MY_VAR_MANDATORY="deadbeef"

it will print 14 times for my recipe, like:
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"

----- Mail original -----
De: "Quentin Schulz" <[email protected]>
À: "yocto at lists yoctoproject org proffesionaladdress2" <[email protected]>, "proffesionaladdress2" <[email protected]>, "Gyorgy Sarvari" <[email protected]> Envoyé: Lundi 14 Avril 2025 12:58:57
Objet: Re: [yocto] warn if a variable is not used

Hi,

Quoted 6 lines · On 4/8/25 3:12 PM, proffesionaladdress2 via lists.yoctoproject.org wrote:

Thank you, but branch is never reached because the previous condition is never true in this code (and I don't know why). Even if bbwarn print 'WARNING: rpi-u-boot-scr-1.0-r0 do_compile: isempty=true'.

isempty="${@bb.utils.contains('MY_VARIABLE', '', 'false', 'true', d)}" bbwarn "isempty=$isempty"
if [[ $isempty == true ]]; then

This syntax is not supported by BitBake, please use POSIX condition here instead. (i.e. not the [[ ]], but [ ]).

Cheers,
Quentin

#14 lore raw

Re: [yocto] warn if a variable is not used

In reply to [email protected]

In case you weren't aware, you can explicitly set default values:
W ??= "x"
A ?= "aval"

https://docs.yoctoproject.org/bitbake/2.0/bitbake-user-manual/bitbake-user-manual-metadata.html#setting-a-default-value

--

Variables can be queried as to how they are set:

$ bitbake-getvar --recipe rpi-u-boot-scr MY_VARIABLE

--

Also note:

Quoted 4 lines

The scripts are executed by /bin/sh , which may not be a bash shell but might be something such as dash.

https://docs.yoctoproject.org/bitbake/2.0/bitbake-user-manual/bitbake-user-manual-metadata.html#shell-functions

A message that is not in the archive (sent off-list or not yet received): [email protected]

#16 lore raw

Re: [yocto] warn if a variable is not used

Thank you, I wasn't aware about the --recipe option of bitbake-getvar.

The goal here is not to silently set to a value but to also send a warning.

I made it like but it print a lot of warning with BitBake Build Tool Core version 2.0.0 (the ":=" doesn't expand once in .bb file?), in a check_variable.bbclass:

# warn_and_set_variable_default function take as parameters, the BitBake datastore "d", the variable to check "var" and the value to set if the variable "var" is empty. 
# It shall be set to a variable like: MY_VAR := "${@warn_and_set_variable_default(d, 'MY_VAR', "default")}" 
# to avoid multiple variable expansion according to bitbake documentation: 
# https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-metadata.html#inline-python-variable-expansion 
def warn_and_set_variable_default(d, var, defaultvalue): 
variable_value = d.getVar(var) 
if not variable_value: 
bb.warn('The variable %s is empty or not defined, it will be set to "%s"' % (var, defaultvalue)) 
return defaultvalue 
else: 
return variable_value 
# fail_if_variable_empty function take as parameters, the BitBake datastore "d", the variable to check "var". 
# It shall be set to a variable like warn_and_set_variable_default function. 
def fail_if_variable_empty(d, var): 
variable_value = d.getVar(var) 
if not variable_value: 
bb.fatal('The variable %s is empty and shall be set' %var) 
return None 
else: 
return variable_value 

Then in recipe:

include classes/check_variable.bbclass

# Parse mandatory variables
MY_VAR_MANDATORY_PARSED := "${@fail_if_variable_empty(d, 'MY_VAR_MANDATORY')}"

# Parse optional variables
MY_VAR_OPTIONAL_PARSED := "${@warn_and_set_variable_default(d, 'MY_VAR_OPTIONAL', 'default')}"

#usage
do_install:append() {
sed -i "s#@MY_VAR_MANDATORY@#\"${MY_VAR_MANDATORY_PARSED}\"#g" ${D}${bindir}/myfile.file sed -i "s#@MY_VAR_OPTIONAL@#\"${MY_VAR_OPTIONAL_PARSED}\"#g" ${D}${bindir}/myfile.file }

And in local.conf (to avoid error from bbfatal):

MY_VAR_MANDATORY="deadbeef"

it will print 14 times for my recipe, like:
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"
WARNING: The variable MY_VAR_OPTIONAL is empty or not defined, it will be set to "default"

De: "Clayton Casciato" <[email protected]>
À: "proffesionaladdress2" <[email protected]>, "yocto at lists yoctoproject org proffesionaladdress2" <[email protected]> Envoyé: Mardi 8 Avril 2025 15:18:54
Objet: Re: [yocto] warn if a variable is not used

In case you weren't aware, you can explicitly set default values: W ??= "x" A ?= "aval" https://docs.yoctoproject.org/bitbake/2.0/bitbake-user-manual/bitbake-user-manual-metadata.html#setting-a-defaul

DuckDuckGo did not detect any trackers. [ https://duckduckgo.com/-IAIIzTFfMjhHUPJJpT-egROjaq5duXecWi8_QYYw2KgrYCq8CyKIfbd8C7jYEzviBm9jtTq-ynKiLi1BI6Tf447Ot-09ZA70WKKvc8VYd55iREHlhxCWcbhJWnqmrOf8TAqLpw0gSCM-b1qX2Qi9wurrhws1ngng9H9-BcqIg3svdO4t7VgT-SadQMtGCo6ptJNRY_imO7Pw | More ]

[ https://duckduckgo.com/-IAIIzTFfMjhHUPJJpT-egROjaq5duXecWi8_QYYw2KgrYCq8CyKIfbd8C7jYEzviBm9jtTq-ynKiLi1BI6Tf447Ot-09ZA70WKKvc8VYd55iREHlhxCWcbhJWnqmrOf8TAqLpw0gSCM-b1qX2Qi9wurrhws1ngng9H9-BcqIg3svdO4t7VgT-SadQMtGCo6ptJNRY_imO7Pw | Report Spam ]
In case you weren't aware, you can explicitly set default values:
W ??= "x"
A ?= "aval"
https://docs.yoctoproject.org/bitbake/2.0/bitbake-user-manual/bitbake-user-manual-metadata.html#setting-a-default-value

Signature · 12 lines
Variables can be queried as to how they are set: 
$ bitbake-getvar --recipe rpi-u-boot-scr MY_VARIABLE 
-- 
Also note: 



The scripts are executed by /bin/sh , which may not be a bash shell but might be something such as dash . 



https://docs.yoctoproject.org/bitbake/2.0/bitbake-user-manual/bitbake-user-manual-metadata.html#shell-functions 
#17 lore raw

warn if a variable is not used

In reply to a message not in the archive

Hello,

In a .bbappend file, I want to send a warning if a variable is not set/exist and set it to a default value. I use BitBake Build Tool Core version 2.0.0.

If I try to test it like:

if [[ -z "${MY_VARIABLE}" ]]

I get an error like:

Log data follows:

| DEBUG: Executing shell function do_compile 
| /<path>/run.do_compile.352486: 153: MY_VARIABLE: not found 
| WARNING: exit code 127 from a shell command. 

ERROR: Task (/<path>/rpi-u-boot-scr.bb:do_compile) failed with exit code '1'

When I use:
isempty="${@bb.utils.contains('MY_VARIABLE', '', 'false', 'true', d)}" bbwarn "isempty=$isempty"
if [[ $isempty == true ]]; then
MY_VARIABLE = "value"
bbwarn "MY_VARIABLE is not defined, used default: ${MY_VARIABLE}" else
bbwarn "?????"
fi

it print:
WARNING: rpi-u-boot-scr-1.0-r0 do_compile: isempty=true
WARNING: rpi-u-boot-scr-1.0-r0 do_compile: ?????

I already try with quote or not, but when I test it in a shell by setting the isempty variable it work properly.

Best regards.

#18 lore raw

warn if a variable is not used

In reply to a message not in the archive

Hello,

In a .bbappend file, I want to send a warning if a variable is not set/exist and set it to a default value. I use BitBake Build Tool Core version 2.0.0.

If I try to test it like:

if [[ -z "${MY_VARIABLE}" ]]

I get an error like:

Log data follows:

| DEBUG: Executing shell function do_compile 
| /<path>/run.do_compile.352486: 153: MY_VARIABLE: not found 
| WARNING: exit code 127 from a shell command. 

ERROR: Task (/<path>/rpi-u-boot-scr.bb:do_compile) failed with exit code '1'

When I use:
isempty="${@bb.utils.contains('MY_VARIABLE', '', 'false', 'true', d)}" bbwarn "isempty=$isempty"
if [[ $isempty == true ]]; then
MY_VARIABLE = "value"
bbwarn "MY_VARIABLE is not defined, used default: ${MY_VARIABLE}" else
bbwarn "?????"
fi

it print:
WARNING: rpi-u-boot-scr-1.0-r0 do_compile: isempty=true
WARNING: rpi-u-boot-scr-1.0-r0 do_compile: ?????

I already try with quote or not, but when I test it in a shell by setting the isempty variable it work properly.

Best regards.