3

I'm building an embedded system based on debian 7, and I'd like to make the most out of busybox that comes with debian. The problem is default busybox build in debian seems quite minimal, for example it does not even include passwd.

On the other hand I don't want to build busybox from busybox.net sources for stability and update issues.

So how can I build and install a bigger busybox from debian source package?

zaadeh
  • 1,173
  • 1
  • 12
  • 17

1 Answers1

4

If you need a .deb customized on the fly

mkdir /tmp/bb
cd /tmp/bb
apt-get source busybox
sudo apt-get build-dep busybox
cd busybox-1.20.0/
fakeroot debian/rules build
make -C debian/build/deb/ menuconfig
# enable passwd
fakeroot debian/rules binary

but probably the best would be to add a custom package inside debian/control and the relative config under debian/config/pkg/

(I'm not using Debian 7 but guess it is similar)

edit

You can use fakeroot debian/rules debian/build/deb/.built and fakeroot debian/rules binary-arch_busybox to build the deb target only

Alex
  • 2,546
  • 3
  • 20
  • 30
  • Thanks, but with default debian config (no customization on my part), size of the busybox binary which has been built in `/tmp/bb/busybox-1.20.0/debian/build/deb/busybox` is much larger than previous busybox I installed from debian repo. any idea why? – zaadeh Oct 06 '13 at 12:09
  • 1
    I took the `deb` configuration just for example, maybe it differ from the one you were using (which busybox package you were using?), then I guess the files in the `build/` directory aren't stripped, you've to take them after the `binary` from the `.deb` or strip them manually. – Alex Oct 06 '13 at 12:21
  • I had already installed `busybox` package from official debian i386 wheezy repo, the file name is `busybox_1.20.0-7_i386.deb`. I ran `strip /tmp/bb/busybox-1.20.0/debian/build/deb/busybox` and it shrank in size to nearly the size of `/bin/busybox`, but not the same size. It became slightly smaller (~20k). also the busybox binary in created deb package is again a few bytes smaller than my stripped binary. Any idea why? It makes me nervous ;) because I did not touch default debian source package config. – zaadeh Oct 06 '13 at 12:46
  • 1
    Wow turned out the `deb` configuration is the right one :) my installed one have exactly the same size of the new one from the `.deb` 662520 bytes. For the stripped one I can just guess `dh_strip` is using some different option from yours, for the other difference I've no idea, the package version maybe, applied patches? gcc build version maybe? dunno – Alex Oct 06 '13 at 13:09