Error while loading shared libraries

Could anyone figure out a solution for this problem?

There is some on-going issue with kernel >4.8 because of SMACK.
Is the issue that you’re facing with devMode similar to the one in this thread? Any logs?

@CoRfr,

Versions greater than 4.8? But I was using 4.4 and are still facing the problem.

Regards,
Vamsi

Here is the devMode error I was referring about which occurs while building legato latest repository build. I have only been successful in building legato 16.10.2.

I see, that’s unrelated to the topic and a new topic would have been best.
The issue is that there is an assumption that a cross-built ‘gdbserver’ is provided by the toolchain, and if that’s not the case it doesn’t build.

If you edit apps/tools/devMode.adef and comment out the gdbserver line it should build although it won’t be possible to attach gdbserver to an application through gdbCfg.

@CoRfr Thanks for guiding me and yes comment the gdserver line works and I could successfully build legato 17.05.0. Now coming back to the original discussion that raspberry pi is rebooting a few secs after attempting to /./mnt/legato/start I am bit clueless here on how can I collect the logs which could help you understand the problem. Can you guide me?

Here is a excerpt from the syslog if thats helpful.
syslog (7.4 KB)

Hi, @Vamsi3012,

Your Supervisor is failing to mount the SMACK (smackfs) file system.

Is your kernel built with SMACK enabled?

–Jen

@virajpadte, your problem is different. Your Supervisor is getting killed by the SIGALRM signal that gets fired in case the Supervisor takes longer than 30 seconds to run its start-up sequence.

This is reported in Legato on Generic Linux. I suspect you are having the same SMACK-related issues.

–Jen

@jchitty Thanks for been so responsive and committed to help. So from the discussion on smack issues, I presume we need to perform the following steps for getting this to work with newer kernels:

Add SCM_SECURITY to the standard library headers;
in unixSocket.c, in unixSocket_CreateSeqPacketUnnamed(), set the SO_PASSSEC socket option flag;
In unixSocket.c, in ExtractAncillaryData(), handle the SCM_SECURITY message (just throw it away);

Make the Supervisor add a couple of new SMACK rules:
“framework admin w”
“admin framework w”

Set the extended attribute “security.SMACK64EXEC” to “framework” on all command-line tools bundled with the framework.

Yes. The only other thing that might be needed is in framework/c/src/start/start.c, in the function MakeDir(), change the line

le_result_t result = le_dir_Make(dirPath, DEFAULT_PERMS);

to

le_result_t result = dir_MakeSmack(dirPath, DEFAULT_PERMS, "_");

This ensures that directories created by the start-up program get the correct SMACK label.

Hi @jchitty,

I do not know this. How do I check this?

Regards,
Vamsi

Hi, @Vamsi3012,

Do you have a file called /boot/config-4.4.50-v7+ (or something like that in /boot/ that matches the version of your kernel as output by uname -r)?

If so, when you run the following,

grep CONFIG_SECURITY_SMACK /boot/config-`uname -r`

You should see something like this

CONFIG_SECURITY_SMACK=y
# CONFIG_SECURITY_SMACK_BRINGUP is not set
CONFIG_SECURITY_SMACK_NETFILTER=y

The key point is that the following must appear in your kernel’s build configuration:

CONFIG_SECURITY_SMACK=y

If you see this instead, then SMACK is disabled in your kernel:

# CONFIG_SECURITY_SMACK is not set

Hi @jchitty,

Thanks for the continuous support.

I checked, and it turns out that there is no such file.

Could that be the reason? Or was there something wrong that I did while building the kernel?

Regards,
Vamsi

Maybe /proc/config.gz ?

Hi @CoRfr,

I do not have that either :neutral_face:

Regards,
Vamsi

@Vamsi3012 which platform are you trying to get legato working for?

If you built the kernel yourself, then you should have a .config file in your kernel build directory. Also, you should be able to run make menuconfig to check (and change) your kernel build configuration settings.

Cheers,

–Jen

Hiya,

And if you’re building your own kernel, then to get ‘/proc/config.gz’ you need to make sure that the following two options are enabled in menuconfig:

File systems  —>
   Pseudo filesystems  —>
   [*] /proc file system support

and

General setup  --->
   [*] Kernel .config support
   [*]   Enable access to .config through /proc/config.gz

or CONFIG_PROC_FS, CONFIG_IKCONFIG, and CONFIG_IKCONFIG_PROC if editing the .config file by hand

have a look here: https://www.xaprb.com/blog/2006/05/23/how-to-use-linuxs-proc-config-feature/ for a nice little write-up about this.

ciao, Dave

@jchitty,

I did a fresh build all over again and the problem is the same. Again, there was no .config file. So I had to generate it using the following commands:

modprobe configs

I had to execute that command because the config.gz was not there. After that I generated the .config file and I see that the settings that should have been merged from the legatocfg, are missing. I am not sure what I am doing wrong but I seem to be stuck here.

@davidc,

I shall try what you said and get back to you.

Thank you guys for your continuous support. Is there a possibility that there is already a kernel built for raspberry pi that I could perhaps just download and use?

Regards,
Vamsi