diff options
| author | Khem Raj <raj.khem@gmail.com> | 2021-12-09 17:06:13 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-12 11:27:24 +0000 |
| commit | c9351aee3f9b1016c1697178a53664eebebbcf84 (patch) | |
| tree | e5c1ed258cc2e2a3e601fcacf196056ea0440609 /meta/recipes-core/glibc | |
| parent | 63f1e59f9f62eb39945aedc62ea01e0c29caea77 (diff) | |
| download | poky-c9351aee3f9b1016c1697178a53664eebebbcf84.tar.gz | |
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
(From OE-Core rev: 28adfbbcf42d15eabdd7fe3a5dea486bd5049f09)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc')
5 files changed, 61 insertions, 36 deletions
diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.34.bb b/meta/recipes-core/glibc/cross-localedef-native_2.34.bb index 482e53cf5d..c37814ee24 100644 --- a/meta/recipes-core/glibc/cross-localedef-native_2.34.bb +++ b/meta/recipes-core/glibc/cross-localedef-native_2.34.bb | |||
| @@ -25,13 +25,13 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ | |||
| 25 | file://0001-localedef-Add-hardlink-resolver-from-util-linux.patch \ | 25 | file://0001-localedef-Add-hardlink-resolver-from-util-linux.patch \ |
| 26 | file://0002-localedef-fix-ups-hardlink-to-make-it-compile.patch \ | 26 | file://0002-localedef-fix-ups-hardlink-to-make-it-compile.patch \ |
| 27 | \ | 27 | \ |
| 28 | file://0017-timezone-re-written-tzselect-as-posix-sh.patch \ | ||
| 29 | file://0018-Remove-bash-dependency-for-nscd-init-script.patch \ | 28 | file://0018-Remove-bash-dependency-for-nscd-init-script.patch \ |
| 30 | file://0019-eglibc-Cross-building-and-testing-instructions.patch \ | 29 | file://0019-eglibc-Cross-building-and-testing-instructions.patch \ |
| 31 | file://0020-eglibc-Help-bootstrap-cross-toolchain.patch \ | 30 | file://0020-eglibc-Help-bootstrap-cross-toolchain.patch \ |
| 32 | file://0021-eglibc-Resolve-__fpscr_values-on-SH4.patch \ | 31 | file://0021-eglibc-Resolve-__fpscr_values-on-SH4.patch \ |
| 33 | file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \ | 32 | file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \ |
| 34 | file://0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ | 33 | file://0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ |
| 34 | file://0001-Make-shell-interpreter-overridable-in-tzselect.ksh.patch \ | ||
| 35 | " | 35 | " |
| 36 | # Makes for a rather long rev (22 characters), but... | 36 | # Makes for a rather long rev (22 characters), but... |
| 37 | # | 37 | # |
| @@ -40,6 +40,11 @@ SRCREV_FORMAT = "glibc_localedef" | |||
| 40 | S = "${WORKDIR}/git" | 40 | S = "${WORKDIR}/git" |
| 41 | 41 | ||
| 42 | EXTRA_OECONF = "--with-glibc=${S}" | 42 | EXTRA_OECONF = "--with-glibc=${S}" |
| 43 | |||
| 44 | # We do not need bash to run tzselect script, the default is to use | ||
| 45 | # bash but it can be configured by setting KSHELL Makefile variable | ||
| 46 | EXTRA_OEMAKE += "KSHELL=/bin/sh" | ||
| 47 | |||
| 43 | CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'" | 48 | CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'" |
| 44 | 49 | ||
| 45 | do_install() { | 50 | do_install() { |
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc index 80a3e0b493..fdd241d973 100644 --- a/meta/recipes-core/glibc/glibc.inc +++ b/meta/recipes-core/glibc/glibc.inc | |||
| @@ -41,6 +41,10 @@ PARALLEL_MAKE = "" | |||
| 41 | # ensure make uses /bin/bash | 41 | # ensure make uses /bin/bash |
| 42 | EXTRA_OEMAKE += "SHELL=/bin/bash" | 42 | EXTRA_OEMAKE += "SHELL=/bin/bash" |
| 43 | 43 | ||
| 44 | # We do not need bash to run tzselect script, the default is to use | ||
| 45 | # bash but it can be configured by setting KSHELL Makefile variable | ||
| 46 | EXTRA_OEMAKE += "KSHELL=/bin/sh" | ||
| 47 | |||
| 44 | do_configure:prepend() { | 48 | do_configure:prepend() { |
| 45 | sed -e "s#/bin/bash#/bin/sh#" -i ${S}/elf/ldd.bash.in | 49 | sed -e "s#/bin/bash#/bin/sh#" -i ${S}/elf/ldd.bash.in |
| 46 | } | 50 | } |
diff --git a/meta/recipes-core/glibc/glibc/0001-Make-shell-interpreter-overridable-in-tzselect.ksh.patch b/meta/recipes-core/glibc/glibc/0001-Make-shell-interpreter-overridable-in-tzselect.ksh.patch new file mode 100644 index 0000000000..0480c47b49 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/0001-Make-shell-interpreter-overridable-in-tzselect.ksh.patch | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | From 76d170fbbfd07b26a0288212201e5d15558db36f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Thu, 9 Dec 2021 15:14:42 -0800 | ||
| 4 | Subject: [PATCH] Make shell interpreter overridable in tzselect.ksh | ||
| 5 | |||
| 6 | define new macro called KSHELL which can be used to define default shell | ||
| 7 | use Bash by default | ||
| 8 | |||
| 9 | Upstream-Status: Submitted [https://patchwork.sourceware.org/project/glibc/patch/20211209234015.1554552-1-raj.khem@gmail.com/] | ||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | Makeconfig | 9 +++++++++ | ||
| 13 | timezone/Makefile | 1 + | ||
| 14 | 2 files changed, 10 insertions(+) | ||
| 15 | |||
| 16 | diff --git a/Makeconfig b/Makeconfig | ||
| 17 | index 3fa2f13003..a1ea5d5571 100644 | ||
| 18 | --- a/Makeconfig | ||
| 19 | +++ b/Makeconfig | ||
| 20 | @@ -292,6 +292,15 @@ ifndef sysincludedir | ||
| 21 | sysincludedir = /usr/include | ||
| 22 | endif | ||
| 23 | |||
| 24 | +# The full path name of a Posix-compliant shell, preferably one that supports | ||
| 25 | +# the Korn shell's 'select' statement as an extension. | ||
| 26 | +# These days, Bash is the most popular. | ||
| 27 | +# It should be OK to set this to /bin/sh, on platforms where /bin/sh | ||
| 28 | +# lacks 'select' or doesn't completely conform to Posix, but /bin/bash | ||
| 29 | +# is typically nicer if it works. | ||
| 30 | +ifndef KSHELL | ||
| 31 | +KSHELL = /bin/bash | ||
| 32 | +endif | ||
| 33 | |||
| 34 | # Commands to install files. | ||
| 35 | ifndef INSTALL_DATA | ||
| 36 | diff --git a/timezone/Makefile b/timezone/Makefile | ||
| 37 | index c624a189b3..dc8f5277de 100644 | ||
| 38 | --- a/timezone/Makefile | ||
| 39 | +++ b/timezone/Makefile | ||
| 40 | @@ -127,6 +127,7 @@ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make | ||
| 41 | -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \ | ||
| 42 | -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \ | ||
| 43 | -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \ | ||
| 44 | + -e 's|#!/bin/bash|#!$(KSHELL)|g' \ | ||
| 45 | < $< > $@.new | ||
| 46 | chmod 555 $@.new | ||
| 47 | mv -f $@.new $@ | ||
| 48 | -- | ||
| 49 | 2.34.1 | ||
| 50 | |||
diff --git a/meta/recipes-core/glibc/glibc/0017-timezone-re-written-tzselect-as-posix-sh.patch b/meta/recipes-core/glibc/glibc/0017-timezone-re-written-tzselect-as-posix-sh.patch deleted file mode 100644 index 100d08599c..0000000000 --- a/meta/recipes-core/glibc/glibc/0017-timezone-re-written-tzselect-as-posix-sh.patch +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | From 2731fa0c7463cd160361a8ac92f3bd7f984d953d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 18 Mar 2015 00:33:03 +0000 | ||
| 4 | Subject: [PATCH] timezone: re-written tzselect as posix sh | ||
| 5 | |||
| 6 | To avoid the bash dependency. | ||
| 7 | |||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | --- | ||
| 13 | timezone/tzselect.ksh | 4 ++-- | ||
| 14 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh | ||
| 17 | index 18fce27e24..7705df83d7 100755 | ||
| 18 | --- a/timezone/tzselect.ksh | ||
| 19 | +++ b/timezone/tzselect.ksh | ||
| 20 | @@ -1,4 +1,4 @@ | ||
| 21 | -#!/bin/bash | ||
| 22 | +#!/bin/sh | ||
| 23 | # Ask the user about the time zone, and output the resulting TZ value to stdout. | ||
| 24 | # Interact with the user via stderr and stdin. | ||
| 25 | |||
| 26 | @@ -34,7 +34,7 @@ REPORT_BUGS_TO=tz@iana.org | ||
| 27 | |||
| 28 | # Specify default values for environment variables if they are unset. | ||
| 29 | : ${AWK=awk} | ||
| 30 | -: ${TZDIR=`pwd`} | ||
| 31 | +: ${TZDIR=$(pwd)} | ||
| 32 | |||
| 33 | # Output one argument as-is to standard output. | ||
| 34 | # Safer than 'echo', which can mishandle '\' or leading '-'. | ||
diff --git a/meta/recipes-core/glibc/glibc_2.34.bb b/meta/recipes-core/glibc/glibc_2.34.bb index cdce2c4112..27a5d5fa2b 100644 --- a/meta/recipes-core/glibc/glibc_2.34.bb +++ b/meta/recipes-core/glibc/glibc_2.34.bb | |||
| @@ -36,7 +36,6 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ | |||
| 36 | ${NATIVESDKFIXES} \ | 36 | ${NATIVESDKFIXES} \ |
| 37 | file://0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \ | 37 | file://0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \ |
| 38 | file://0016-yes-within-the-path-sets-wrong-config-variables.patch \ | 38 | file://0016-yes-within-the-path-sets-wrong-config-variables.patch \ |
| 39 | file://0017-timezone-re-written-tzselect-as-posix-sh.patch \ | ||
| 40 | file://0018-Remove-bash-dependency-for-nscd-init-script.patch \ | 39 | file://0018-Remove-bash-dependency-for-nscd-init-script.patch \ |
| 41 | file://0019-eglibc-Cross-building-and-testing-instructions.patch \ | 40 | file://0019-eglibc-Cross-building-and-testing-instructions.patch \ |
| 42 | file://0020-eglibc-Help-bootstrap-cross-toolchain.patch \ | 41 | file://0020-eglibc-Help-bootstrap-cross-toolchain.patch \ |
| @@ -53,6 +52,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ | |||
| 53 | file://0002-CVE-2021-38604.patch \ | 52 | file://0002-CVE-2021-38604.patch \ |
| 54 | file://0001-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ | 53 | file://0001-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ |
| 55 | file://CVE-2021-43396.patch \ | 54 | file://CVE-2021-43396.patch \ |
| 55 | file://0001-Make-shell-interpreter-overridable-in-tzselect.ksh.patch \ | ||
| 56 | " | 56 | " |
| 57 | S = "${WORKDIR}/git" | 57 | S = "${WORKDIR}/git" |
| 58 | B = "${WORKDIR}/build-${TARGET_SYS}" | 58 | B = "${WORKDIR}/build-${TARGET_SYS}" |
