Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/docs/new-applet-HOWTO.txt
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/docs/new-applet-HOWTO.txt
r1765 r2725 9 9 Thomas Lundquist - Trying to keep it updated. 10 10 11 When doing this you should consider using the latest svn trunk.12 This is a good thing if you plan to getting it commit ed into mainline.11 When doing this you should consider using the latest git HEAD. 12 This is a good thing if you plan to getting it committed into mainline. 13 13 14 14 Initial Write … … 20 20 And be sure to put it in <applet>.c. Usage does not have to be taken care of by 21 21 your applet. 22 Make sure to #include "libbb.h" as the first include file in your applet so 23 the bb_config.h and appropriate platform specific files are included properly. 22 Make sure to #include "libbb.h" as the first include file in your applet. 24 23 25 24 For a new applet mu, here is the code that would go in mu.c: … … 37 36 * Copyright (C) [YEAR] by [YOUR NAME] <YOUR EMAIL> 38 37 * 39 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.38 * Licensed under GPLv2, see file LICENSE in this source tree. 40 39 */ 41 40 … … 43 42 #include "other.h" 44 43 45 int mu_main(int argc, char **argv) ;44 int mu_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 46 45 int mu_main(int argc, char **argv) 47 46 { 48 47 int fd; 48 ssize_t n; 49 49 char mu; 50 50 … … 99 99 100 100 Add <function_name>.o in the right alphabetically sorted place 101 in libbb/Kbuild. You should look at the conditional part of102 libbb/Kbuild aswell.101 in libbb/Kbuild.src. You should look at the conditional part of 102 libbb/Kbuild.src as well. 103 103 104 104 You should also try to find a suitable place in include/libbb.h for … … 106 106 ifdefs to include or not. 107 107 108 You can look at libbb/Config. inand try to find out if the function is109 tun eable and add it there if it is.108 You can look at libbb/Config.src and try to find out if the function is 109 tunable and add it there if it is. 110 110 111 111 … … 118 118 sorted alphabetically. 119 119 120 Add the applet to Kbuild in the chosen directory:120 Add the applet to Kbuild.src in the chosen directory: 121 121 122 122 lib-$(CONFIG_MU) += mu.o 123 123 124 Add the applet to Config. inin the chosen directory:124 Add the applet to Config.src in the chosen directory: 125 125 126 config CONFIG_MU126 config MU 127 127 bool "MU" 128 128 default n … … 134 134 --------------- 135 135 136 Next, add usage information for you applet to include/usage. h.136 Next, add usage information for you applet to include/usage.src.h. 137 137 This should look like the following: 138 138 … … 149 149 line (-[abcde]) and a detailed description of each flag should go in the 150 150 mu_full_usage section, one flag per line. (Numerous examples of this 151 currently exist in usage. h.)151 currently exist in usage.src.h.) 152 152 153 153 … … 155 155 ------------ 156 156 157 Next, add an entry to include/applets. h. Be *sure* to keep the list157 Next, add an entry to include/applets.src.h. Be *sure* to keep the list 158 158 in alphabetical order, or else it will break the binary-search lookup 159 159 algorithm in busybox.c and the Gods of BusyBox smite you. Yea, verily: 160 160 161 Be sure to read the top of applets. h before adding your applet.161 Be sure to read the top of applets.src.h before adding your applet. 162 162 163 163 /* all programs above here are alphabetically "less than" 'mu' */ 164 USE_MU(APPLET(mu, _BB_DIR_USR_BIN, _BB_SUID_NEVER))164 IF_MU(APPLET(mu, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 165 165 /* all programs below here are alphabetically "greater than" 'mu' */ 166 166 … … 169 169 ---------------------- 170 170 171 Then create a diff by adding the new files with svn(remember your libbb files)172 svnadd <where you put it>/mu.c171 Then create a diff by adding the new files to git (remember your libbb files) 172 git add <where you put it>/mu.c 173 173 eventually also: 174 svnadd libbb/function.c174 git add libbb/function.c 175 175 then 176 svn diff 176 git commit 177 git format-patch HEAD^ 177 178 and send it to the mailing list: 178 179 busybox@busybox.net
Note:
See TracChangeset
for help on using the changeset viewer.