kbuild transition misc issues
Bernhard Fischer
rep.nop at aon.at
Thu Nov 2 09:06:12 PST 2006
Hi,
Random notes that beg for patches/ideas/comments from any interrested
party..
1) duplicate Config.in entry
$ make oldconfig > /dev/null
.config:525:warning: trying to reassign symbol FEATURE_IFUPDOWN_IP_BUILTIN
.config:637:warning: symbol value '' invalid for FEATURE_COMMAND_HISTORY
And indeed, there is something wrong there:
$ grep -A1 FEATURE_IFUPDOWN_IP_BUILTIN networking/Config.in
config FEATURE_IFUPDOWN_IP_BUILTIN
bool "Use busybox ip applet"
--
config FEATURE_IFUPDOWN_IP_BUILTIN
bool "Use busybox ifconfig and route applets"
Looks like the second one wants another config symbol, no?
2) FEATURE_COMMAND_HISTORY
$ make defconfig > /dev/null ; grep FEATURE_COMMAND_HISTORY .config
CONFIG_FEATURE_COMMAND_HISTORY=
We (try to) guard against improper values in cmdedit.c via
/* Maximum length of the linked list for the command line history */
#ifndef CONFIG_FEATURE_COMMAND_HISTORY
#define MAX_HISTORY 15
#else
#define MAX_HISTORY CONFIG_FEATURE_COMMAND_HISTORY
#endif
#if MAX_HISTORY < 1
#warning cmdedit: You set MAX_HISTORY < 1. The history algorithm
switched off.
#else
static char *history[MAX_HISTORY+1]; /* history + current */
/* saved history lines */
static int n_history;
/* current pointer to history line */
static int cur_history;
#endif
But if i play stoopid (\"Doctor, it hurts when i..\") and
CONFIG_FEATURE_COMMAND_HISTORY=18446744073709551619
which is a tad more than (unsigned long long)-1+3
then i expect that bad things will happen..
I suggest that we do:
2a)
Index: shell/Config.in
===================================================================
--- shell/Config.in (revision 16488)
+++ shell/Config.in (working copy)
@@ -257,6 +257,7 @@
config FEATURE_COMMAND_HISTORY
int "History size"
+ range 0 4294967295
default 15
depends on FEATURE_COMMAND_EDITING
help
to limit it to something vaguely reasonable.
This doesn't seem to work with our fork of the kbuild stuff, i fear.
Lingering bug? Due to our defconfig ignoring all of shell/* ?
2b)
add a check against an upper limit in cmdedit.c
2c) xmalloc the static char *history
3) Config.in and improper CONFIG_foo leftovers
$ find ./ -name Config.in -exec grep -Hirn "[^_F]CONFIG_" {} \;
./networking/Config.in:56: depends on GETOPT_LONG && (CONFIG_FTPGET || FTPPUT)
./networking/Config.in:248: depends on IFUPDOWN && !CONFIG_FEATURE_IFUPDOWN_IP
Are (clear) bugs stemming from an incomplete transition.
thanks for reading that far; friendly,
Bernhard
More information about the busybox
mailing list