From 094d794af3ead79374fb23f5ea2ad9eda51c5adb Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Tue, 9 Oct 2018 11:35:34 -0400 Subject: [PATCH] config and documentation on using busybox as init/dev/login --- conf/local.conf | 5 +++++ docs/init-system.md | 24 +++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/conf/local.conf b/conf/local.conf index a27ef29f3..1200f9f02 100644 --- a/conf/local.conf +++ b/conf/local.conf @@ -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" diff --git a/docs/init-system.md b/docs/init-system.md index d0b6f3b59..41a7cf98d 100644 --- a/docs/init-system.md +++ b/docs/init-system.md @@ -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: @@ -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 @@ -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.