[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[busybox] config changes: part 2, regular build



After my attempt to unify configs I think the way I've
choosen is wrong.  So far I don't have enough understanding
of the tasks where the static build is used, this needs to
be changed before any attempt will be made to address
static config.

Below is a proposed config file for the regular deb build.
It enables quite alot of applets and options.  The result
is that busybox is now able to be used as almost complete
(but obviously minimalistic) system for various purposes.
All changes are commented.

--- deb.orig	2011-02-15 12:57:35.458297001 +0300
+++ deb	2011-02-15 14:52:01.529194004 +0300

-CONFIG_FEATURE_NON_POSIX_CP=y
+# CONFIG_FEATURE_NON_POSIX_CP is not set

This has been discussed before.  Make it match
POSIX and cp from regular coreutils.

-CONFIG_FEATURE_COPYBUF_KB=4
+CONFIG_FEATURE_COPYBUF_KB=64

Makes I/O quite a bit faster.

-# CONFIG_FEATURE_SEAMLESS_XZ is not set
+CONFIG_FEATURE_SEAMLESS_XZ=y

All other compression algorithms are
enabled, why not xz?  Note this is not
the algorithm itself, it compression
detection in archival utils like tar.


-# CONFIG_AR is not set
-# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
-# CONFIG_FEATURE_AR_CREATE is not set
+CONFIG_AR=y
+CONFIG_FEATURE_AR_LONG_FILENAMES=y
+CONFIG_FEATURE_AR_CREATE=y

Enable ar applet - if not only to manipulate .deb
files when needed.


-# CONFIG_LZOP is not set
+CONFIG_LZOP=y

Now it's compression algorithm actually.  Very
small, enable it the same way as all the others.


-# CONFIG_FEATURE_TAR_AUTODETECT is not set
+CONFIG_FEATURE_TAR_AUTODETECT=y

Very handy, little code.


-# CONFIG_FEATURE_TR_CLASSES is not set
+CONFIG_FEATURE_TR_CLASSES=y

This is arguable, since it only works for
ascii at the moment.


-# CONFIG_BASE64 is not set
+CONFIG_BASE64=y

Useful applet, small.  New in 1.18.


-# CONFIG_NICE is not set
+CONFIG_NICE=y

Very small and handy utility.


-# CONFIG_SEQ is not set
+CONFIG_SEQ=y

Small utility, used in loops in shell scripts.


-# CONFIG_FEATURE_FLOAT_SLEEP is not set
+CONFIG_FEATURE_FLOAT_SLEEP=y

When one needs to wait for something - for example
for a root device to appear - [s]he can wait in small
intervals (0.1sec) and detect the event in question
much faster than when sleeping in 1s intervals.


-# CONFIG_STAT is not set
-# CONFIG_FEATURE_STAT_FORMAT is not set
+CONFIG_STAT=y
+CONFIG_FEATURE_STAT_FORMAT=y

Very useful in scripts.


-# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y

For checking system integrity.  Can be done (sort of)
using md5sum ... | diff sums, but this is little code
for handy thing.


-# CONFIG_SETCONSOLE is not set
-# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+CONFIG_SETCONSOLE=y
+CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y

-# CONFIG_SETLOGCONS is not set
+CONFIG_SETLOGCONS=y

setconsole and setlogcons - useful little utilities in initramfs.


-# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
+CONFIG_FEATURE_RUN_PARTS_FANCY=y

"Fancy" here means to support --list option.


-# CONFIG_DIFF is not set
-# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
-# CONFIG_FEATURE_DIFF_DIR is not set
+CONFIG_DIFF=y
+CONFIG_FEATURE_DIFF_LONG_OPTIONS=y
+CONFIG_FEATURE_DIFF_DIR=y

Um, diff is a very handy utility.  Not really tiny code (this
diff tries to be small), but very useful.

-# CONFIG_ED is not set
+CONFIG_ED=y

I still think this should be kept enabled.


-# CONFIG_FEATURE_FIND_DELETE is not set
+CONFIG_FEATURE_FIND_DELETE=y

One find feature (from a large list) which were forgotten.


-# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
-# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y

Two missing features for xargs - -p and -x


-# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y

This is xargs -0 - no reason at all why this should
not be enabled.


-# CONFIG_HALT is not set
+CONFIG_HALT=y

-# CONFIG_INIT is not set
-# CONFIG_FEATURE_USE_INITTAB is not set
+CONFIG_INIT=y
+CONFIG_FEATURE_USE_INITTAB=y

-# CONFIG_FEATURE_INIT_SCTTY is not set
-# CONFIG_FEATURE_INIT_SYSLOG is not set
-# CONFIG_FEATURE_EXTRA_QUIET is not set
-# CONFIG_FEATURE_INIT_COREDUMPS is not set
-# CONFIG_FEATURE_INITRD is not set
-CONFIG_INIT_TERMINAL_TYPE=""
+CONFIG_FEATURE_INIT_SCTTY=y
+CONFIG_FEATURE_INIT_SYSLOG=y
+CONFIG_FEATURE_EXTRA_QUIET=y
+CONFIG_FEATURE_INIT_COREDUMPS=y
+CONFIG_FEATURE_INITRD=y
+CONFIG_INIT_TERMINAL_TYPE="linux"

Small init and halt, not directly useful in initramfs,
but very handy for various "small things", up to running
full debian-based diskless workstations.


-# CONFIG_FEATURE_SHADOWPASSWDS is not set
+CONFIG_FEATURE_SHADOWPASSWDS=y

No way we can live without these for some utils below...


-# CONFIG_PASSWD is not set
+CONFIG_PASSWD=y

To be able to change password from pre-init.


-# CONFIG_SU is not set
-# CONFIG_FEATURE_SU_SYSLOG is not set
+CONFIG_SU=y
+CONFIG_FEATURE_SU_SYSLOG=y

su is the only way to run a command as non-root, from
initramfs.  Sulogin

-# CONFIG_SULOGIN is not set
+CONFIG_SULOGIN=y

May be used if mounting of root fais, to ask for a password.


-# CONFIG_CHATTR is not set
+CONFIG_CHATTR=y

-# CONFIG_LSATTR is not set
+CONFIG_LSATTR=y

lsattr and chattr - small utils useful for recovery.


-# CONFIG_MODINFO is not set
+CONFIG_MODINFO=y
@@ -485,3 +486,3 @@
-# CONFIG_INSMOD is not set
-# CONFIG_RMMOD is not set
-# CONFIG_LSMOD is not set
+CONFIG_INSMOD=y
+CONFIG_RMMOD=y
+CONFIG_LSMOD=y
@@ -489,2 +490,2 @@
-# CONFIG_MODPROBE is not set
-# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
+CONFIG_MODPROBE=y
+CONFIG_FEATURE_MODPROBE_BLACKLIST=y
@@ -503,5 +504,5 @@
-# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
-# CONFIG_FEATURE_MODUTILS_ALIAS is not set
-# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set
-CONFIG_DEFAULT_MODULES_DIR=""
-CONFIG_DEFAULT_DEPMOD_FILE=""
+CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
+CONFIG_FEATURE_MODUTILS_ALIAS=y
+CONFIG_FEATURE_MODUTILS_SYMBOLS=y
+CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
+CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"

Large portion: module utilities.  These are actually very
capable nowadays, on-par with module-init-tools.  But whole
thing is actually quite simple nowadays (unlike modutils).
enable insmod, rmmod, modprobe and modinfo with full
options.  Don't enable old kernel (modutils interface)
support, don't enable minimalistic (config-less) modprobe.


-CONFIG_REV=y
+# CONFIG_REV is not set


Not very useful utility, disable.

-# CONFIG_BLKID is not set
+CONFIG_BLKID=y
-# CONFIG_FINDFS is not set
+CONFIG_FINDFS=y

Enable findfs and blkid.  The latter isn't very
useful in 1.18 yet, I plan to send some patches
for it upstream.

@@ -524 +525 @@
-# CONFIG_FDISK is not set
+CONFIG_FDISK=y
@@ -526,8 +527,8 @@
-# CONFIG_FEATURE_FDISK_WRITABLE is not set
-# CONFIG_FEATURE_AIX_LABEL is not set
-# CONFIG_FEATURE_SGI_LABEL is not set
-# CONFIG_FEATURE_SUN_LABEL is not set
-# CONFIG_FEATURE_OSF_LABEL is not set
-# CONFIG_FEATURE_GPT_LABEL is not set
-# CONFIG_FEATURE_FDISK_ADVANCED is not set
+CONFIG_FEATURE_FDISK_WRITABLE=y
+CONFIG_FEATURE_AIX_LABEL=y
+CONFIG_FEATURE_SGI_LABEL=y
+CONFIG_FEATURE_SUN_LABEL=y
+CONFIG_FEATURE_OSF_LABEL=y
+CONFIG_FEATURE_GPT_LABEL=y
+CONFIG_FEATURE_FDISK_ADVANCED=y

Full fdisk.  As mentioned before it's not the
best and most accurate fdisk implementation
out here, but it is handy to be able to at
least inspect partition tables from a pre-init
environment, for rescue purpose.


-# CONFIG_HWCLOCK is not set
-# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set
+CONFIG_HWCLOCK=y
+CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y

Setting system time from pre-init can be useful.

- # CONFIG_FEATURE_MOUNT_NFS is not set
+ CONFIG_FEATURE_MOUNT_NFS=y

this enables mounting of nfs filesystems just like
old mount from util-linux did (now it all is moved
to nfs-common with a helper mount.nfs).  This is to
support nfs root.  NFS mount needs rpc library, which
is not very large.  RFC.


-# CONFIG_IPCRM is not set
-# CONFIG_IPCS is not set
+CONFIG_IPCRM=y
+CONFIG_IPCS=y

ipc (shared memory, semapores) inspection and
removal tools.


-# CONFIG_MDEV is not set
-# CONFIG_FEATURE_MDEV_CONF is not set
-# CONFIG_FEATURE_MDEV_RENAME is not set
-# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
-# CONFIG_FEATURE_MDEV_EXEC is not set
-# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
+CONFIG_MDEV=y
+CONFIG_FEATURE_MDEV_CONF=y
+CONFIG_FEATURE_MDEV_RENAME=y
+CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
+CONFIG_FEATURE_MDEV_EXEC=y
+CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y

udev replacement, small and easy.  I plan to package
it later like it's done with udhcp and syslog.


-# CONFIG_MKSWAP is not set
-# CONFIG_FEATURE_MKSWAP_UUID is not set
+CONFIG_MKSWAP=y
+CONFIG_FEATURE_MKSWAP_UUID=y

Very small utility, can be handy in pre-init.


-# CONFIG_FEATURE_MOUNT_FAKE is not set
-# CONFIG_FEATURE_MOUNT_VERBOSE is not set
+CONFIG_FEATURE_MOUNT_FAKE=y
+CONFIG_FEATURE_MOUNT_VERBOSE=y

Two forgotten mount options.



-# CONFIG_PIVOT_ROOT is not set
+CONFIG_PIVOT_ROOT=y

-# CONFIG_SWITCH_ROOT is not set
+CONFIG_SWITCH_ROOT=y

Why neither of this is enabled?  I've no idea.
First it old interface (initrd), but there's no
reason for it to stop working, it's supported in
the kernel.  switch_root is for new interface,
there's similar command in klibc - run-init.
I've no idea why they named differently.

With switch_root and modprobe in place we can boot
current kernels without klibc.


-# CONFIG_SETARCH is not set
+CONFIG_SETARCH=y

May be handy, very small.


-# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set
+CONFIG_FEATURE_MOUNT_LOOP_CREATE=y

For new (>2.6.24) /dev/loop interface - pre-create
next loop device if not exist.


-# CONFIG_LESS is not set
-CONFIG_FEATURE_LESS_MAXLINES=0
-# CONFIG_FEATURE_LESS_BRACKETS is not set
-# CONFIG_FEATURE_LESS_FLAGS is not set
-# CONFIG_FEATURE_LESS_MARKS is not set
-# CONFIG_FEATURE_LESS_REGEXP is not set
-# CONFIG_FEATURE_LESS_WINCH is not set
-# CONFIG_FEATURE_LESS_DASHCMD is not set
-# CONFIG_FEATURE_LESS_LINENUMS is not set
+CONFIG_LESS=y
+CONFIG_FEATURE_LESS_MAXLINES=9999999
+CONFIG_FEATURE_LESS_BRACKETS=y
+CONFIG_FEATURE_LESS_FLAGS=y
+CONFIG_FEATURE_LESS_MARKS=y
+CONFIG_FEATURE_LESS_REGEXP=y
+CONFIG_FEATURE_LESS_WINCH=y
+CONFIG_FEATURE_LESS_DASHCMD=y
+CONFIG_FEATURE_LESS_LINENUMS=y

Very handy file browser, much more capable than
more.


-# CONFIG_MOUNTPOINT is not set
+CONFIG_MOUNTPOINT=y

Handy tiny util for usage in scripts.


-# CONFIG_SETSID is not set
+CONFIG_SETSID=y

nice, setsid - tiny and handy for scripts.


-# CONFIG_NC_SERVER is not set
-# CONFIG_NC_EXTRA is not set
+CONFIG_NC_SERVER=y
+CONFIG_NC_EXTRA=y

Enable netcat server and extra flags, no reason to disable
them, can be used for rescue remote shell from initrd.


-# CONFIG_FEATURE_UNIX_LOCAL is not set
+CONFIG_FEATURE_UNIX_LOCAL=y

support for unix sockets in various applets that
can connect to something.  Questionable, I'm not
sure it's useful.


-# CONFIG_FEATURE_WGET_TIMEOUT is not set
+CONFIG_FEATURE_WGET_TIMEOUT=y

New in 1.18, wget -T option, to ensure wget
wont wait forever.


There are a few more applets which appeared in
1.18, of interest are iostat, mpstat.  I haven't
enabled these, probably should.


Final result for i386 regular deb build with
the above changes:

   text    data     bss     dec     hex filename
 420316    1787    8984  431087   693ef busybox-deb-config
 547069    1945    9224  558238   8849e busybox-mjt-config

That's 120Kb more, still with libm linked in.  Without
it, we're freeing 140Kb for the library itself.

Full config (for 1.18 deb) is attached.  Changelog entry
(in a git commit) upon request ;)

This should be a good start for the regular deb config, I hope :)

Thank you for the attention!

/mjt


Reply to: