From c7cd715221f44a7207ebfc77ca15454d3c453009 Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Tue, 9 Oct 2018 13:06:41 -0400 Subject: [PATCH] document using musl --- conf/local.conf | 3 +++ docs/README.md | 7 +++++++ docs/{init-system.md => libc-init.md} | 22 ++++++++++++++++++---- 3 files changed, 28 insertions(+), 4 deletions(-) rename docs/{init-system.md => libc-init.md} (67%) diff --git a/conf/local.conf b/conf/local.conf index 1200f9f02..fabb27a01 100644 --- a/conf/local.conf +++ b/conf/local.conf @@ -57,3 +57,6 @@ ENABLE_UART = "1" #VIRTUAL-RUNTIME_init_manager = "busybox" #VIRTUAL-RUNTIME_dev_manager = "busybox-mdev" #VIRTUAL-RUNTIME_login_manager = "busybox" + +# Uncomment the following to enable musl libc +#TCLIBC = "musl" diff --git a/docs/README.md b/docs/README.md index 2bb446057..0f8e2c42b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -12,6 +12,13 @@ included for some of them below. * [BeagleBone -- todo]() * [ODroid-C2 -- todo]() +## Image Configuration + +OpenEmbedded supports a wide range of technology choices. Some of these are documented +below. + +* [libc/init system](libc-init.md) + ## Design Choices * [Superproject Management](superproject-management.md) diff --git a/docs/init-system.md b/docs/libc-init.md similarity index 67% rename from docs/init-system.md rename to docs/libc-init.md index 41a7cf98d..2ec88034b 100644 --- a/docs/init-system.md +++ b/docs/libc-init.md @@ -1,4 +1,4 @@ -# Init System +# libc and init system selection ## Systemd @@ -25,11 +25,21 @@ VIRTUAL-RUNTIME_dev_manager = "busybox-mdev" VIRTUAL-RUNTIME_login_manager = "busybox" ``` -## Comparison of disk spaced used by init systems +## Libc selection -Systemd takes considerably more space than SysVinit. With a rPI2 build, the following -are the rootfs sizes for core-image-minimal: +glibc is the default libc, but musl can also be used by setting the following in +local.conf: +``` +TCLIBC = "musl" +``` + +## Comparison of disk spaced used + +* Musl + Busybox init/dev/login + * space used in ext4 filesystem on running system using df: 1.9MB + * adding sizes of files in image from buildhistory: 1.5MB + * number of files in image: 595 * 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 @@ -42,3 +52,7 @@ 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 + +The space on disc used by a systemd image is much larger than adding the size of +the files in the image. We're not sure why this is -- perhaps there is filesystem +overhead for small files.