Skip to contentSkip to conversation

LSB 4.1: lsb_release script incompatible with busybox head and find

PATCH Superseded Athanasios Oikonomou 2 participants 3 messages Feb 17, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LSB 4.1: lsb_release script incompatible with busybox head and find

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]

---
 ...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
meta/recipes-extended/lsb/lsb/fix-lsb_release-to-work-with-busybox-head-and-find.patch new file +34 -0
new file mode 100644
index 0000000..0bfdaaf
@@ -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
meta/recipes-extended/lsb/lsb_4.1.bb +2 -1
index ece0eab..bc9048b 100644
@@ -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 \
Signature · 1 line
2.1.4
#1 lore raw
Quoted 2 lines · Athanasios Oikonomou

+# Copyright (c) 2013 LG Electronics, Inc.

By submitting the patch this becomes MIT licensed, so this copyright statement is pretty meaningless.

Quoted 10 lines

+# 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.

Patch comments don't need to be on # lines. Also this patch needs a Signed-off-by and Upstream-Status in the header. I can't see a reason why the fixes don't go upstream, so please try submitting it there too.

--- a/meta/recipes-extended/lsb/lsb_4.1.bb

meta/recipes-extended/lsb/lsb_4.1.bb SUMMARY = "LSB support for OpenEmbedded" · line 6

Quoted 8 lines

+++ b/meta/recipes-extended/lsb/lsb_4.1.bb

meta/recipes-extended/lsb/lsb_4.1.bb +1 -1
@@ -2,7 +2,7 @@ SUMMARY = "LSB support for OpenEmbedded"
 SECTION = "console/utils"
 HOMEPAGE = "http://prdownloads.sourceforge.net/lsb"
 LICENSE = "GPLv2+"
-PR = "r2"
+PR = "r3"
 

No need to bump PR, leave it at r2.

Ross

#2 lore raw
Quoted 2 lines

Patch comments don't need to be on # lines. Also this patch needs a

Signed-off-by and Upstream-Status in the header. I can't see a reason why the fixes don't go upstream, so please try submitting it there too.

Quoted 1 line

I don't believe they accept patches for lsb-release-1.4. I don't know why we call it lsb 4.1.