Last active
January 26, 2026 11:43
-
-
Save lbussy/307784549ef1c554b367c6d9a3f7aec8 to your computer and use it in GitHub Desktop.
Check System Parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Environment diagnostics for build failures | |
| # Collects system, CPU, memory, swap, disk, and compiler info | |
| # | |
| set -e | |
| clear | |
| printf "%s\n\n" "=== System ===" | |
| if [[ -r /proc/device-tree/model ]]; then | |
| cat /proc/device-tree/model | |
| else | |
| printf "%s\n" "Unknown model" | |
| fi | |
| uname -a | |
| printf "\n%s\n" "=== CPU ===" | |
| if command -v lscpu >/dev/null 2>&1; then | |
| lscpu | |
| else | |
| grep -E 'model name|CPU\(s\)' /proc/cpuinfo | |
| fi | |
| printf "\n%s\n" "=== Memory ===" | |
| free -h | |
| printf "\n%s\n" "=== Swap ===" | |
| if command -v swapon >/dev/null 2>&1; then | |
| swapon --show | |
| else | |
| printf "%s\n" "swapon not available" | |
| fi | |
| printf "\n%s\n" "=== Disk ===" | |
| df -h . | |
| printf "\n%s\n" "=== GCC Toolchain ===" | |
| if command -v gcc >/dev/null 2>&1; then | |
| gcc --version | |
| else | |
| printf "%s\n" "gcc not found" | |
| fi | |
| if command -v g++ >/dev/null 2>&1; then | |
| g++ --version | |
| else | |
| printf "%s\n" "g++ not found" | |
| fi | |
| if command -v make >/dev/null 2>&1; then | |
| make --version | |
| else | |
| printf "%s\n" "make not found" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment