Issue to with ROOTFS_POSTPROCESS_COMMAND

Hello All,

I am trying to execute a custom ROOTFS_POSTPROCESS_COMMAND to set the system locale. But It is always failing.

Here is my custom script.

update_locale() {
    localectl set-locale  LANG=en_US.UTF-8 LANGUAGE=en_US:en
}

ROOTFS_POSTPROCESS_COMMAND += "\                   
                     update_locale; \                    
"

Error message :

localectl: not found
WARNING: exit code 127 from a shell command.

But I have checked. The build host has localectl as well as the rootfs also has localectl.
Any help would really be appreciated.

Hi @xdaco

Could you provide the version of the software of your module?

Have you done any changes to the Software? If yes, could you share these changes.

Best regards,
Jaski

Hi @jaski.tx

We are using Colibri-iMX7-eMMC_LXDE-Image-Tezi_2.8b6 by building it from the source with our own carrier board-specific device tree file.

Hi @xdaco

Sorry for the delayed response.

Which file did you add this script to in the open-embedded Environment?
What is the distribution ( uname -a ) of your build host?

Best regards,
Jaski

Hi @jaski.tx

To customize the os image I have created angstrom-lxde-image.bbappend in which I have a couple of shell function which customizes the image
for our specific requirements.

One of such post-process function was

update_locale() {
     localectl set-locale  LANG=en_US.UTF-8 LANGUAGE=en_US:en
 }

This was failing. But now, I have been able to achieve the same end result by editing
/etc/profile.d/locale.sh and /etc/locale.conf . This is a workaround. I would like to solve the issue if possible.

The kernel I am using is : 4.9.166-rt125-2.8.6+gd899927
The complete ouput of uname --all is

$ uname --all
Linux bor-carrier-board 4.9.166-rt125-2.8.6+gd899927 #1 SMP Thu Apr 9 22:24:48 UTC 2020 armv7l armv7l armv7l GNU/Linux

HI @xdaco

Good that you found a workaround. Thanks for your feedback.
I will look into this issue and come back to you.

Best regards,
Jaski

Hi @xdaco

It is possible to run the command if you enter the full path /usr/bin/localectl. However depending on the Linux Distribution and Os Settings, you might need sudo rights to run this command (For example if you use Fedora 27).

Best regards,
Jaski