Skip to content

Commit

Permalink
Remove dependency on bash (#839)
Browse files Browse the repository at this point in the history
* Remove dependency on bash

Bash is not always the default shell, and `source` only works in Bash. With Ubuntu 23 and 24 for example, the default shell is now Dash. Using `.` ensures wide compatibility.

* Apply suggestions from code review

* Apply suggestions from code review

---------

Co-authored-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
kreeuwijk and mudler authored May 2, 2024
1 parent 718aaa2 commit 2b6a96b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/kernels/linux-tegra/nvbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set -e
SCRIPT_DIR="$(dirname $(readlink -f "${0}"))"
SCRIPT_NAME="$(basename "${0}")"

source "${SCRIPT_DIR}/nvcommon_build.sh"
. "${SCRIPT_DIR}/nvcommon_build.sh"

function usage {
cat <<EOM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ stages:
name: "add custom bind and ephemeral mounts to /run/cos/cos-layout.env"
commands:
- |
source /run/cos/cos-layout.env
source /run/cos/custom-layout.env
. /run/cos/cos-layout.env
. /run/cos/custom-layout.env
PERSISTENT_STATE_PATHS="${PERSISTENT_STATE_PATHS} ${CUSTOM_BIND_MOUNTS} "
RW_PATHS="${RW_PATHS} ${CUSTOM_EPHEMERAL_MOUNTS}"
# Remove the existing lines that we are gonna rewrite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ stages:
pidfile="/run/cos-setup-reconcile.pid"
respawn_delay=360
set -o allexport
if [ -f /etc/environment ]; then source /etc/environment; fi
if [ -f /etc/environment ]; then . /etc/environment; fi
set +o allexport
- path: /etc/init.d/kairos-agent
content: |
Expand Down Expand Up @@ -94,7 +94,7 @@ stages:
pidfile="/run/${RC_SVCNAME}.pid"
respawn_delay=5
set -o allexport
if [ -f /etc/environment ]; then source /etc/environment; fi
if [ -f /etc/environment ]; then . /etc/environment; fi
set +o allexport
permissions: 0755
owner: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stages:
hostname: "cos-recovery"
commands:
- |
source /etc/os-release
. /etc/os-release
echo >> /etc/issue
echo "You are booting from recovery mode. Run 'kairos-agent reset' to reset the system to $VERSION" >> /etc/issue
echo " or 'kairos-agent upgrade' to upgrade the active partition" >> /etc/issue
Expand Down

0 comments on commit 2b6a96b

Please sign in to comment.