toybox-inittab: Fix serial getty reproducibility

The enable_getty test uses a bash-only syntax "[[ ... ]]".
On /bin/sh==bash hosts, it enables the serial getty.
On /bin/sh!=bash hosts, it does not enable it.

Fix this non-reproducibility by using the standard shell "[ ... ]"
syntax which should work in any POSIX shell[0].

[0]: https://www.shellcheck.net/wiki/SC3010

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Yoann Congal 2024-03-05 16:27:59 +01:00 committed by Khem Raj
parent 6757155f09
commit e317b01690
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -34,7 +34,7 @@ do_configure() {
cp orig/* .
for config in ${PACKAGECONFIG_CONFARGS}; do
if [[ ${config} == "enable_getty" ]]; then
if [ "${config}" = "enable_getty" ]; then
echo "# generated by bitbake recipe ${PN}" >> ${S}/inittab
for console in "${SERIAL_CONSOLES}"; do
param=$(echo ${console} | sed s/\;/\ /g)