Skip to content

Commit 7e9fa9b

Browse files
committed
feat(init): reduce to posix shell
Reduce script complexity to that of standard POSIX shells. Adjust shebang accordingly. Signed-off-by: Randolph Sapp <[email protected]>
1 parent 8e0d2f2 commit 7e9fa9b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docker/root/init

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
# SPDX-License-Identifier: MIT
44
# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com
@@ -13,8 +13,8 @@ get_build_gid() {
1313

1414
if NEW_GID=$(get_build_gid) && NEW_UID=$(get_build_uid); then
1515
# bypass everything if podman is remapping the id to root
16-
if [ "${NEW_UID}" == "0" ]; then
17-
if [ "$(id -u)" == "0" ]; then
16+
if [ "${NEW_UID}" = "0" ]; then
17+
if [ "$(id -u)" = "0" ]; then
1818
exec dumb-init -- "$@"
1919
else
2020
echo "Unable to resolve ns mapping!"
@@ -28,7 +28,7 @@ else
2828
echo "Not able to detect UID/GID for remapping!"
2929
fi
3030

31-
if [ "$(id -u)" == "$(id -u abc)" ]; then
31+
if [ "$(id -u)" = "$(id -u abc)" ]; then
3232
exec dumb-init -- "$@"
3333
else
3434
exec dumb-init -- su-exec abc:abc "$@"

0 commit comments

Comments
 (0)