Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/docs
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (9 years ago)
- Location:
- branches/3.3
- Files:
-
- 3 added
- 4 deleted
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/docs/cgi/env.html
r2725 r3621 39 39 </p><ul> 40 40 <li> <a name="protocol"><code>SERVER_PROTOCOL</code></a> <p> 41 The name and revision of the information prot col this request came41 The name and revision of the information protocol this request came 42 42 in with. Format: protocol/revision </p><p> 43 43 -
branches/3.3/mindi-busybox/docs/ifupdown_design.txt
r2725 r3621 22 22 int i ; 23 23 for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { 24 if (ex ists_execable(ext_dhcp_clients[i].name))24 if (executable_exists(ext_dhcp_clients[i].name)) 25 25 return execute(ext_dhcp_clients[i].stopcmd, ifd, exec); 26 26 } -
branches/3.3/mindi-busybox/docs/keep_data_small.txt
r2725 r3621 104 104 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); 105 105 106 Typically it is done in <applet>_main(). 106 Typically it is done in <applet>_main(). Another variation is 107 to use stack: 108 109 int <applet>_main(...) 110 { 111 #undef G 112 struct globals G; 113 memset(&G, 0, sizeof(G)); 114 SET_PTR_TO_GLOBALS(&G); 107 115 108 116 Now you can reference "globals" by G.a, G.buf and so on, in any function. … … 137 145 #define dev_fd (G.dev_fd) 138 146 #define sector (G.sector) 139 140 141 Word of caution142 143 If applet doesn't use much of global data, converting it to use144 one of above methods is not worth the resulting code obfuscation.145 If you have less than ~300 bytes of global data - don't bother.146 147 147 148 … … 224 225 225 226 Keeping code small 227 228 Use scripts/bloat-o-meter to check whether introduced changes 229 didn't generate unnecessary bloat. This script needs unstripped binaries 230 to generate a detailed report. To automate this, just use 231 "make bloatcheck". It requires busybox_old binary to be present, 232 use "make baseline" to generate it from unmodified source, or 233 copy busybox_unstripped to busybox_old before modifying sources 234 and rebuilding. 226 235 227 236 Set CONFIG_EXTRA_CFLAGS="-fno-inline-functions-called-once", -
branches/3.3/mindi-busybox/docs/logging_and_backgrounding.txt
r2725 r3621 46 46 otherwise logs to stderr, but option -S makes it log *also* to syslog 47 47 zcip - auto-backgrounds and logs *also* to syslog unless -f 48 behaviour can be overridden with experimental LOGGING env.var 49 (can be set to either "none" or "syslog") 48 50 49 51 Total: 13 applets (+1 obsolete), -
branches/3.3/mindi-busybox/docs/mdev.txt
r3232 r3621 52 52 53 53 The file has the format: 54 [-] <device regex> <uid>:<gid> <permissions>54 [-][envmatch]<device regex> <uid>:<gid> <permissions> 55 55 or 56 @<maj[,min1[-min2]]> <uid>:<gid> <permissions>56 [envmatch]@<maj[,min1[-min2]]> <uid>:<gid> <permissions> 57 57 or 58 58 $envvar=<regex> <uid>:<gid> <permissions> -
branches/3.3/mindi-busybox/docs/new-applet-HOWTO.txt
r3232 r3621 7 7 Matt Kraai - initial writeup 8 8 Mark Whitley - the remix 9 Thomas Lundquist - Trying to keep it updated.9 Thomas Lundquist - trying to keep it updated 10 10 11 11 When doing this you should consider using the latest git HEAD. … … 17 17 First, write your applet. Be sure to include copyright information at the top, 18 18 such as who you stole the code from and so forth. Also include the mini-GPL 19 boilerplate . Be sure to name the main function <applet>_main instead of main.20 And be sure to put it in <applet>.c. Usage does not have to be taken care of by 21 your applet. 22 Make sure to #include "libbb.h"as the first include file in your applet.19 boilerplate and Config.in/Kbuild/usage/applet.h snippets (more on that below 20 in this document). Be sure to name the main function <applet>_main instead 21 of main. And be sure to put it in <applet>.c. Make sure to #include "libbb.h" 22 as the first include file in your applet. 23 23 24 24 For a new applet mu, here is the code that would go in mu.c: 25 25 26 ( busybox.h already includes most usual header files. You do not need26 (libbb.h already includes most usual header files. You do not need 27 27 #include <stdio.h> etc...) 28 28 … … 42 42 #include "other.h" 43 43 44 //config:config MU 45 //config: bool "MU" 46 //config: default y 47 //config: help 48 //config: Returns an indeterminate value. 49 50 //kbuild:lib-$(CONFIG_MU) += mu.o 51 //applet:IF_MU(APPLET(mu, BB_DIR_USR_BIN, BB_SUID_DROP)) 52 53 //usage:#define mu_trivial_usage 54 //usage: "[-abcde] FILE..." 55 //usage:#define mu_full_usage 56 //usage: "Returns an indeterminate value\n" 57 //usage: "\n -a First function" 58 //usage: "\n -b Second function" 59 44 60 int mu_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 45 61 int mu_main(int argc, char **argv) … … 91 107 #include "other.h" 92 108 109 //kbuild:lib-y += function.o 110 93 111 int function(char *a) 94 112 { … … 98 116 ----end example code------ 99 117 100 Add <function_name>.o in the right alphabetically sorted place 101 in libbb/Kbuild.src. You should look at the conditional part of 102 libbb/Kbuild.src as well. 118 Remember about the kbuild snippet. 103 119 104 120 You should also try to find a suitable place in include/libbb.h for … … 110 126 111 127 128 Kbuild/Config.in/usage/applets.h snippets in .c files 129 ----------------------------------------------------- 130 131 The old way of adding new applets was to put all the information needed by the 132 configuration and build system into appropriate files (namely: Kbuild.src and 133 Config.src in new applet's directory) and to add the applet declaration and 134 usage info text to include/applets.src.h and include/usage.src.h respectively. 135 136 Since the scripts/gen_build_files.sh script had been introduced, the preferred 137 way is to have all these declarations contained within the applet .c files. 138 139 Every line intended to be processed by gen_build_files.sh should start as a 140 comment without any preceding whitespaces and be followed by an appropriate 141 keyword - kbuild, config, usage or applet - and a colon, just like shown in the 142 first example above. 143 144 112 145 Placement / Directory 113 146 --------------------- … … 115 148 Find the appropriate directory for your new applet. 116 149 117 Make sure you find the appropriate places in the files, the applets are 118 sorted alphabetically. 119 120 Add the applet to Kbuild.src in the chosen directory: 121 122 lib-$(CONFIG_MU) += mu.o 123 124 Add the applet to Config.src in the chosen directory: 125 126 config MU 127 bool "MU" 128 default n 129 help 130 Returns an indeterminate value. 150 Add the kbuild snippet to the .c file: 151 152 //kbuild:lib-$(CONFIG_MU) += mu.o 153 154 Add the config snippet to the .c file: 155 156 //config:config MU 157 //config: bool "MU" 158 //config: default y 159 //config: help 160 //config: Returns an indeterminate value. 131 161 132 162 … … 134 164 --------------- 135 165 136 Next, add usage information for you applet to include/usage.src.h.166 Next, add usage information for your applet to the .c file. 137 167 This should look like the following: 138 168 139 #define mu_trivial_usage \ 140 "-[abcde] FILES" 141 #define mu_full_usage \ 142 "Returns an indeterminate value.\n\n" \ 143 "Options:\n" \ 144 "\t-a\t\tfirst function\n" \ 145 "\t-b\t\tsecond function\n" \ 146 ... 169 //usage:#define mu_trivial_usage 170 //usage: "[-abcde] FILE..." 171 //usage:#define mu_full_usage 172 //usage: "Returns an indeterminate value\n" 173 //usage: "\n -a First function" 174 //usage: "\n -b Second function" 175 //usage: ... 147 176 148 177 If your program supports flags, the flags should be mentioned on the first 149 line (-[abcde]) and a detailed description of each flag should go in the 150 mu_full_usage section, one flag per line. (Numerous examples of this 151 currently exist in usage.src.h.) 178 line ([-abcde]) and a detailed description of each flag should go in the 179 mu_full_usage section, one flag per line. 152 180 153 181 … … 155 183 ------------ 156 184 157 Next, add an entry to include/applets.src.h. Be *sure* to keep the list 158 in alphabetical order, or else it will break the binary-search lookup 159 algorithm in busybox.c and the Gods of BusyBox smite you. Yea, verily: 160 161 Be sure to read the top of applets.src.h before adding your applet. 162 163 /* all programs above here are alphabetically "less than" 'mu' */ 164 IF_MU(APPLET(mu, BB_DIR_USR_BIN, BB_SUID_DROP)) 165 /* all programs below here are alphabetically "greater than" 'mu' */ 185 Finally add the applet declaration snippet. Be sure to read the top of 186 applets.src.h before adding your applet - it contains important info 187 on applet macros and conventions. 188 189 //applet:IF_MU(APPLET(mu, BB_DIR_USR_BIN, BB_SUID_DROP)) 166 190 167 191 -
branches/3.3/mindi-busybox/docs/posix_conformance.txt
r2725 r3621 179 179 conv=notrunc | yes | | 180 180 conv=sync | yes | | 181 iflag=skip_bytes| yes | | 181 182 dd Busybox specific options: 182 183 conv=fsync
Note:
See TracChangeset
for help on using the changeset viewer.