Compression for bbconfig applet

Harald Becker ralda at gmx.de
Sun Aug 29 06:46:42 UTC 2010


 Hi!

Looking for the best place to store the configuration files of different
busybox installations, I take a look on the bbconfig applet. Nice idea
to store the configuration in the binary itself, at least on machines,
where the size doesn't that matter, but ... bbconfig stores the
configuration data in an uncompressed string :-( ...so I did some quick
hacking ... now the configuration could be stored compressed in
bbconfig, using either gzip, bzip2, lzma or xz.

scripts/bbzconfig -g .config >include/bbconfigopts.h
( use -g for gzip, -b for bzip2, -l for lzma, -x for xz )

This creates the compressed configuration data to be included in busybox.

busybox bbconfig | scripts/bbzconfig >.config

Restores the configuration from busybox binary.

Saves me about 20k on my i686 machine.

But it's not perfect ...

TODO: Verify that the selected uncompressor is included in busybox else
the build will fail with an error message.In addition it needs at least
one of the decompressors included in the binary. Any suggestions?

--
Harald

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bbconfig.tar.lzma
Type: application/octet-stream
Size: 1412 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100829/5df4b18c/attachment.obj>


More information about the busybox mailing list