Yocto state-script fw_printenv not found

My statescript start with the following
if [ ! -x /sbin/fw_printenv ]; then
echo “printenv not found” >&2
exit 1
fi

And I get this from my log:

2024-11-01 16:29:05.988 +0000 UTC info: Running Mender client 4.0.4
2024-11-01 16:29:05.988 +0000 UTC info: Deployment with ID 486f7cc5-d445-4a22-b71e-b446167910c6 started.
2024-11-01 16:29:05.988 +0000 UTC info: Sending status update to server
2024-11-01 16:29:06.627 +0000 UTC info: Installing artifact…
2024-11-01 16:29:18.855 +0000 UTC info: Update Module output (stdout): ================ STATISTICS ================
2024-11-01 16:29:18.855 +0000 UTC info: Update Module output (stdout): Blocks written: 0
2024-11-01 16:29:18.855 +0000 UTC info: Update Module output (stdout): Blocks omitted: 376
2024-11-01 16:29:18.855 +0000 UTC info: Update Module output (stdout): Bytes written: 0
2024-11-01 16:29:18.855 +0000 UTC info: Update Module output (stdout): ============================================
2024-11-01 16:29:18.866 +0000 UTC info: Running State Script: /etc/mender/scripts/Download_Leave_10
2024-11-01 16:29:18.875 +0000 UTC info: Collected output (stderr) while running script: batterybrain_v1.1: Running Download_Leave_10
2024-11-01 16:29:18.876 +0000 UTC info: Collected output (stderr) while running script: fw_printenv not found
2024-11-01 16:29:18.876 +0000 UTC error: Received error: (NonZero exit code error: Received error code: 1) when running the State Script scripts DownloadLeave
2024-11-01 16:29:18.893 +0000 UTC info: Sending status update to server

If I go into the directory /sbin the file fw_printenv is there but if I am in home and do ls -l /sbin/fw_printenv it returns that it cannot be found. Does anyone know what is going on here? Thank you for your help :blush:

Hi @davidlekve,

Maybe a couple more details?

  • is the /sbin/fw_printenv binary executable? What is the output of ls -alh fw_printenv while you are in /sbin
  • which OS is this? How did the Mender integration happen?
  • can you drop the output of mount?
  • does the root filesystem update work?

Greetz,
Josef

I found out the problem. It never was in sbin, the binary just worked there because then i didnt write a path in front of it… :expressionless: which fw_printenv returns /usr/bin/fw_printenv.

A rookie mistake, but I think I was too locked in on that the binary should be in /sbin because of the example. Sorry to bother you @TheYoctoJester

Just to be sure, do you think there is any problem with changing the path to /usr/bin/fw_printenv or should I instead try to make the yocto project build/move the fw_printenv file in sbin. I am building for the pi5.

Hi @davidlekve,

Great thanks for pointing it out, we definitely should fix the example. Not a problem per se, but I think checking through which would be the best approach. Analogous example: mender/support/modules/rootfs-image at 0fb14b44e131ab7186bb86fe486332d420821de5 · mendersoftware/mender · GitHub

Greetz,
Josef

1 Like