【转载】busybox中添加自己的程序
2012-01-04 22:57
141 查看
To add a new applet to Busybox, first pick a name for the applet and a corresponding CONFIG_NAME. Then do this:
Figure out where in the Busybox source tree your applet best fits, and put your source code there. Be sure to use APPLET_main() instead of main(), where APPLET is the name of your applet.
Add your applet to the relevant Config.in file (which file you add it to determines where it shows up in "make menuconfig"). This uses the same general format as the linux kernel's configuration system.
Add your applet to the relevant Kbuild file (in the same directory as the Config.in you chose), using the existing entries as a template and the same CONFIG symbol as you used for Config.in.
Add your applet to "include/applets.h", using one of the existing entries as a template. (Note: they are in alphabetical order. Applets are found via binary search, and if you add an applet out of order it won't work.)
Add your applet's runtime help text to "include/usage.h". You need at least appname_trivial_usage (the minimal help text, always included in the Busybox binary when this applet is enabled) and appname_full_usage (extra help text included in the Busybox
binary with CONFIG_FEATURE_VERBOSE_USAGE is enabled), or it won't compile. The other two help entry types (appname_example_usage and appname_notes_usage) are optional. They don't take up space in the binary, but instead show up in the generated documentation
(BusyBox.html, BusyBox.txt, and the man page busybox.1).
Run menuconfig, switch your applet on, compile, test, and fix the bugs. Be sure to try both "allyesconfig" and "allnoconfig".
Figure out where in the Busybox source tree your applet best fits, and put your source code there. Be sure to use APPLET_main() instead of main(), where APPLET is the name of your applet.
Add your applet to the relevant Config.in file (which file you add it to determines where it shows up in "make menuconfig"). This uses the same general format as the linux kernel's configuration system.
Add your applet to the relevant Kbuild file (in the same directory as the Config.in you chose), using the existing entries as a template and the same CONFIG symbol as you used for Config.in.
Add your applet to "include/applets.h", using one of the existing entries as a template. (Note: they are in alphabetical order. Applets are found via binary search, and if you add an applet out of order it won't work.)
Add your applet's runtime help text to "include/usage.h". You need at least appname_trivial_usage (the minimal help text, always included in the Busybox binary when this applet is enabled) and appname_full_usage (extra help text included in the Busybox
binary with CONFIG_FEATURE_VERBOSE_USAGE is enabled), or it won't compile. The other two help entry types (appname_example_usage and appname_notes_usage) are optional. They don't take up space in the binary, but instead show up in the generated documentation
(BusyBox.html, BusyBox.txt, and the man page busybox.1).
Run menuconfig, switch your applet on, compile, test, and fix the bugs. Be sure to try both "allyesconfig" and "allnoconfig".
相关文章推荐
- C# C/S程序获取MAC地址三种方法 转载自http://www.cnblogs.com/yzb305070/archive/2011/04/03/2004364.html 添加了一些自己的经验
- 让在vc6创建的程序中,控件可以随xp风格的改变而变化,不用再程序中添加代码来自己实现~
- 【翻译加转载】自己开发Blog博客程序:关于MetaWeblogAPI 的实现
- Ubuntu添加开机自动启动程序的方法(转载)
- 为c#服务添加安装程序【转载】
- Ubuntu 12.04的gnome classic panel添加程序快捷键(转载)
- 【转】给自己的Blog程序添加对Windows Live Writer的支持
- visual studio 2010 winform程序不能添加对system.web的引用[转载]
- ubuntu 11.10如何将自己的程序添加到应用程序中?
- 近百android程序源码贡献 转载的自己看的
- 如何向busybox添加自己的命令
- 添加IE右键菜单 以 调用和运行 自己的程序或文件
- [转载]自己编写 php 在线问卷调查程序
- 如何在Blackfin上已移植的uClinux系统中添加自己编写的程序
- 给自己的 Blog程序添加对Windows Live Writer的支持
- 为自己的RCP程序添加帮助内容(Help Contents)
- 如何向busybox添加自己的命令
- caffe框架下添加自己的MFC程序(下)
- 给自己的程序添加一个控制台
- 在程序中重启自己的一种方法 (转载)