		BusyBox RootFS for ARM Guest

BusyBox provides several stripped-down Unix tools in a single executable. It 
runs in a variety of POSIX environments such as Linux, Android,[6] FreeBSD[7] 
and others, such as proprietary kernels, although many of the tools it provides
are designed to work with interfaces provided by the Linux kernel. It was 
created for embedded operating systems with very limited resources. It is 
released under the terms of the GNU General Public License. For more info
read the BusyBox wiki page http://en.wikipedia.org/wiki/BusyBox

The toolchain to be used for compiling BusyBox rootfs must have C library
support. Currently, we have two options from freely available toolchains:
1. CodeSourcery Lite ARM GNU/Linux Toolchain
(Cross-compile prefix arm-none-linux-gnueabi-)
(For more info, http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/)
2. Linaro ARM GNU/Linux Soft-Float Toolchain
(Cross-compile prefix arm-linux-gnueabi-)
(For more info, http://releases.linaro.org)
3. Linaro ARM GNU/Linux Hard-Float Toolchain
(Cross-compile prefix arm-linux-gnueabihf-)
(For more info, http://releases.linaro.org)

The CodeSourcery Lite ARM GNU/Linux Toolchain (arm-none-linux-gnueabi-)
is soft-float toolchain for ARMv5te or higher processors. It is build
with default options: -mfloat-abi=soft and -march=armv5te.

The Linaro ARM GNU/Linux Soft-Float Toolchain (arm-linux-gnueabi-)
is with software floating point for ARMv7 processors. It is build with
default options: -mfloat-abi=soft, -mfpu-name=vfpv3-d16 and -march=armv7.

The Linaro ARM GNU/Linux Hard-Float Toolchain (arm-linux-gnueabihf-)
is with hardware floating point for ARMv7 processors. It is build with
default options: -mfloat-abi=hard, -mfpu-name=vfpv3-d16 and -march=armv7.

Generally it is advisable that we build BusyBox with soft-float and armv5te
toolchain so that resulting root filesystem works for ARMv5, ARMv6, and ARMv7
guests. In real-world scenarios we need a hard-float toolchain for ARMv5 or
higher processors but such toolchain is not freely available and we need to
build this manually using cross-tool scripts. You should use Linaro toolchains
if you only care about ARMv7 processors.

Please follow the steps below to build a RAMDISK using BusyBox, to be used as
RootFS for ARM Linux guest:

  [1. Build environment for Xvisor]
  # CROSS_COMPILE=arm-none-linux-gnueabi-
  OR
  # CROSS_COMPILE=arm-linux-gnueabi-
  OR
  # CROSS_COMPILE=arm-linux-gnueabihf-

  [2. GoTo Xvisor source directory]
  # cd <xvisor_source_directory>

  [3. Copy defconfig to Busybox source directory]
  # cp tests/arm32/busybox/busybox-<busybox_version>_defconfig <busybox_source_directory>/.config

  [4. GoTo Busybox source directory]
  # cd <busybox_source_directory>

  [5. Configure Busybox source]
  # make oldconfig

  [6. Build Busybox RootFS]
  # make install

  [7. Change ownership of installed RootFS]
  # sudo chown -R root:root ./_install

  [8. Create RootFS EXT2 image]
  # fakeroot /bin/bash -c "genext2fs -b 5120 -N 1024 -D <xvisor_source_directory>/tests/arm32/common/busybox/busybox_dev.txt -d ./_install <busybox_rootfs_directory>/rootfs.ext2"

  [9. Create RootFS CPIO image]
  # mkdir -p <busybox_rootfs_directory>/tmp
  # sudo mount -o loop <busybox_rootfs_directory>/rootfs.ext2 <busybox_rootfs_directory>/tmp
  # cd <busybox_rootfs_directory>/tmp; sudo find ./ | cpio -o -H newc > <busybox_rootfs_directory>/rootfs.img; cd -
  # sudo umount <busybox_rootfs_directory>/tmp
  OR
  # mkdir -p <busybox_rootfs_directory>/tmp
  # sudo mount -o loop <busybox_rootfs_directory>/rootfs.ext2 <busybox_rootfs_directory>/tmp
  # cd <busybox_rootfs_directory>/tmp; sudo find ./ | cpio -o -H newc | gzip -9 > <busybox_rootfs_directory>/rootfs.img; cd -
  # sudo umount <busybox_rootfs_directory>/tmp

  (Note: <busybox_rootfs_directory>/rootfs.img is our final INITRAMFS RootFS)
  (Note: you can also use <busybox_rootfs_directory>/rootfs.ext2 as your final INITRD RootFS)
  (Note: replace all <> brackets based on your workspace)
  (Note: you are free to the change ordering of above steps based on your workspace)

