[英]Embedded Linux Boot Optimization
I am doing project on Pandaboard using Embedded Linux (UBUNTU 12.10 Server Prebuild image) to optimize boot time. 我正在使用嵌入式Linux(UBUNTU 12.10 Server Prebuild映像)在Pandaboard上进行项目,以优化启动时间。 I need techniques or tools through which I can find boot time and techniques to optimize the boot time.
我需要可以找到启动时间的技术或工具,以及可以优化启动时间的技术。 If anyone can help.
如果有人可以帮助。
只需从/etc/init.d/rc文件中删除不需要的应用程序,并在每次进程初始化后放入echo,并检查哪个进程需要花费很多时间启动,如果您发现花费更多时间的应用程序,则对该应用程序进行调试,等等。上。
There is program that can be helpful to know the approximate boot-up time. 有一些程序可以帮助您了解大约的启动时间。 Check this link Time Stamp .
检查此链接时间戳 。
First of all the best you have to do is to compile yourself your own made kernel, get the source on the internet and do a make xconfig
and then unselected everythin you don't need. 首先,您要做的最好的事情就是编译自己的内核,在Internet上获取源代码并执行
make xconfig
,然后在不需要的所有内容上进行选择。 In a second time create your own root filesystem using Buildroot and make xconfig
to select/unselect everything you need or not. 第二次使用Buildroot创建您自己的根文件系统,
make xconfig
选择/取消选择您需要或不需要的所有内容。
Hope this help. 希望能有所帮助。
I had the same problem and do that way, now it's clearly not the same ;) 我遇到了同样的问题,并且这样做了,现在显然不一样了;)
to analyze the boot process, you can use Bootchart2 , its available on github: https://github.com/mmeeks/bootchart 要分析启动过程,可以使用Bootchart2 ,它可以在github上找到: https : //github.com/mmeeks/bootchart
or Bootchart , from the Ubuntu packages: 或Bootchart ,来自Ubuntu软件包:
sudo apt-get update
sudo apt-get install bootchart pybootchartgui
There are broadly 3 areas where you can reduce boot time 您可以大致在3个领域中减少启动时间
For more techniques and information on tools that help in measuring the boot time please refer to the following link. 有关有助于测量启动时间的工具的更多技术和信息,请参考以下链接。 Refer to Training Material
请参阅培训材料
The basic rule is: the fastest code is code that never gets loaded and run, so remove everything you don't need: 基本规则是:最快的代码是永远不会加载和运行的代码,因此请删除不需要的所有内容 :
What can be acchieved by combining all these measures can be seen in this video - and yes, the complete code for this optimization is available here . 结合所有这些措施可以达到的目的可以在本视频中看到-是的, 此处提供了此优化的完整代码。
Optimizing embedded Linux Boot process , needs modifications in three level of embedded Linux design. 优化嵌入式Linux的启动过程,需要对嵌入式Linux设计的三个层次进行修改。
Note: you will need the source codes of bootloader and kernel 注意:您将需要Bootloader和内核的源代码
Kernel : for having a quicker kernel , you should optimize kernel in many sections. 内核:为了拥有更快的内核,您应该在许多部分中优化内核。 for editing you can use on of Linux config menu.
要进行编辑,您可以使用Linux配置菜单上的。 I always use a low graphic menu.
我总是使用较低的图形菜单。 it need some dependency you can use it by this command:
它需要一些依赖性,您可以通过以下命令使用它:
$ make menuconfig $ make menuconfig
our goal for Linux kernel is to have smaller kernel image and less module to load in boot. 我们对Linux内核的目标是在引导时加载更小的内核映像和更少的模块。 first change the algorithm of compression from gzip to LZO.
首先将压缩算法从gzip更改为LZO。 the point of this action is gzip algorithm will take much time to extract kernel.
该操作的要点是gzip算法将花费大量时间来提取内核。 by using LZO we have a quicker kernel decompression process.
通过使用LZO,我们可以更快地进行内核解压缩。 the second , disable any unnecessary driver or module that you don't have it on your board or you don't use it any more.
第二,禁用您不需要的驱动程序或模块,或者您不再使用它。 by doing this , you will lose some device access and cannot use them in Linux but you will have two positive points: less Ram usage , quicker boot time.
这样,您将失去一些设备访问权限,并且无法在Linux中使用它们,但是您将获得两个积极的方面:更少的Ram使用率,更快的启动时间。 but please remind that some driver are necessary for Linux and by disabling them you will lose some of main features (for example if you disable I2C driver in Linux you will no longer have a HDMI interface) that you need or in worst case you will have a boot problem (such as boot-loop).
但是请注意,某些驱动程序对于Linux是必需的,并且禁用它们会丢失一些主要功能(例如,如果在Linux中禁用I2C驱动程序,则将不再具有HDMI接口),或者在最坏的情况下,您将拥有引导问题(例如引导循环)。 The third is to disable some of unusable filesystem to reduce kernel size and boot time.
第三是禁用一些不可用的文件系统,以减少内核大小和启动时间。 The Fourth is to remove some of compression algorithm to have smaller kernel image.
第四是删除一些压缩算法以具有较小的内核映像。 the last thing , If you are using a u-boot bootloader create a uImage instead of zImage.
最后,如果您使用的是u-boot引导程序,请创建一个uImage而不是zImage。 the following steps , are general and main actions , for having quicker boot as 1 second after power attach you should change more option.
以下步骤是常规操作和主要操作,为使电源连接后1秒钟更快启动,您应该更改更多选项。
if you do all of following tasks , you can have quick boot time and fast system to work with. 如果执行以下所有任务,则可以缩短启动时间并快速使用系统。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.