Got it !!!
Apparently something is interfering with the script (being boot.mount is already in use somewhere)
So I tried to find it with systemctl status boot.mount
and it gave me this result:
root@b2qt-apalis-imx8:~# systemctl status boot.mount
○ boot.mount - /boot
Loaded: loaded (/etc/fstab; generated)
Active: inactive (dead)
Where: /boot
What: /dev/boot-part
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
And indeed in /etc/fstab
there is this line
/dev/boot-part /boot auto noatime,noauto 0 0
This line is added by yocto/meta-boot2qt-toradex.git - Boot2Qt BSP layer for Toradex boards in recipes-core/base-files/base-files_%.bbappend
This bbappend file is present since a long time in this meta-layer and apparently it should be removed since it is not usefull (/dev/boot-part
does not even exists). It can be disabled by adding this line in config file:
BBMASK += "meta-boot2qt-toradex/recipes-core/base-files"
Edit: concerning the gpio poweroff overlay, a new post has been created here: GPIO Power-Off Overlay Not Working After Migration to Scarthgap (Apalis iMX8QP)