diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-13 14:23:12 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-13 14:23:12 +0000 |
commit | 2b2183a77d7e8a01723fb96e7a39f109b15475f4 (patch) | |
tree | 3f7c27589c441fd1b82c8487b2c8eea70ee3d356 | |
parent | 323cbbfaa25f6bdc1ef343db01e58da3fea7fe6d (diff) | |
download | busybox-w32-2b2183a77d7e8a01723fb96e7a39f109b15475f4.tar.gz busybox-w32-2b2183a77d7e8a01723fb96e7a39f109b15475f4.tar.bz2 busybox-w32-2b2183a77d7e8a01723fb96e7a39f109b15475f4.zip |
hush: make function support configurable
-rw-r--r-- | scripts/defconfig | 45 | ||||
-rw-r--r-- | shell/Config.in | 35 | ||||
-rw-r--r-- | shell/hush.c | 2 |
3 files changed, 50 insertions, 32 deletions
diff --git a/scripts/defconfig b/scripts/defconfig index 166989bba..50a6a33ab 100644 --- a/scripts/defconfig +++ b/scripts/defconfig | |||
@@ -1,10 +1,8 @@ | |||
1 | # defconfig is allyesconfig minus any features that are | 1 | # |
2 | # specialized (debugging etc) or make applet behavior change | 2 | # Automatically generated make config: don't edit |
3 | # significantly from "standard" version of utilities. | 3 | # Busybox version: 1.14.0.svn |
4 | # Applets which are severely incompatible with "standard" utilities | 4 | # Mon Apr 13 16:22:36 2009 |
5 | # or are not maintained /tested for some time, appear to be buggy | 5 | # |
6 | # and carry serious potential of breakage if used, may also be excluded | ||
7 | |||
8 | CONFIG_HAVE_DOT_CONFIG=y | 6 | CONFIG_HAVE_DOT_CONFIG=y |
9 | 7 | ||
10 | # | 8 | # |
@@ -49,6 +47,7 @@ CONFIG_FEATURE_HAVE_RPC=y | |||
49 | # CONFIG_FEATURE_SHARED_BUSYBOX is not set | 47 | # CONFIG_FEATURE_SHARED_BUSYBOX is not set |
50 | CONFIG_LFS=y | 48 | CONFIG_LFS=y |
51 | CONFIG_CROSS_COMPILER_PREFIX="" | 49 | CONFIG_CROSS_COMPILER_PREFIX="" |
50 | CONFIG_EXTRA_CFLAGS="" | ||
52 | 51 | ||
53 | # | 52 | # |
54 | # Debugging Options | 53 | # Debugging Options |
@@ -210,6 +209,8 @@ CONFIG_RMDIR=y | |||
210 | CONFIG_FEATURE_RMDIR_LONG_OPTIONS=y | 209 | CONFIG_FEATURE_RMDIR_LONG_OPTIONS=y |
211 | CONFIG_SEQ=y | 210 | CONFIG_SEQ=y |
212 | CONFIG_SHA1SUM=y | 211 | CONFIG_SHA1SUM=y |
212 | CONFIG_SHA256SUM=y | ||
213 | CONFIG_SHA512SUM=y | ||
213 | CONFIG_SLEEP=y | 214 | CONFIG_SLEEP=y |
214 | CONFIG_FEATURE_FANCY_SLEEP=y | 215 | CONFIG_FEATURE_FANCY_SLEEP=y |
215 | CONFIG_FEATURE_FLOAT_SLEEP=y | 216 | CONFIG_FEATURE_FLOAT_SLEEP=y |
@@ -389,6 +390,7 @@ CONFIG_FEATURE_SHADOWPASSWDS=y | |||
389 | CONFIG_USE_BB_PWD_GRP=y | 390 | CONFIG_USE_BB_PWD_GRP=y |
390 | CONFIG_USE_BB_SHADOW=y | 391 | CONFIG_USE_BB_SHADOW=y |
391 | CONFIG_USE_BB_CRYPT=y | 392 | CONFIG_USE_BB_CRYPT=y |
393 | CONFIG_USE_BB_CRYPT_SHA=y | ||
392 | CONFIG_ADDGROUP=y | 394 | CONFIG_ADDGROUP=y |
393 | CONFIG_FEATURE_ADDUSER_TO_GROUP=y | 395 | CONFIG_FEATURE_ADDUSER_TO_GROUP=y |
394 | CONFIG_DELGROUP=y | 396 | CONFIG_DELGROUP=y |
@@ -425,8 +427,6 @@ CONFIG_LSATTR=y | |||
425 | # | 427 | # |
426 | # Linux Module Utilities | 428 | # Linux Module Utilities |
427 | # | 429 | # |
428 | CONFIG_DEFAULT_MODULES_DIR="/lib/modules" | ||
429 | CONFIG_DEFAULT_DEPMOD_FILE="modules.dep" | ||
430 | CONFIG_MODPROBE_SMALL=y | 430 | CONFIG_MODPROBE_SMALL=y |
431 | CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE=y | 431 | CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE=y |
432 | CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y | 432 | CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y |
@@ -450,10 +450,14 @@ CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y | |||
450 | # CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set | 450 | # CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set |
451 | # CONFIG_FEATURE_MODUTILS_ALIAS is not set | 451 | # CONFIG_FEATURE_MODUTILS_ALIAS is not set |
452 | # CONFIG_FEATURE_MODUTILS_SYMBOLS is not set | 452 | # CONFIG_FEATURE_MODUTILS_SYMBOLS is not set |
453 | CONFIG_DEFAULT_MODULES_DIR="/lib/modules" | ||
454 | CONFIG_DEFAULT_DEPMOD_FILE="modules.dep" | ||
453 | 455 | ||
454 | # | 456 | # |
455 | # Linux System Utilities | 457 | # Linux System Utilities |
456 | # | 458 | # |
459 | CONFIG_ACPID=y | ||
460 | CONFIG_FEATURE_ACPID_COMPAT=y | ||
457 | CONFIG_BLKID=y | 461 | CONFIG_BLKID=y |
458 | CONFIG_DMESG=y | 462 | CONFIG_DMESG=y |
459 | CONFIG_FEATURE_DMESG_PRETTY=y | 463 | CONFIG_FEATURE_DMESG_PRETTY=y |
@@ -479,6 +483,7 @@ CONFIG_MKFS_MINIX=y | |||
479 | # Minix filesystem support | 483 | # Minix filesystem support |
480 | # | 484 | # |
481 | CONFIG_FEATURE_MINIX2=y | 485 | CONFIG_FEATURE_MINIX2=y |
486 | CONFIG_MKFS_VFAT=y | ||
482 | CONFIG_GETOPT=y | 487 | CONFIG_GETOPT=y |
483 | CONFIG_HEXDUMP=y | 488 | CONFIG_HEXDUMP=y |
484 | CONFIG_FEATURE_HEXDUMP_REVERSE=y | 489 | CONFIG_FEATURE_HEXDUMP_REVERSE=y |
@@ -561,6 +566,7 @@ CONFIG_CHRT=y | |||
561 | CONFIG_CROND=y | 566 | CONFIG_CROND=y |
562 | CONFIG_FEATURE_CROND_D=y | 567 | CONFIG_FEATURE_CROND_D=y |
563 | CONFIG_FEATURE_CROND_CALL_SENDMAIL=y | 568 | CONFIG_FEATURE_CROND_CALL_SENDMAIL=y |
569 | CONFIG_FEATURE_CROND_DIR="/var/spool/cron" | ||
564 | CONFIG_CRONTAB=y | 570 | CONFIG_CRONTAB=y |
565 | CONFIG_DC=y | 571 | CONFIG_DC=y |
566 | CONFIG_FEATURE_DC_LIBM=y | 572 | CONFIG_FEATURE_DC_LIBM=y |
@@ -573,6 +579,8 @@ CONFIG_DEVMEM=y | |||
573 | CONFIG_EJECT=y | 579 | CONFIG_EJECT=y |
574 | CONFIG_FEATURE_EJECT_SCSI=y | 580 | CONFIG_FEATURE_EJECT_SCSI=y |
575 | CONFIG_FBSPLASH=y | 581 | CONFIG_FBSPLASH=y |
582 | CONFIG_FLASH_ERASEALL=y | ||
583 | CONFIG_IONICE=y | ||
576 | # CONFIG_INOTIFYD is not set | 584 | # CONFIG_INOTIFYD is not set |
577 | CONFIG_LAST=y | 585 | CONFIG_LAST=y |
578 | # CONFIG_FEATURE_LAST_SMALL is not set | 586 | # CONFIG_FEATURE_LAST_SMALL is not set |
@@ -581,11 +589,11 @@ CONFIG_LESS=y | |||
581 | CONFIG_FEATURE_LESS_MAXLINES=9999999 | 589 | CONFIG_FEATURE_LESS_MAXLINES=9999999 |
582 | CONFIG_FEATURE_LESS_BRACKETS=y | 590 | CONFIG_FEATURE_LESS_BRACKETS=y |
583 | CONFIG_FEATURE_LESS_FLAGS=y | 591 | CONFIG_FEATURE_LESS_FLAGS=y |
584 | CONFIG_FEATURE_LESS_DASHCMD=y | ||
585 | CONFIG_FEATURE_LESS_MARKS=y | 592 | CONFIG_FEATURE_LESS_MARKS=y |
586 | CONFIG_FEATURE_LESS_REGEXP=y | 593 | CONFIG_FEATURE_LESS_REGEXP=y |
587 | CONFIG_FEATURE_LESS_LINENUMS=y | ||
588 | CONFIG_FEATURE_LESS_WINCH=y | 594 | CONFIG_FEATURE_LESS_WINCH=y |
595 | CONFIG_FEATURE_LESS_DASHCMD=y | ||
596 | CONFIG_FEATURE_LESS_LINENUMS=y | ||
589 | CONFIG_HDPARM=y | 597 | CONFIG_HDPARM=y |
590 | CONFIG_FEATURE_HDPARM_GET_IDENTITY=y | 598 | CONFIG_FEATURE_HDPARM_GET_IDENTITY=y |
591 | CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y | 599 | CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y |
@@ -609,6 +617,7 @@ CONFIG_STRINGS=y | |||
609 | # CONFIG_TASKSET is not set | 617 | # CONFIG_TASKSET is not set |
610 | # CONFIG_FEATURE_TASKSET_FANCY is not set | 618 | # CONFIG_FEATURE_TASKSET_FANCY is not set |
611 | CONFIG_TIME=y | 619 | CONFIG_TIME=y |
620 | CONFIG_TIMEOUT=y | ||
612 | CONFIG_TTYSIZE=y | 621 | CONFIG_TTYSIZE=y |
613 | CONFIG_WATCHDOG=y | 622 | CONFIG_WATCHDOG=y |
614 | 623 | ||
@@ -626,6 +635,8 @@ CONFIG_FEATURE_BRCTL_SHOW=y | |||
626 | CONFIG_DNSD=y | 635 | CONFIG_DNSD=y |
627 | CONFIG_ETHER_WAKE=y | 636 | CONFIG_ETHER_WAKE=y |
628 | CONFIG_FAKEIDENTD=y | 637 | CONFIG_FAKEIDENTD=y |
638 | CONFIG_FTPD=y | ||
639 | CONFIG_FEATURE_FTP_WRITE=y | ||
629 | CONFIG_FTPGET=y | 640 | CONFIG_FTPGET=y |
630 | CONFIG_FTPPUT=y | 641 | CONFIG_FTPPUT=y |
631 | CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y | 642 | CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y |
@@ -723,6 +734,7 @@ CONFIG_FEATURE_UDHCP_PORT=y | |||
723 | CONFIG_FEATURE_UDHCP_RFC3397=y | 734 | CONFIG_FEATURE_UDHCP_RFC3397=y |
724 | CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" | 735 | CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" |
725 | CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 | 736 | CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 |
737 | CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n" | ||
726 | CONFIG_VCONFIG=y | 738 | CONFIG_VCONFIG=y |
727 | CONFIG_WGET=y | 739 | CONFIG_WGET=y |
728 | CONFIG_FEATURE_WGET_STATUSBAR=y | 740 | CONFIG_FEATURE_WGET_STATUSBAR=y |
@@ -730,6 +742,8 @@ CONFIG_FEATURE_WGET_AUTHENTICATION=y | |||
730 | CONFIG_FEATURE_WGET_LONG_OPTIONS=y | 742 | CONFIG_FEATURE_WGET_LONG_OPTIONS=y |
731 | CONFIG_ZCIP=y | 743 | CONFIG_ZCIP=y |
732 | CONFIG_TCPSVD=y | 744 | CONFIG_TCPSVD=y |
745 | CONFIG_TUNCTL=y | ||
746 | CONFIG_FEATURE_TUNCTL_UG=y | ||
733 | CONFIG_UDPSVD=y | 747 | CONFIG_UDPSVD=y |
734 | 748 | ||
735 | # | 749 | # |
@@ -749,8 +763,6 @@ CONFIG_FEATURE_POPMAILDIR_DELIVERY=y | |||
749 | CONFIG_REFORMIME=y | 763 | CONFIG_REFORMIME=y |
750 | CONFIG_FEATURE_REFORMIME_COMPAT=y | 764 | CONFIG_FEATURE_REFORMIME_COMPAT=y |
751 | CONFIG_SENDMAIL=y | 765 | CONFIG_SENDMAIL=y |
752 | CONFIG_FEATURE_SENDMAIL_MAILX=y | ||
753 | CONFIG_FEATURE_SENDMAIL_MAILXX=y | ||
754 | 766 | ||
755 | # | 767 | # |
756 | # Process Utilities | 768 | # Process Utilities |
@@ -768,7 +780,7 @@ CONFIG_FEATURE_PIDOF_OMIT=y | |||
768 | CONFIG_PKILL=y | 780 | CONFIG_PKILL=y |
769 | CONFIG_PS=y | 781 | CONFIG_PS=y |
770 | CONFIG_FEATURE_PS_WIDE=y | 782 | CONFIG_FEATURE_PS_WIDE=y |
771 | CONFIG_FEATURE_PS_TIME=y | 783 | # CONFIG_FEATURE_PS_TIME is not set |
772 | # CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set | 784 | # CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set |
773 | CONFIG_RENICE=y | 785 | CONFIG_RENICE=y |
774 | CONFIG_BB_SYSCTL=y | 786 | CONFIG_BB_SYSCTL=y |
@@ -829,8 +841,6 @@ CONFIG_ASH_JOB_CONTROL=y | |||
829 | CONFIG_ASH_READ_NCHARS=y | 841 | CONFIG_ASH_READ_NCHARS=y |
830 | CONFIG_ASH_READ_TIMEOUT=y | 842 | CONFIG_ASH_READ_TIMEOUT=y |
831 | CONFIG_ASH_ALIAS=y | 843 | CONFIG_ASH_ALIAS=y |
832 | CONFIG_ASH_MATH_SUPPORT=y | ||
833 | CONFIG_ASH_MATH_SUPPORT_64=y | ||
834 | CONFIG_ASH_GETOPTS=y | 844 | CONFIG_ASH_GETOPTS=y |
835 | CONFIG_ASH_BUILTIN_ECHO=y | 845 | CONFIG_ASH_BUILTIN_ECHO=y |
836 | CONFIG_ASH_BUILTIN_PRINTF=y | 846 | CONFIG_ASH_BUILTIN_PRINTF=y |
@@ -848,12 +858,15 @@ CONFIG_HUSH_TICK=y | |||
848 | CONFIG_HUSH_IF=y | 858 | CONFIG_HUSH_IF=y |
849 | CONFIG_HUSH_LOOPS=y | 859 | CONFIG_HUSH_LOOPS=y |
850 | CONFIG_HUSH_CASE=y | 860 | CONFIG_HUSH_CASE=y |
861 | CONFIG_HUSH_FUNCTIONS=y | ||
851 | # CONFIG_LASH is not set | 862 | # CONFIG_LASH is not set |
852 | CONFIG_MSH=y | 863 | CONFIG_MSH=y |
853 | 864 | ||
854 | # | 865 | # |
855 | # Bourne Shell Options | 866 | # Bourne Shell Options |
856 | # | 867 | # |
868 | CONFIG_SH_MATH_SUPPORT=y | ||
869 | CONFIG_SH_MATH_SUPPORT_64=y | ||
857 | CONFIG_FEATURE_SH_EXTRA_QUIET=y | 870 | CONFIG_FEATURE_SH_EXTRA_QUIET=y |
858 | # CONFIG_FEATURE_SH_STANDALONE is not set | 871 | # CONFIG_FEATURE_SH_STANDALONE is not set |
859 | # CONFIG_FEATURE_SH_NOFORK is not set | 872 | # CONFIG_FEATURE_SH_NOFORK is not set |
diff --git a/shell/Config.in b/shell/Config.in index 9b3ce6483..6cc11ce80 100644 --- a/shell/Config.in +++ b/shell/Config.in | |||
@@ -159,16 +159,15 @@ config HUSH | |||
159 | bool "hush" | 159 | bool "hush" |
160 | default n | 160 | default n |
161 | help | 161 | help |
162 | hush is a very small shell (just 18k) and it has fairly complete | 162 | hush is a small shell (22k). It handles the normal flow control |
163 | Bourne shell grammar. It even handles all the normal flow control | 163 | constructs such as if/then/elif/else/fi, for/in/do/done, while loops, |
164 | options such as if/then/elif/else/fi, for/in/do/done, while loops, | 164 | case/esac. Redirections, here documents, $((arithmetic)) |
165 | case/esac. | 165 | and functions are supported. |
166 | 166 | ||
167 | It will compile and work on no-mmu systems. | 167 | It will compile and work on no-mmu systems. |
168 | 168 | ||
169 | It does not handle select, functions, here documents ( << | 169 | It does not handle select, aliases, brace expansion, |
170 | word ), aliases, brace expansion, tilde expansion, | 170 | tilde expansion, &>file and >&file redirection of stdout+stderr. |
171 | &> and >& redirection of stdout+stderr, etc. | ||
172 | 171 | ||
173 | config HUSH_HELP | 172 | config HUSH_HELP |
174 | bool "help builtin" | 173 | bool "help builtin" |
@@ -226,6 +225,13 @@ config HUSH_CASE | |||
226 | help | 225 | help |
227 | Enable case ... esac statement in hush. +400 bytes. | 226 | Enable case ... esac statement in hush. +400 bytes. |
228 | 227 | ||
228 | config HUSH_FUNCTIONS | ||
229 | bool "Support funcname() { commands; } syntax" | ||
230 | default n | ||
231 | depends on HUSH | ||
232 | help | ||
233 | Enable support for shell functions in hush. +800 bytes. | ||
234 | |||
229 | config LASH | 235 | config LASH |
230 | bool "lash (deprecated: aliased to hush)" | 236 | bool "lash (deprecated: aliased to hush)" |
231 | default n | 237 | default n |
@@ -237,16 +243,17 @@ config MSH | |||
237 | bool "msh (deprecated: please use hush)" | 243 | bool "msh (deprecated: please use hush)" |
238 | default n | 244 | default n |
239 | help | 245 | help |
240 | The minix shell (adds just 30k) is quite complete and handles things | ||
241 | like for/do/done, case/esac and all the things you expect a Bourne | ||
242 | shell to do. It is not always pedantically correct about Bourne | ||
243 | shell grammar (try running the shell testscript "tests/sh.testcases" | ||
244 | on it and compare vs bash) but for most things it works quite well. | ||
245 | It uses only vfork, so it can be used on uClinux systems. | ||
246 | |||
247 | msh is deprecated and will be removed, please migrate to hush. | 246 | msh is deprecated and will be removed, please migrate to hush. |
248 | If there is a feature msh has but hush does not, please let us know. | 247 | If there is a feature msh has but hush does not, please let us know. |
249 | 248 | ||
249 | # The minix shell (adds just 30k) is quite complete and handles things | ||
250 | # like for/do/done, case/esac and all the things you expect a Bourne | ||
251 | # shell to do. It is not always pedantically correct about Bourne | ||
252 | # shell grammar (try running the shell testscript "tests/sh.testcases" | ||
253 | # on it and compare vs bash) but for most things it works quite well. | ||
254 | # It uses only vfork, so it can be used on uClinux systems. | ||
255 | |||
256 | |||
250 | comment "Bourne Shell Options" | 257 | comment "Bourne Shell Options" |
251 | depends on MSH || LASH || HUSH || ASH | 258 | depends on MSH || LASH || HUSH || ASH |
252 | 259 | ||
diff --git a/shell/hush.c b/shell/hush.c index 9c2c0f324..ba3e2c3f0 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -83,8 +83,6 @@ | |||
83 | * Keeping 1 for now even in released versions. | 83 | * Keeping 1 for now even in released versions. |
84 | */ | 84 | */ |
85 | #define HUSH_DEBUG 1 | 85 | #define HUSH_DEBUG 1 |
86 | /* In progress... */ | ||
87 | #define ENABLE_HUSH_FUNCTIONS 1 | ||
88 | 86 | ||
89 | 87 | ||
90 | #if BUILD_AS_NOMMU | 88 | #if BUILD_AS_NOMMU |