From 1d5ff48d9c777d6a061f635247a86f47644ec1fc Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Mon, 22 Oct 2018 07:51:48 -0400 Subject: [PATCH 1/4] switch from generating site.conf to auto.conf --- envsetup.sh | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/envsetup.sh b/envsetup.sh index 81bcbd55c..b11d8020e 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -92,8 +92,8 @@ cd $OE_BASE # incremement this to force recreation of config files. This should be done # whenever the DISTRO, or anything major changes -BASE_VERSION=10 -OE_ENV_FILE=localconfig.sh +YOE_ENV_VERSION=13 +YOE_ENV_FILE=localconfig.sh # Workaround for differences between yocto bitbake and vanilla bitbake export BBFETCH2=True @@ -157,41 +157,43 @@ fi # If an env already exists, use it, otherwise generate it #-------------------------------------------------------------------------- -if [ -e ${OE_ENV_FILE} ]; then - . ./${OE_ENV_FILE} +if [ -e ${YOE_ENV_FILE} ]; then + . ./${YOE_ENV_FILE} fi -if [ x"${BASE_VERSION}" != x"${SCRIPTS_BASE_VERSION}" ]; then - echo "BASE_VERSION mismatch, recreating ${OE_ENV_FILE}" - rm -f ${OE_ENV_FILE} +if [ x"${YOE_ENV_VERSION}" != x"${YOE_ENV_BASE_VERSION}" ]; then + echo "YOE_ENV_VERSION mismatch, recreating ${YOE_ENV_FILE}" + rm -f ${YOE_ENV_FILE} elif [ x"${DISTRO_DIRNAME}" != x"${SCRIPTS_DISTRO_DIRNAME}" ]; then - echo "DISTRO name has changed, recreating ${OE_ENV_FILE}" - rm -f ${OE_ENV_FILE} + echo "DISTRO name has changed, recreating ${YOE_ENV_FILE}" + rm -f ${YOE_ENV_FILE} fi -if [ -e ${OE_ENV_FILE} ]; then - . ./${OE_ENV_FILE} +if [ -e ${YOE_ENV_FILE} ]; then + . ./${YOE_ENV_FILE} else #-------------------------------------------------------------------------- # Specify distribution information #-------------------------------------------------------------------------- - echo "export SCRIPTS_BASE_VERSION=${BASE_VERSION}" >${OE_ENV_FILE} - echo "export SCRIPTS_DISTRO_DIRNAME=\"${DISTRO_DIRNAME}\"" >>${OE_ENV_FILE} + echo "# This is an automatically generated file, please do not edit" >${YOE_ENV_FILE} + echo "export YOE_ENV_BASE_VERSION=${YOE_ENV_VERSION}" >>${YOE_ENV_FILE} + echo "export SCRIPTS_DISTRO_DIRNAME=\"${DISTRO_DIRNAME}\"" >>${YOE_ENV_FILE} - echo "${OE_ENV_FILE} created" + echo "${YOE_ENV_FILE} created" #-------------------------------------------------------------------------- # Write out the OE bitbake configuration file. #-------------------------------------------------------------------------- mkdir -p ${OE_BUILD_DIR}/conf - SITE_CONF=${OE_BUILD_DIR}/conf/site.conf - cat >$SITE_CONF <<_EOF + AUTO_CONF=${OE_BUILD_DIR}/conf/auto.conf + cat >$AUTO_CONF <<_EOF +# This is an automatically generated file, please do not edit. -SCONF_VERSION = "1" +ACONF_VERSION = "1" # Where to store sources DL_DIR = "${OE_BASE}/downloads" @@ -206,9 +208,9 @@ TMPDIR = "${OE_BUILD_DIR}/build/tmp" _EOF - echo "${SITE_CONF} has been updated" + echo "${AUTO_CONF} has been updated" -fi # if -e ${OE_ENV_FILE} +fi # if -e ${YOE_ENV_FILE} ############################################################################### # UPDATE_ALL() - Make sure everything is up to date From 7e003720737117ae7a9c8bd0dd850abc640141f7 Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Mon, 22 Oct 2018 08:04:02 -0400 Subject: [PATCH 2/4] switch to using site.conf for settings stored in git --- .gitignore | 4 ++-- conf/local.conf.sample | 36 ++++++++++++++++++++++------------ conf/locallocal.conf.sample | 12 ------------ conf/{local.conf => site.conf} | 7 +++---- conf/site.conf.sample | 20 +++++++++++++++++++ 5 files changed, 48 insertions(+), 31 deletions(-) delete mode 100644 conf/locallocal.conf.sample rename conf/{local.conf => site.conf} (79%) create mode 100644 conf/site.conf.sample diff --git a/.gitignore b/.gitignore index 01fa85d71..9c6d97449 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ build downloads conf/auto.conf +conf/local.conf conf/sanity_info -conf/site.conf -conf/locallocal.conf +conf/local.conf pseudodone git_config subversion_config/ diff --git a/conf/local.conf.sample b/conf/local.conf.sample index d830d476d..587fa27ac 100644 --- a/conf/local.conf.sample +++ b/conf/local.conf.sample @@ -1,16 +1,26 @@ -# Uncomment the following to enable systemd -#DISTRO_FEATURES_append = " systemd" -#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" +# this is a sample of what might go in local.conf -# Uncomment the following to enable musl libc -#TCLIBC = "musl" +# required for Freescale stuff to build +ACCEPT_FSL_EULA = "1" -# generate the mirror tarball for SCM repos -# BB_GENERATE_MIRROR_TARBALLS = "1" +# required for Qualcomm stuff to build +ACCEPT_EULA = "1" + +# required to build netperf +LICENSE_FLAGS_WHITELIST = "non-commercial" + +# use the following to set the IP or hostname +# for the oe_setup_feed_server function +# if you have a decent DHCP server, then this is often +# the same as MACHINE +export MACHINE_IP=$MACHINE + +# When setting up feeds it will try to use this +# hosts IP address to configure the server on target +# machine, however if a different IP address is to be +# used then set it up here +export HOST_IP=10.10.10.10 + +# configure docker container to run bitbake in +export DOCKER_REPO=yoedistro/yoe-build:stretch diff --git a/conf/locallocal.conf.sample b/conf/locallocal.conf.sample deleted file mode 100644 index 0c4c00a99..000000000 --- a/conf/locallocal.conf.sample +++ /dev/null @@ -1,12 +0,0 @@ - -# this is a sample of what might go in locallocal.conf, or local.conf - -# required for Freescale stuff to build -ACCEPT_FSL_EULA = "1" - -# required for Qualcomm stuff to build -ACCEPT_EULA = "1" - -# required to build netperf -LICENSE_FLAGS_WHITELIST = "non-commercial" - diff --git a/conf/local.conf b/conf/site.conf similarity index 79% rename from conf/local.conf rename to conf/site.conf index c1ab5e59d..18a4fca95 100644 --- a/conf/local.conf +++ b/conf/site.conf @@ -1,7 +1,6 @@ - -# this following is for settings that are not checked into the build -# template -- see locallocal.conf.sample -include locallocal.conf +# site.conf is used for configuration settings that are checked into git, +# and are used by the entire team. For settings that are unique to a machine +# or user, and are not stored in git, please use local.conf. # CONF_VERSION is increased each time build/conf/ changes incompatibly CONF_VERSION = "1" diff --git a/conf/site.conf.sample b/conf/site.conf.sample new file mode 100644 index 000000000..b138ba4b4 --- /dev/null +++ b/conf/site.conf.sample @@ -0,0 +1,20 @@ +# local.conf should only be used for settings that are unique to a +# user or build machine. Settings that are common for the entire team +# should be added to site.conf, which is stored in git. + +# Use the following to enable systemd +DISTRO_FEATURES_append = " systemd" +VIRTUAL-RUNTIME_init_manager = "systemd" +DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit" +VIRTUAL-RUNTIME_initscripts = "" + +# Use the following to enable busybox init/dev/login +VIRTUAL-RUNTIME_init_manager = "busybox" +VIRTUAL-RUNTIME_dev_manager = "busybox-mdev" +VIRTUAL-RUNTIME_login_manager = "busybox" + +# Use the following to enable musl libc +TCLIBC = "musl" + +# configure docker container to run bitbake in +export DOCKER_REPO=yoedistro/yoe-build:stretch From 09a0a4aaf6ceb6db28a425ac9810df446f167dc4 Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Mon, 22 Oct 2018 10:59:44 -0400 Subject: [PATCH 3/4] add up link --- docs/libc-init.md | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/docs/libc-init.md b/docs/libc-init.md index 2ec88034b..af5986639 100644 --- a/docs/libc-init.md +++ b/docs/libc-init.md @@ -1,5 +1,7 @@ # libc and init system selection +[up](README.md) + ## Systemd SysVinit and Systemd are common init systems. SysVinit is the default, but Systemd can @@ -36,22 +38,22 @@ 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 - * 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 - * number of files in image: 696 -* Systemd - * 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 +- 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 + - 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 + - number of files in image: 696 +- Systemd + - 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 From 458f9ded3544802eea1ca8c93e28a5f19f1eb196 Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Mon, 22 Oct 2018 10:59:51 -0400 Subject: [PATCH 4/4] document configuration files --- docs/README.md | 1 + docs/conf-files.md | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 docs/conf-files.md diff --git a/docs/README.md b/docs/README.md index 4bbae5053..0d7e03a40 100644 --- a/docs/README.md +++ b/docs/README.md @@ -21,6 +21,7 @@ included for some of them below. OpenEmbedded supports a wide range of technology choices. Some of these are documented below. +- [Configuration Files](conf-files.md) - [libc/init system](libc-init.md) ## Design Choices diff --git a/docs/conf-files.md b/docs/conf-files.md new file mode 100644 index 000000000..605b680a3 --- /dev/null +++ b/docs/conf-files.md @@ -0,0 +1,24 @@ +# Configuration Files + +[up](README.md) + +OpenEmbedded is configured through "conf" files. These exist at various +[places](https://www.yoctoproject.org/docs/2.5.1/mega-manual/mega-manual.html#user-configuration) +in the sources. At the top level of the project are several files that +contain high level, or build specific configuration options. For the Yoe +project, these files include: + +- **conf/auto.conf**: This file is automatically generated by the the build system + and should not be modified. +- [**conf/site.conf**](../conf/site.conf): This file includes Yoe defaults and + project specific changes that you want to store in git. + This [file](../conf/site.conf.sample) includes samples of things you might want to add. +- **conf/local.conf**: This file includes changes that are specified to a user to build + machine, and are not checked into git. This [file](../conf/local.conf.sample) includes + samples of things you might want to add. + +The above configuration files are included into the build by the +[bitbake.conf](https://github.com/YoeDistro/openembedded-core/blob/master/meta/conf/bitbake.conf#L744) file in the OpenEmbedded Core layer. + +For a full list of variables available in the OpenEmbedded build system, see the +[Variables Glossary](https://www.yoctoproject.org/docs/2.5.1/mega-manual/mega-manual.html#ref-variables-glos).