system: support br2-external init systems
authorBrandon Maier <brandon.maier@rockwellcollins.com>
Tue, 13 Oct 2020 22:36:04 +0000 (17:36 -0500)
committerYann E. MORIN <yann.morin.1998@free.fr>
Wed, 14 Oct 2020 20:48:42 +0000 (22:48 +0200)
Some externals may wish to provide custom init systems for tightly
integrated boot. This has been supported through the BR2_INIT_NONE,
however a downside to the BR2_INIT_NONE is it forces the custom init
system to use either skeleton-custom and roll a custom skeleton for
each target, or skeleton-init-none which isn't a complete skeleton.

Allowing br2-external to define custom BR2_INIT_* means they can now
safely 'select' the BR2_PACKAGE_SKELETON_INIT_*, and re-use any of the
skeletons in Buildroot, or one from a br2-external tree.

Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
support/scripts/br2-external
system/Config.in

index 01804e122087d4699497ecc7d28e5f7cac4d9c9f..56dc6f53ca1d2f5f851a112dfb92e1305d499ed5 100755 (executable)
@@ -162,6 +162,7 @@ do_kconfig() {
         jpeg
         openssl
         skeleton
+        init
     )
 
     for br2 in "${items[@]}"; do
@@ -233,6 +234,14 @@ do_kconfig() {
         else
             printf '# No skeleton from: %s\n\n' "${br2_desc}"
         fi >>"${outputdir}/.br2-external.in.skeleton"
+
+        if [ -f "${br2_ext}/provides/init.in" ]; then
+            printf 'comment "init from: %s"\n' "${br2_desc}"
+            printf 'source "%s/provides/init.in"\n' "${br2_ext}"
+            printf '\n'
+        else
+            printf '# No init from: %s\n\n' "${br2_desc}"
+        fi >>"${outputdir}/.br2-external.in.init"
     done
 
     printf 'endmenu\n' >>"${outputdir}/.br2-external.in.menus"
index a7a05c9af28b0cdc0aaf5c1fcfd446477c3f5537..b3abeddd68961dbdc2d8d409cc71fbb9bc3bc0d5 100644 (file)
@@ -149,6 +149,9 @@ config BR2_INIT_NONE
          have to provide your own, either with a new package
          or with a rootfs-overlay.
 
+# Init systems from br2-external trees, if any
+source "$BR2_BASE_DIR/.br2-external.in.init"
+
 endchoice
 
 choice