运行 如何在 linux 开机后自动执行

How to run executable after bootup automatically in linux

我正在为 I.MX6 板使用 poky 构建工具链。使用内核版本 3.14.38 和 poky 版本 1.8。我可以在启动后使用命令 ./Executable 手动 运行 应用程序。但应用程序需要在启动后自动 运行。有什么办法吗。

您可以为此使用初始化系统。 参见 https://en.m.wikipedia.org/wiki/Init。根据您的系统设置,您将拥有 busybox-init、sysv-init 或 systemd。找出你有什么,并用它来自动启动你的程序。

如@Frank 所述,您可以提供一个启动脚本来启动您的程序。就像我在这个 recipe

中所做的那样

您会找到有关 INITSCRIPT_NAME in the Yocto Reference Manual 的更多详细信息。