1

I have been reading the documentation of BusyBox with the intention of using its small filesize to make a bootable cd.

The documentation states

To create a working system, just add /dev, /etc, and a Linux kernel.

I have used some linux Distro's such as Ubuntu and CentOS, when running cmds such as fdisk a list of attached devices starting with /dev is usually returned, when running ls on /etc we get some files show up.

I am confused at how/what I am supposed to add a /dev and /etc to BusyBox before booting up... Also I thought these would be added whilst in a running enviroment.

Are /dev and /etc to be perceived from a different view when spoken about in this manner, or have I just created a false view when using pre built Distros without understanding much of the underlying mechanics?

1
  • "Are /dev and /etc to be perceived from a different view... ?" No. You need to provide a minimal set of files in /etc, and an appropriate /dev pseudo-filesystem for the system. The paragraph you are reading is just hand-waving; it is not giving you the mechanics of creating a minimal busybox-based system, but it is not speaking of anything other than the /dev and /etc you might see on any Un*x system. Aug 25, 2016 at 23:04

1 Answer 1

0

The point the documentation is trying to make is that this is a pretty complete userspace, but you (as someone who is looking to roll a firmware for an embedded device) still have a role to play.

Busybox has some assumptions about the environment it will be run within that this statement is documenting here:

  1. You will somehow take care of the early boot process. That includes getting a bootloader to hand over to a kernel. The kernel needs to be appropriate to the hardware and sufficiently "sane" generally.
  2. Busybox is not in and of itself sufficient to boot a usable device without some additional work. You can't simply compile busybox, dump it on a filesystem and hand over control as soon as the kernel is booted without doing a little more work somewhere first. You'll need to make sure /dev exists in the filesystem and is populated with device inodes to match your hardware. The exact mechanism for doing that depends on the kernel version and the hardware/platform you're targeting, it has changed a lot over the evolution of Linux kernel versions and there's more than one way to do it.
  3. Finally lots of the pieces busybox does supply (and ones that you'll probably want from elsewhere) need some kind of configuration. How you manage that is up to you, but the bottom line is that many of the commands you'll run from busybox read config files from /etc and simply won't work if you haven't provided a mechanism to populate and maintain those.

Potentially on your embedded device you will have just one filesystem, using something like squashfs and everything will be read-only inside that. But the point is that your image/installer needs to do all the work to get that in the right place by the time you've handed over control.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .