[OE-core] [PATCH] LSB 4.1: lsb_release script incompatible with busybox head and find

Athanasios Oikonomou athoik at gmail.com
Fri Feb 17 16:50:33 UTC 2017


Busybox implementation only supports head -1 option if ENABLE_INCLUDE_SUSv2
or ENABLE_FEATURE_FANCY_HEAD configuration options are enabled. Also the -and
option for find is only supported if ENABLE_DESKTOP configuration option is
enabled. These configuration options are not enabled in several builds, which is
why this patch is needed.

[YOCTO #11041]

Signed-off-by: Athanasios Oikonomou <athoik at gmail.com>
---
 ...elease-to-work-with-busybox-head-and-find.patch | 34 ++++++++++++++++++++++
 meta/recipes-extended/lsb/lsb_4.1.bb               |  3 +-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/lsb/lsb/fix-lsb_release-to-work-with-busybox-head-and-find.patch

diff --git a/meta/recipes-extended/lsb/lsb/fix-lsb_release-to-work-with-busybox-head-and-find.patch b/meta/recipes-extended/lsb/lsb/fix-lsb_release-to-work-with-busybox-head-and-find.patch
new file mode 100644
index 0000000..0bfdaaf
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsb/fix-lsb_release-to-work-with-busybox-head-and-find.patch
@@ -0,0 +1,34 @@
+# Copyright (c) 2013 LG Electronics, Inc.
+
+# Busybox implementation only supports head -1 option if ENABLE_INCLUDE_SUSv2
+# or ENABLE_FEATURE_FANCY_HEAD configuration options are enabled. Also the -and
+# option for find is only supported if ENABLE_DESKTOP configuration option is
+# enabled. These configuration options are not enabled in build-webos, which is
+# why this patch is needed.
+
+diff -ru orig-lsb-release-1.4/lsb_release lsb-release-1.4/lsb_release
+--- orig-lsb-release-1.4/lsb_release	2013-03-13 09:13:56.518509117 +0200
++++ lsb-release-1.4/lsb_release	2013-03-13 11:50:03.765119076 +0200
+@@ -209,7 +209,7 @@
+             || [ -n "$(echo $DISTRIB_DESCRIPTION |                            \
+                        sed -e "s/.*$DESCSTR_DELI.*//")" ]
+         then
+-            TMP_DISTRIB_DESC=$(head -1 $FILENAME 2>/dev/null)
++            TMP_DISTRIB_DESC=$(head -n 1 $FILENAME 2>/dev/null)
+             [ -z "$DISTRIB_DESCRIPTION" ]                                     \
+                 && DISTRIB_DESCRIPTION=$TMP_DISTRIB_DESC
+         else
+@@ -249,10 +249,10 @@
+         then
+             CHECKFIRST=$(find $INFO_ROOT/ -maxdepth 1                         \
+                    -name \*$INFO_DISTRIB_SUFFIX                               \
+-                   -and ! -name $INFO_LSB_FILE                                \
+-                   -and -type f                                               \
++                   -type f                                                    \
+                    2>/dev/null                                                \
+-                   | head -1 ) # keep one of the files found (if many)
++                   | grep -v $INFO_LSB_FILE                                   \
++                   | head -n 1 ) # keep one of the files found (if many)
+         fi
+         InitDistribInfo $CHECKFIRST
+     fi
diff --git a/meta/recipes-extended/lsb/lsb_4.1.bb b/meta/recipes-extended/lsb/lsb_4.1.bb
index ece0eab..bc9048b 100644
--- a/meta/recipes-extended/lsb/lsb_4.1.bb
+++ b/meta/recipes-extended/lsb/lsb_4.1.bb
@@ -2,7 +2,7 @@ SUMMARY = "LSB support for OpenEmbedded"
 SECTION = "console/utils"
 HOMEPAGE = "http://prdownloads.sourceforge.net/lsb"
 LICENSE = "GPLv2+"
-PR = "r2"
+PR = "r3"
 
 LSB_CORE = "lsb-core-${TARGET_ARCH}"
 LSB_CORE_x86 = "lsb-core-ia32"
@@ -15,6 +15,7 @@ RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts"
 LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/lsb/lsb_release/1.4/lsb-release-1.4.tar.gz \
+           file://fix-lsb_release-to-work-with-busybox-head-and-find.patch \
            file://init-functions \
            file://lsb_killproc \
            file://lsb_log_message \
-- 
2.1.4




More information about the Openembedded-core mailing list