Skip to contentSkip to conversation

busybox: separate inittab into own package, due to SERIAL_CONSOLES being machine-specific

PATCH New Denys Dmytriyenko 1 participant 3 messages Mar 4, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 busybox: separate inittab into own package, due to SERIAL_CONSOLES being machine-specific

From: Denys Dmytriyenko <[email protected]>

* Create busybox-inittab recipe to produce machine-specific package with /etc/inittab and necessary getty calls for a machine, based on SERIAL_CONSOLES, similar to how sysvinit-inittab was done

* Since CONFIG_FEATURE_USE_INITTAB is controlled by VIRTUAL-RUNTIME_init_manager, make main busybox package RDEPENDS on busybox-inittab when init_manager is set to busybox

(From OE-Core rev: afb09abd2f0f7555ba156260a87fd3867f591310)

---
 .../recipes-core/busybox/busybox-inittab_1.24.1.bb | 32 ++++++++++++++++++++++
 meta/recipes-core/busybox/busybox.inc              | 12 ++------
 2 files changed, 34 insertions(+), 10 deletions(-)
 create mode 100644 meta/recipes-core/busybox/busybox-inittab_1.24.1.bb
meta/recipes-core/busybox/busybox-inittab_1.24.1.bb new file +32 -0
new file mode 100644
index 0000000..a83620e
@@ -0,0 +1,32 @@
+SUMMARY = "inittab configuration for BusyBox"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI = "file://inittab"
+
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_compile() {
+	:
+}
+
+do_install() {
+    install -d ${D}${sysconfdir}
+    install -D -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
+    tmp="${SERIAL_CONSOLES}"
+    for i in $tmp
+    do
+            j=`echo ${i} | sed s/\;/\ /g`
+            id=`echo ${i} | sed -e 's/^.*;//' -e 's/;.*//'`
+            echo "$id::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+    done
+}
+
+# SERIAL_CONSOLES is generally defined by the MACHINE .conf.
+# Set PACKAGE_ARCH appropriately.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} = "${sysconfdir}/inittab"
+CONFFILES_${PN} = "${sysconfdir}/inittab"
meta/recipes-core/busybox/busybox.inc +2 -10
index 48910ca..a6bfd46 100644
@@ -48,6 +48,8 @@ CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
 
 RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
 
+RDEPENDS_${PN} = "${@["", "busybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]}"
+
 inherit cml1 systemd update-rc.d ptest
 
 # internal helper
@@ -292,16 +294,6 @@ do_install () {
                 install -D -m 0777 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d/rcS
                 install -D -m 0777 ${WORKDIR}/rcK ${D}${sysconfdir}/init.d/rcK
                 install -D -m 0755 ${WORKDIR}/runlevel ${D}${base_sbindir}/runlevel
-                if grep "CONFIG_FEATURE_USE_INITTAB=y" ${B}/.config; then
-                        install -D -m 0777 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
-                        tmp="${SERIAL_CONSOLES}"
-                        for i in $tmp
-                        do
-                                j=`echo ${i} | sed s/\;/\ /g`
-                                id=`echo ${i} | sed -e 's/^.*;//' -e 's/;.*//'`
-                                echo "$id::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
-                        done
-                fi
         fi
 
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/3 layer.conf: add busybox-inittab to SIGGEN_EXCLUDERECIPES_ABISAFE

From: Denys Dmytriyenko <[email protected]>

Similar to sysvinit-inittab

(From OE-Core rev: a673d5bbf7e4db6de9a5151df041e6c5db7e413e)

---
 meta/conf/layer.conf | 1 +
 1 file changed, 1 insertion(+)
meta/conf/layer.conf +1 -0
index 4ba0b93..0c3dae5 100644
@@ -21,6 +21,7 @@ COREBASE = '${@os.path.normpath("${LAYERDIR}/../")}'
 # opkg-utils is for update-alternatives :(
 SIGGEN_EXCLUDERECIPES_ABISAFE += " \
   sysvinit-inittab \
+  busybox-inittab \
   shadow-securetty \
   opkg-arch-config \
   netbase \
Signature · 1 line
2.7.4
#2 lore raw

PATCH 3/3 maintainers.inc: add myself as maintainer for the new busybox-inittab

In reply to Denys Dmytriyenko

From: Denys Dmytriyenko <[email protected]>

(From OE-Core rev: ba2eb6237497494e3ec0296485ded61b024c5ba7)

---
 meta/conf/distro/include/maintainers.inc | 1 +
 1 file changed, 1 insertion(+)
meta/conf/distro/include/maintainers.inc +1 -0
index 38789b2..d0e6450 100644
@@ -88,6 +88,7 @@ RECIPE_MAINTAINER_pn-build-sysroots = "Richard Purdie <richard.purdie@linuxfound
 RECIPE_MAINTAINER_pn-builder = "Cristian Iorga <[email protected]>"
 RECIPE_MAINTAINER_pn-buildtools-tarball = "Cristian Iorga <[email protected]>"
 RECIPE_MAINTAINER_pn-busybox = "Armin Kuster <[email protected]>"
+RECIPE_MAINTAINER_pn-busybox-inittab = "Denys Dmytriyenko <[email protected]>"
 RECIPE_MAINTAINER_pn-byacc = "Chen Qi <[email protected]>"
 RECIPE_MAINTAINER_pn-bzip2 = "Denys Dmytriyenko <[email protected]>"
 RECIPE_MAINTAINER_pn-ca-certificates = "Alexander Kanavin <[email protected]>"
Signature · 1 line
2.7.4