Legato framework porting on imx6ull, board rebooting after 40 seconds

I used the Linux OS image fsl-image-validation-imx-x11-imx6ull14evk.sdcard downloaded from NXP imx6ull website. I flashed this Linux OS image on the sdcard. I downloaded kernel source code linux-fslc-4.14-rc8 from git repository for imx6. I merged legatocfg file with configuration of the kernel source code. I used below command for merging legatocfg file.

ARCH=arm make defconfig && ARCH=arm scripts/kconfig/merge_config.sh -O . .config legatocfg

I added supporting packages in to configuration file of the kernel source code using ARCH=arm make menuconfig.

I built the zImage, dtbs files and modules.

I used below command for building the zImage.

make -j 4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs

For compiling and building legato for IMX6, I used a gcc tool, gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf. I used instruction of raspberry pi legato build for building legato for IMX6.

Commands executed for building legato.squashfs

export RASPI_TOOLCHAIN_DIR=~/tools/gcc-linaro-arm-6.4.1-2018.05-x86_64/bin/

export RASPI_TOOLCHAIN_PREFIX=arm-linux-gnueabihf-

make raspi

I built legato.squashfs successfully for IMX6.

I installed those files in to sdcard Linux os image. Successfully Linux OS booted. I mounted the legato.squashfs on imx6ull board OS. After that I attempted to start the legato. Legato frame work started running for less than 40 Seconds. After that imx6ull board restarted.

Imx6ull board showed an error like ‘logread: can’t find syslogd buffer no such file or directory’.

Supervisor also killed.

After rebooting only, the below commands are working

legato status

legato version

legato restart.

I could not execute below raspberry pi instruction on the target

1: editing below mentioned file.

/etc/systemd/system/systemd-journald.service

add “SmackProcessLabel=syslog” in [Service]

  • The systemd-journald.service file was not present in imx6ull board OS.

2: edit below mentioned file.

/etc/ssh/sshd_config

set PermitRootLogin to Yes.

  • I have already permission for login as root.

In the first attempt legato status showed an error message as the command not found.

After rebooting and running legato using the command /. /mnt/legato/start only those commands detected as system commands executed successfully.

Legato status command showed as legato installed, good and legato framework is running.

For verification of the target, I executed successfully legato version command. But fwupdate query failed and showed an error ‘fwupdate: error while loading shared libraries: liblegato.so: cannot open shared object file: No such file or directory’

I am using legato version as 18.04.0 and Linux kernel version as 4.14.rc8.

This issue is completely blocking our development. Please help me to resolve this rebooting issue.

So, you executed the fwupdate - Legato Docs query on a host, and you saw the error on the target that the Service fwupdate had failed to start because it couldn’t load liblegato.so? Can you post your “app status” and some snippets of your logs.

We are happy to see your progress in bringing up Legato on your system. I am not clear if you are still encountering issues in bringing up your BSP, but for the last issue of fwupdate not being able to find liblegato.so, it seems like you don’t have your ld.so.cache set properly.

When you start Legato on Sierra Wireless systems, you would see the lines:
root@swi-mdm9x28:~# legato start
update-ld-cache: Updating ld.so.cache using [/legato/systems/current/lib]…
update-ld-cache: Updating /etc/ld.so.cache …
update-ld-cache: Removing stale mount [/etc/ld.so.cache]…

Library liblegato.so happens to be in that library path:
root@swi-mdm9x28:~# ls /legato/systems/current/lib |grep liblegato
liblegato.so

One option you may have is to explicitly set LD_LIBRARY_PATH before starting legato, e.g.:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/legato/systems/current/lib legato start

strace_reboot (29.5 KB)
I uploaded all the files I got , When I tried to up legato on IMX6ull board.

As per the legato document, fwupdate query used for verifying the target . For that purpose I used that command.As part of verification only legato version and legato status worked.But fwupdate query command did not work.

When I debugged the source code , I found that IPC are not up . Legato framework is wating for that for 30 Seconds.

There is an issue regarding Legato + SMACK + IPC on kernels >= 4.4 .

This is a known issue that is being worked on through improvements of the SMACK management, but one way to work around it is to disable the Legato SMACK management altogether, by building it through: DISABLE_SMACK=1 make <target>.

The most recent version of Legato (18.09.0) has improvements on this aspect, so it might be worth trying it out for your usage.