Best practice to setup an image with additional prebuild data

Hi,

what is generally spoken the best practice to add an own application with a lot of dependencies to 3rd party libraries?

When I add the 3rd party libraries to the main image, the boot steps tooks more time. Should I use a separate image partition?

Thanks a lot.

Best Fred

Fred,

With all due respect, you question looks like the many junk questions created by AI that I receive on Quora daily.  I know that isn't the case here so I will try to be helpful.

First, just my opinion, the term “best practice” is garbage jargon. Some code is better and some is worse. there is no such thing as best. The computer community is filled with techno religious nuts who want you to know that their opinion is important whether it deserves to be or not. Sometimes these opinion rise to the level where some think it is common wisdom. This also is bs. Stay away from anyone who tries to tell you what best practice is. Just ask for what is a good way to do something.

“add an own application with a lot of dependencies”
So you have an application with dependencies. This could mean several things but you seem to mean libraries.

“to thrid party libraries”
What do you mean by 3rd party libraries? What are first party and second party libraries? You could mean open source libraries or proprietary libraries.

“add an own application”
Do you want to run your application on QNX? Obviously that QNX system would need to have any libraries required by your application. Do you want to know how to do that? Do you want the application to just start when the computer boots?

“When I add the 3rd party libraries to the main image”
By main image, do you mean the boot image? Unless you are running a filesystemless kiosk type application, you can put the libraries in either the boot image or on the file system. The differences in preformance should be minimal, as should the startup time, although putting it in the file system is usually more flexible.

“the boot steps tooks more time”
Do you mean it takes longer to boot? What steps are you talking about? The sequential starting of programs? What do you mean by more time? A minute, a second, a millisecond. If it is something macroscopic then the problem probably has nothing to do with your application and its libraries. If it is microscopic, you only would have a reason to worry about this if you have some specific time constraints such as, from power on to application must be under .200ms.

“Should I use a separate image partition?”
Do you mean, is it possible to build an image file system and jam it onto the boot file so that after booting, everything is in memory. Yes. You might also be putting one or both of these in flash. I can’t imagine that this will impact the time to boot significantly.

If you want to have a system get up and running quickly, you should check with QNX/Blackberry to see if they still have their “fast boot” kit. The idea is that a typical bios or startup does a lot of checking for hardware. If you have static known hardware, you can avoid this and get things going very fast. I’ve seen boards that could go from power on to running an OpenGL gear demo program in less than 2 seconds.

Thanks a lot for your answere. I’m trying to not ask a junk questions, just to sort my thoughts :smiley:

From birds view, we have:

  • QNX system files
  • BSP from board manufactor
  • Our own application
  • Other frameworks our application based on (this is what I called third party libraries)

I think I can narrow down the question to: Should I have the application and the frameworks in the boot image or should they live on a separate file system.

On a first test, I’ve added everything into the bootimage which cause a reset on startup (it tooks more than 5 seconds), I’m not sure why it tooks so much time. The image has only a size of 120MB.
After removing the application and dependencies, pushing them into a separate file system the system is starting (image size 70MB). This is why I’m raising this question.

I think there are also other reasons, like write access to got to a separate file system…

Best Fred

If you have a separate filesystem (hard disk / SD card or even flash) you are better off putting your application and 3rd party libraries there.

The main reason people put things in the boot image is because:

  1. They don’t have a separate filesystem on a highly embedded device so they have to put everything in the boot image
  2. Your system is going to be connected to the internet and you are legitimately worried hackers could somehow over write something on your file system.

Our systems have a hard drive (SD card) so pretty much the only thing in the QNX boot image is the disk driver and the commands to mount it so the boot image is very small. The QNX boot image starts the QNX kernel, disk driver, mounts the disk and then calls a startup script on the SD card to do everything else. All the executables (QNX, ours, 3rd party etc) reside on the SD card. This has the advantage for us that doing a software update just requires copying files to the SD card rather than creating QNX boot images.

Tim

Well said Tim. I would add that a console driver is common in the boot file if the system has a monitor so as to provide progress during the boot. This can be invaluable if the boot hangs somewhere.

Ok guys, thanks a lot. I think I got a picture about this topic :smiley: