Skip to contentSkip to conversation

glibc: Redo tzselect bash dependency problem

PATCH Superseded Khem Raj 1 participant 1 message Dec 10, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 glibc: Redo tzselect bash dependency problem

New patch adds a knob to select needed shell interpreter for tzselect script, which then we excercise via EXTRA_OEMAKE

---
 meta/recipes-core/glibc/glibc.inc             |  4 ++
 ...erpreter-overridable-in-tzselect.ksh.patch | 50 +++++++++++++++++++
 ...zone-re-written-tzselect-as-posix-sh.patch | 34 -------------
 meta/recipes-core/glibc/glibc_2.34.bb         |  2 +-
 4 files changed, 55 insertions(+), 35 deletions(-)
 create mode 100644 meta/recipes-core/glibc/glibc/0001-Make-shell-interpreter-overridable-in-tzselect.ksh.patch
 delete mode 100644 meta/recipes-core/glibc/glibc/0017-timezone-re-written-tzselect-as-posix-sh.patch
meta/recipes-core/glibc/glibc.inc +4 -0
index 80a3e0b493d..fdd241d973b 100644
@@ -41,6 +41,10 @@ PARALLEL_MAKE = ""
 # ensure make uses /bin/bash
 EXTRA_OEMAKE += "SHELL=/bin/bash"
 
+# We do not need bash to run tzselect script, the default is to use
+# bash but it can be configured by setting KSHELL Makefile variable
+EXTRA_OEMAKE += "KSHELL=/bin/sh"
+
 do_configure:prepend() {
 	sed -e "s#/bin/bash#/bin/sh#" -i ${S}/elf/ldd.bash.in
 }
meta/recipes-core/glibc/glibc/0001-Make-shell-interpreter-overridable-in-tzselect.ksh.patch new file +50 -0

50 lines not on this page · raw message

meta/recipes-core/glibc/glibc/0017-timezone-re-written-tzselect-as-posix-sh.patch deleted +0 -34
deleted file mode 100644
index 100d08599c9..00000000000
@@ -1,34 +0,0 @@
-From 2731fa0c7463cd160361a8ac92f3bd7f984d953d Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Wed, 18 Mar 2015 00:33:03 +0000
-Subject: [PATCH] timezone: re-written tzselect as posix sh
-
-To avoid the bash dependency.
-
-Upstream-Status: Pending
-
-Signed-off-by: Hongxu Jia <[email protected]>
-Signed-off-by: Khem Raj <[email protected]>
----
- timezone/tzselect.ksh | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh
-index 18fce27e24..7705df83d7 100755
---- a/timezone/tzselect.ksh
-+++ b/timezone/tzselect.ksh
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!/bin/sh
- # Ask the user about the time zone, and output the resulting TZ value to stdout.
- # Interact with the user via stderr and stdin.
- 
-@@ -34,7 +34,7 @@ [email protected]
- 
- # Specify default values for environment variables if they are unset.
- : ${AWK=awk}
--: ${TZDIR=`pwd`}
-+: ${TZDIR=$(pwd)}
- 
- # Output one argument as-is to standard output.
- # Safer than 'echo', which can mishandle '\' or leading '-'.
meta/recipes-core/glibc/glibc_2.34.bb +1 -1
index 09d8b0780f6..faef42fd5e3 100644
@@ -32,7 +32,6 @@ SRC_URI =  "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
            ${NATIVESDKFIXES} \
            file://0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
            file://0016-yes-within-the-path-sets-wrong-config-variables.patch \
-           file://0017-timezone-re-written-tzselect-as-posix-sh.patch \
            file://0018-Remove-bash-dependency-for-nscd-init-script.patch \
            file://0019-eglibc-Cross-building-and-testing-instructions.patch \
            file://0020-eglibc-Help-bootstrap-cross-toolchain.patch \
@@ -49,6 +48,7 @@ SRC_URI =  "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
            file://0002-CVE-2021-38604.patch \
            file://0001-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \
            file://CVE-2021-43396.patch \
+           file://0001-Make-shell-interpreter-overridable-in-tzselect.ksh.patch \
            "
 # Use append instead of += that way patch is applied with devupstream too
 SRC_URI:append = "\
Signature · 1 line
2.34.1