0

I want to override a variable file in the distro.conf in my my_image recipe.

For example by default distro.conf variable has defined a variable

USER="distroname"

Now, I have my custom image recipe called by the name as my_image.bb, in that I wanted to override the USER variable with some other value

USER="imagename"

When I bitbake my_image name , in rootfs , I can see it has taken the USER value as distroname and not the overriding one imagename.

Nevertheless, bitbake -e my_image shows the name is overridden properly.

 bitbake -e my_image|grep ^USER
 USER="imagename"

Can anyone please help me to solve this issue? Does the variables in distro.conf can not be overridden?

  • Can you share the output of `bitbake -e my_image` - just the section that shows the history of the `USER` variable? This should work. Also, how does this variable affect the rootfs - do you write the value into a file? – justinsg Oct 15 '21 at 07:03
  • yes, actually this USER is linux user. I can see in /etc/passwd file which user is being taken.As mentioned, I am not able to override the USER variable in my_image file.thanks. – Pravin.2087 Oct 15 '21 at 09:02
  • I don't think you can do it from a recipe. try putting it in `local.conf` or layer's conf file. – Oleksandr Kravchuk Oct 15 '21 at 18:35
  • @OleksandrKravchuk , thanks. I am not able to change anything in local.conf or in layer.conf . because that default name is being used by other images and workflow that are already set for that. – Pravin.2087 Oct 16 '21 at 08:19
  • Can you explain how the `USER` variable is used to create the entry in `/etc/passwd`? If the recipe code that performs that task is not part of `my_image.bb`, it will not be affected by the variable override. Example code would be really helpful. – justinsg Oct 17 '21 at 10:31

0 Answers0