Compilation of busybox-1.18.3 in order to support additional POSIX command to Vsphere5

 Note –  This is unsupported features of VMware – Please use at own risks.
VMware is currently using BusyBox v1.9.1-VMware-visor-6030 on Vsphere5

Steps for compilation of busybox

Note– I am using CentOS 5.x for compiling BusyBox.

1 –  Download busybox on /usr/src/redhat/BUILD

[root@linux10 ~]# wget http://busybox.net/downloads/busybox-1.18.3.tar.bz2
–23:15:09–  http://busybox.net/downloads/busybox-1.18.3.tar.bz2
Resolving busybox.net… 140.211.167.224
Connecting to busybox.net|140.211.167.224|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 2119251 (2.0M) [application/x-bzip2]
Saving to: `busybox-1.18.3.tar.bz2′

100%[=====================================================================>] 2,119,251   35.4K/s   in 82s

23:16:32 (25.4 KB/s) – `busybox-1.18.3.tar.bz2′ saved [2119251/2119251]

You have new mail in /var/spool/mail/root
[root@linux10 ~]#

========================================================================

2 – Checking/Extracting the busybox

[root@linux10 BUILD]# ls -tlr
total 2076
-rw-r–r– 1 root root 2119251 Feb  9  2011 busybox-1.18.3.tar.bz2
[root@linux10 BUILD]# tar -xf busybox-1.18.3.tar.bz2
[root@linux10 BUILD]# cd busybox-1.18.3
[root@linux10 busybox-1.18.3]# ls
applets    console-tools  editors    INSTALL     mailutils        miscutils   README   sysklogd              TODO
arch       coreutils      examples   libbb       Makefile         modutils    runit    TEST_config_nommu     TODO_unicode
archival   debianutils    findutils  libpwdgrp   Makefile.custom  networking  scripts  TEST_config_noprintf  util-linux
AUTHORS    docs           include    LICENSE     Makefile.flags   printutils  selinux  TEST_config_rh9
Config.in  e2fsprogs      init       loginutils  Makefile.help    procps      shell    testsuite
[root@linux10 busybox-1.18.3]#

======================================================================================
3 – compiling busybox to largest generic configuration with defconfig

[root@linux10 busybox-1.18.3]# make defconfig
[root@linux10 busybox-1.18.3]# make

Last fews lines –

CC      util-linux/volume_id/volume_id.o
CC      util-linux/volume_id/xfs.o
AR      util-linux/volume_id/lib.a
LINK    busybox_unstripped
Trying libraries: crypt m
Library crypt is not needed, excluding it
Library m is needed, can’t exclude it (yet)
Final link with: m
DOC     busybox.pod
DOC     BusyBox.txt
DOC     busybox.1
DOC     BusyBox.html
[root@linux10 busybox-1.18.3]#

=====================================================================

4 –  If compilation went well it will create  “busybox” binary file inside the current directory

[root@linux10 busybox-1.18.3]# ls -trl busybox
-rwxr-xr-x 1 root root 744680 Nov  5 23:20 busybox

[root@linux10 busybox-1.18.3]# file busybox
busybox: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped

[root@linux10 busybox-1.18.3]# ./busybox
BusyBox v1.18.3 (2011-11-05 23:18:53 IST) multi-call binary.
Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.

Usage: busybox [function] [arguments]…
or: busybox –list[-full]
or: function [arguments]…

BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable.  Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as.

Currently defined functions:
[, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash, awk, base64, basename, beep, blkid, blockdev, bootchartd,
brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear,
cmp, comm, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod, devmem, df,
dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir,
envuidgid, ether-wake, expand, expr, fakeidentd, false, fbset, fbsplash, fdflush, fdformat, fdisk, fgconsole, fgrep, find, findfs,
flock, fold, free, freeramdisk, fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hd,
hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, insmod,
install, ionice, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5,
klogd, last, length, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, lpd, lpq,
lpr, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg, microcom, mkdir,
mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount,
mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice, nmeter, nohup, nslookup, ntpd, od, openvt, passwd, patch, pgrep,
pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap, popmaildir, poweroff, powertop, printenv, printf, ps, pscan, pwd,
raidautorun, rdate, rdev, readahead, readlink, readprofile, realpath, reboot, reformime, remove-shell, renice, reset, resize, rev,
rm, rmdir, rmmod, route, rpm, rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, sendmail, seq,
setarch, setconsole, setfont, setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum, sha256sum, sha512sum, showkey, slattach,
sleep, smemcap, softlimit, sort, split, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svlogd, swapoff, swapon,
switch_root, sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd, time, timeout, top, touch, tr,
traceroute, traceroute6, true, tty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname, unexpand, uniq, unix2dos, unlzma, unlzop,
unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, volname, wall, watch, watchdog, wc, wget, which, who, whoami,
xargs, xz, xzcat, yes, zcat, zcip

[root@linux10 busybox-1.18.3]#

=============================================================================
5 – Edit the “Makefile” to modified the EXTRAVERSION like this
EXTRAVERSION = “-SatyendraSingh”

Note– You can use any meaningful name whatever you like

==========================================================================
6 – Now need to re run “make” command to write the modified EXTRAVERSION information on “busybox” binary

[root@linux10 busybox-1.18.3]# make

Few lines

LINK    busybox_unstripped
Trying libraries: crypt m
Library crypt is not needed, excluding it
Library m is needed, can’t exclude it (yet)
Final link with: m
You have new mail in /var/spool/mail/root
[root@linux10 busybox-1.18.3]#

=====================================================================

7 – Run the “busybox” on current directory to check what changes you made on “EXTRAVERSION”
[root@linux10 busybox-1.18.3]# ./busybox
BusyBox v1.18.3-SatyendraSingh (2011-11-05 23:18:53 IST) multi-call binary.
Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.

Usage: busybox [function] [arguments]…
or: busybox –list[-full]
or: function [arguments]…

BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable.  Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as.

Currently defined functions:
[, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash, awk, base64, basename, beep, blkid, blockdev, bootchartd,
brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear,
cmp, comm, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod, devmem, df,
dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir,
envuidgid, ether-wake, expand, expr, fakeidentd, false, fbset, fbsplash, fdflush, fdformat, fdisk, fgconsole, fgrep, find, findfs,
flock, fold, free, freeramdisk, fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hd,
hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, insmod,
install, ionice, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5,
klogd, last, length, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, lpd, lpq,
lpr, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg, microcom, mkdir,
mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount,
mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice, nmeter, nohup, nslookup, ntpd, od, openvt, passwd, patch, pgrep,
pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap, popmaildir, poweroff, powertop, printenv, printf, ps, pscan, pwd,
raidautorun, rdate, rdev, readahead, readlink, readprofile, realpath, reboot, reformime, remove-shell, renice, reset, resize, rev,
rm, rmdir, rmmod, route, rpm, rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, sendmail, seq,
setarch, setconsole, setfont, setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum, sha256sum, sha512sum, showkey, slattach,
sleep, smemcap, softlimit, sort, split, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svlogd, swapoff, swapon,
switch_root, sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd, time, timeout, top, touch, tr,
traceroute, traceroute6, true, tty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname, unexpand, uniq, unix2dos, unlzma, unlzop,
unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, volname, wall, watch, watchdog, wc, wget, which, who, whoami,
xargs, xz, xzcat, yes, zcat, zcip

[root@linux10 busybox-1.18.3]#

Note- Check the following line under IInd line of point “5” for EXTRAVERSION changes you made.

BusyBox v1.18.3-SatyendraSingh (2011-11-05 23:18:53 IST) multi-call binary.
=========================================================================

8 – Renaming the “buxybox” binary to meaningful name in order to avoid any conflict with “busybox” binary if exist.

[root@linux10 busybox-1.18.3]# cp busybox busybox-satya
cp: overwrite `busybox-satya’? y

[root@linux10 busybox-1.18.3]# ./busybox-satya

BusyBox v1.18.3-SatyendraSingh (2011-11-05 23:18:53 IST) multi-call binary.
Copyright (C) 1998-2009 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.

==========================================================================

9 – copy the “busybox-satya” to vsphere5 and use as per the requirement but make sure some of the applet of busy box may/may not work

Let’s take an example

1 – If I want to see what is ifconfig output on vsphere5, I am not able to find it from command prompt

~ # ifconfig
-sh: ifconfig: not found
~ # busybox ifconfig
ifconfig: applet not found

But if I run with my own compiled busybox-satya, it gives me the same output as Unix does.

~ # /tmp/busybox-satya ifconfig
ifconfig: /proc/net/dev: No such file or directory
lo0       Link encap:Ethernet  HWaddr 00:00:08:00:10:08
inet addr:127.0.0.1  Mask:255.0.0.0
UP LOOPBACK RUNNING MULTICAST  MTU:16384  Metric:1

vmk0      Link encap:Ethernet  HWaddr 00:0C:29:E3:38:76
inet addr:192.168.1.9  Bcast:192.168.1.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

2 – If I want to see what is crontab setting. I need to check the following way around –
~ # cat /var/spool/cron/crontabs/root
#min hour day mon dow command
1    1    *   *   *   /sbin/tmpwatch.py
1    *    *   *   *   /sbin/auto-backup.sh
0    *    *   *   *   /usr/lib/vmware/vmksummary/log-heartbeat.py

I tried to run the following commands as well but did not get the output

~ # busybox crontab -l
crontab: applet not found
~ #

But If I run with own compiled busybox-satya, It gives me the same output as Unix does. even I am able to edit/list the cron
~ # /tmp/busybox-satya crontab -l
#min hour day mon dow command
1    1    *   *   *   /sbin/tmpwatch.py
1    *    *   *   *   /sbin/auto-backup.sh
0    *    *   *   *   /usr/lib/vmware/vmksummary/log-heartbeat.py
~ # /tmp/busybox-satya crontab -e

~ # /tmp/busybox-satya crontab -l
#min hour day mon dow command
1    1    *   *   *   /sbin/tmpwatch.py
1    *    *   *   *   /sbin/auto-backup.sh
0    *    *   *   *   /usr/lib/vmware/vmksummary/log-heartbeat.py
#Satya here -5th Nov 2011

Note – I have added “#Satya here -5th Nov 2011” for example Purpose.
==============================================================================

18 thoughts on “Compilation of busybox-1.18.3 in order to support additional POSIX command to Vsphere5

  1. Mena November 17, 2011 at 9:38 pm Reply

    Knkoced my socks off with knowledge!

    • Winter December 1, 2011 at 11:32 am Reply

      Just cause it’s siplme doesn’t mean it’s not super helpful.

    • Jahlin December 3, 2011 at 6:36 am Reply

      Wowza, problem solved like it never hapnpeed.

    • Satya December 4, 2011 at 7:33 pm Reply

      Thanks U like it

  2. Champion Nba Jerseys December 3, 2011 at 2:31 pm Reply

    Cheap NBA Jerseys…

    […]what follows are several urls to web-sites that we connect to for the fact we believe they will be worthy of checking out[…]…

  3. Bertram Mullendore December 6, 2011 at 3:48 am Reply

    I was looking through some of your content on this website and I believe this site is really informative! Keep on putting up.

  4. financial advice December 8, 2011 at 5:20 am Reply

    Very informative post. Thanks for taking the time to share your view with us.

  5. Android Phones December 10, 2011 at 1:24 pm Reply

    Thank you for sharing. Not to many people in your position are so gracious. Your article was very poignant and understandable. It helped me to understand very clearly. Thank you for your help.
    Android Phones

  6. cheap family vacations December 13, 2011 at 5:07 pm Reply

    It was a excitement locating your site yesterday. I came here right hoping to learn something new. And I was not dissatisfied. Your well thought out ideas for new events like this. Thank you for this idea and sharing your knowledge.
    my blog is on family vacation ideas.

  7. Georgia Prestwood December 20, 2011 at 8:16 am Reply

    Some really interesting points you have written. Aided me a lot, just what I was looking for : D.
    My site is on educational toys for toddlers.

  8. Kathy December 21, 2011 at 7:01 am Reply

    Thank you for such a fantastic web site. On what other blog could anyone get this kind of information written in such an insightful way? I have a presentation that I am just now working on, and I have been looking for such info.
    Home remedies for acne

  9. Evan Dortilla January 2, 2012 at 3:04 am Reply

    A pity, but I disagree with this unique information. I actually do enjoy your personal internet page still and will likely continue to keep moving once more for fresh news.

  10. chair rail January 16, 2012 at 10:48 pm Reply

    Thanks!

  11. Deshawn Krauss January 19, 2012 at 3:23 am Reply

    Wohh exactly what I was looking for, thank you for putting up.

  12. Nickolas Kopp January 20, 2012 at 3:21 am Reply

    Merely wanna remark on few general things, The website layout is perfect, the articles is rattling wonderful : D.

  13. Tambra Chrones January 26, 2012 at 1:20 pm Reply

    Hi, are you accepting any ads in your blog? I’d love to purchase a banner ad for a couple of months linking to my website which is closely related. Let me know, or give me an email that I can reach you at. Cheers!

    • Satya February 4, 2012 at 5:32 pm Reply

      Hi,

      I am sorry being so late for reply. You can reach me at 009satya@gmail.com for any advertisement on transformidea.com

      Regards,
      Satya
      transformidea.com

  14. James McGrigor January 31, 2012 at 1:20 pm Reply

    It is really a great and helpful piece of info. I’m glad that you shared this useful information with us. Please keep us up to date like this. Thank you for sharing.

Leave a reply to James McGrigor Cancel reply