Skip to content

Commit

Permalink
Merge pull request #30 from YoeDistro/cbrake/master
Browse files Browse the repository at this point in the history
config and documentation on using busybox as init/dev/login
  • Loading branch information
cbrake authored Oct 9, 2018
2 parents 69bb294 + 094d794 commit a3ea3d6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
5 changes: 5 additions & 0 deletions conf/local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,8 @@ ENABLE_UART = "1"
#VIRTUAL-RUNTIME_init_manager = "systemd"
#DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
#VIRTUAL-RUNTIME_initscripts = ""

# Uncomment the following to enable busybox init/dev/login
#VIRTUAL-RUNTIME_init_manager = "busybox"
#VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
#VIRTUAL-RUNTIME_login_manager = "busybox"
24 changes: 21 additions & 3 deletions docs/init-system.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Init System

## Systemd

SysVinit and Systemd are common init systems. SysVinit is the default, but Systemd can
be enabled be adding the following to local.conf:

Expand All @@ -10,9 +12,28 @@ DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
```

There is a significant size cost with systemd, so in some cases it may make sense to
use sysvinit if image size is a priority.

## Busybox Init

Busybox can also be used as an init system with the following in local.conf:

```
VIRTUAL-RUNTIME_init_manager = "busybox"
VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
VIRTUAL-RUNTIME_login_manager = "busybox"
```

## Comparison of disk spaced used by init systems

Systemd takes considerably more space than SysVinit. With a rPI2 build, the following
are the rootfs sizes for core-image-minimal:

* Busybox init/dev/login
* space used in ext4 filesystem on running system using df: 3.5MB
* adding sizes of files in image from buildhistory: 3.1MB
* number of files in image: 621
* SysVinit
* space used in ext4 filesystem on running system using df: 4.7MB
* adding sizes of files in image from buildhistory: 4.3MB
Expand All @@ -21,6 +42,3 @@ are the rootfs sizes for core-image-minimal:
* space used in ext4 filesystem on running system using df: 33.2MB
* adding sizes of files in image from buildhistory: 22MB
* number of files in image: 1,806

There is a significant size cost with systemd, so in some cases it may make sense to
use sysvinit if image size is a priority.

0 comments on commit a3ea3d6

Please sign in to comment.