From 57a4e92511e1dde4bc78bb10022457cf371ce2e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 15:18:19 +0000 Subject: [PATCH] Add clarifying comments about bash usage in build scripts Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- CONTRIBUTING.md | 4 ++-- scripts/build.sh | 2 ++ scripts/create_image.sh | 2 ++ scripts/setup_rootfs.sh | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b87919d..dee2af0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,8 +39,8 @@ SparkOS aims to be: - Comment complex logic - **Shell Scripts**: Follow Google Shell Style Guide - - Use `#!/bin/sh` for POSIX-compliant scripts (preferred for busybox compatibility) - - Use `#!/bin/bash` only when bash-specific features are required + - For runtime scripts (inside rootfs): Use `#!/bin/sh` for POSIX-compliant scripts (busybox compatibility) + - For build scripts (host system): Can use `#!/bin/bash` when bash-specific features are needed - Quote variables - Use meaningful variable names diff --git a/scripts/build.sh b/scripts/build.sh index 6762c0e..392921f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,5 +1,7 @@ #!/bin/bash # Quick build script for SparkOS development +# Note: This script runs on the host system and uses bash for ${BASH_SOURCE} +# The target system uses busybox sh instead. set -e diff --git a/scripts/create_image.sh b/scripts/create_image.sh index c4f744d..8693fde 100755 --- a/scripts/create_image.sh +++ b/scripts/create_image.sh @@ -1,6 +1,8 @@ #!/bin/bash # SparkOS Image Creation Script # Creates a bootable dd-able disk image +# Note: This script runs on the host system and uses bash for ${BASH_SOURCE} +# The target system uses busybox sh instead. set -e diff --git a/scripts/setup_rootfs.sh b/scripts/setup_rootfs.sh index a19499a..348f474 100755 --- a/scripts/setup_rootfs.sh +++ b/scripts/setup_rootfs.sh @@ -1,6 +1,8 @@ #!/bin/bash # SparkOS Setup Script # Sets up a minimal rootfs with busybox and essential utilities +# Note: This script runs on the host system and uses bash for ${BASH_SOURCE} +# The target system uses busybox sh instead. set -e