Thank you for your interest in contributing to the GZ302 Linux Setup project! This guide will help you contribute effectively.
Repository Philosophy (v3.0.0+): The GZ302 Toolkit has evolved from a "hardware enablement" tool into a "performance optimization and convenience toolkit" for modern Linux kernels.
- Hardware-specific: Focused on ASUS ROG Flow Z13 (GZ302EA-XS99) with AMD Ryzen AI MAX+ 395
- Kernel-aware: Automatically adapts to kernel versions (6.14-6.18+), applying only necessary fixes
- Optimization focus: Prioritizes performance tuning over hardware workarounds (for kernel 6.17+)
- Equal distribution support: Arch, Debian/Ubuntu, Fedora, and OpenSUSE receive identical treatment
- Modular design: Core optimizations separated from optional software modules
- Quality focus: Clean, maintainable bash scripts with proper error handling
- Obsolescence handling: Actively removes outdated workarounds that harm performance on modern kernels
- A Linux system (preferably with one of the supported distributions)
bash4.0 or highershellcheckfor linting (recommended)gitfor version control
# Arch-based
sudo pacman -S shellcheck
# Debian/Ubuntu-based
sudo apt install shellcheck
# Fedora-based
sudo dnf install ShellCheck
# OpenSUSE
sudo zypper install ShellCheckMANDATORY for all AI interactions. If you are using an AI assistant to generate or modify code, you MUST ensure it follows the strict mandates in .github/copilot-instructions.md. This includes rules on library-first architecture, versioning, and idempotency.
...
- Always use
set -euo pipefailat the start of scripts - Quote all variables to prevent word splitting:
"$variable" - Quote command substitutions:
"$(command)" - Use
-rflag withread:read -r -p "prompt: " variable - Separate variable declarations:
# Good local var var=$(command) # Avoid local var=$(command) # Can mask return values
- Kernel-aware logic: When adding hardware fixes, check if they're needed for all kernels:
# Good - kernel-aware if [[ $kernel_version_num -lt 617 ]]; then apply_workaround else info "Native support available, skipping workaround" fi # Avoid - applying fixes unconditionally apply_workaround # May harm performance on newer kernels
- Use descriptive function names with underscores:
install_arch_packages - Document complex functions with comments
- Return 0 for success, non-zero for errors
- Use
localfor function-scoped variables
Use the helper functions consistently:
info "Informational message"
success "Success message"
warning "Warning message"
error "Error message (exits script)"Required before committing:
# Test individual script
bash -n gz302-setup.sh
# Test all scripts
for script in gz302-setup.sh gz302-lib/*.sh; do
bash -n "$script" && echo "β $script" || echo "β $script FAILED"
doneRequired before committing:
# Lint individual script
shellcheck gz302-setup.sh
# Lint all scripts
for script in gz302-setup.sh gz302-lib/*.sh; do
echo "=== $script ==="
shellcheck "$script"
doneAll scripts must pass with zero warnings.
Strongly recommended: Test your changes on all supported distributions:
- Arch Linux (or EndeavourOS, Manjaro)
- Ubuntu (or Pop!_OS, Linux Mint)
- Fedora (or Nobara)
- OpenSUSE Tumbleweed or Leap
You can use virtual machines or containers for testing.
- Fork the repository and create a feature branch
- Make your changes following the code style guidelines
- Test thoroughly:
- Run syntax validation:
bash -n script.sh - Run shellcheck:
shellcheck script.sh - Test on target hardware or VM if possible
- Run syntax validation:
- Commit with clear messages:
Add support for XYZ feature - Specific change 1 - Specific change 2 - Tested on: Arch Linux, Ubuntu 24.04 - Ensure equal distribution support: If you add a feature, implement it for all 4 distributions
- Submit pull request with:
- Clear description of changes
- Testing details (which distributions you tested)
- Any known limitations or issues
When creating or modifying modules (gz302-*.sh):
- Follow the modular pattern: Each module should be self-contained
- Include standard helpers: Copy color codes and helper functions
- Support all distributions: Implement for Arch, Debian, Fedora, OpenSUSE
- Add proper error handling: Use
set -euo pipefail - Document usage: Add comments explaining what the module does
- Consider kernel requirements: Document minimum kernel version if applicable
- Distinguish fixes from optimizations: Clearly label hardware workarounds vs performance tuning
#!/bin/bash
# ==============================================================================
# GZ302 [Module Name] Module
#
# Description of what this module does
# ==============================================================================
set -euo pipefail
# Color codes
C_BLUE='\033[0;34m'
C_GREEN='\033[0;32m'
C_YELLOW='\033[1;33m'
C_RED='\033[0;31m'
C_NC='\033[0m'
# Helper functions
info() { echo -e "${C_BLUE}[INFO]${C_NC} $1"; }
success() { echo -e "${C_GREEN}[SUCCESS]${C_NC} $1"; }
warning() { echo -e "${C_YELLOW}[WARNING]${C_NC} $1"; }
error() { echo -e "${C_RED}[ERROR]${C_NC} $1"; exit 1; }
# Main installation function
install_module() {
local distro="$1"
case "$distro" in
"arch") install_arch ;;
"debian") install_debian ;;
"fedora") install_fedora ;;
"opensuse") install_opensuse ;;
*) error "Unsupported distribution: $distro" ;;
esac
}
# Distribution-specific functions
install_arch() {
info "Installing for Arch-based system..."
# Implementation
}
install_debian() {
info "Installing for Debian-based system..."
# Implementation
}
install_fedora() {
info "Installing for Fedora-based system..."
# Implementation
}
install_opensuse() {
info "Installing for OpenSUSE..."
# Implementation
}
# Entry point
if [[ $# -ne 1 ]]; then
error "Usage: $0 <distro>"
fi
install_module "$1"When reporting bugs, please include:
- Distribution and version:
cat /etc/os-release - Hardware info:
lscpu,lspcioutput - Error messages: Complete error output
- Steps to reproduce: Exact commands you ran
- Expected vs actual behavior: What should happen vs what happened
For new features:
- Check existing issues to avoid duplicates
- Describe the use case: Why is this feature needed?
- Hardware relevance: Is it specific to GZ302 hardware?
- Distribution support: Can it work on all 4 distributions?
- Kernel compatibility: Does it require specific kernel versions?
- Type of feature: Is it a hardware fix, optimization, or convenience tool?
Hardware Fixes (workarounds for broken hardware):
- Only add if hardware genuinely doesn't work without it
- Document kernel version where native support arrives
- Include obsolescence plan
Optimizations (performance tuning):
- Always safe to apply, even if benefits are small
- Examples: GTT size for AI workloads, power profiles
Convenience Tools (quality of life):
- Wrappers around existing tools (asusctl, etc.)
- GUI utilities, system tray integrations
- The core of the "toolkit" philosophy
ALL changes require a version bump following semantic versioning (MAJOR.MINOR.PATCH):
- PATCH (X.X.+1): Bug fixes, documentation updates, minor improvements, dependency updates, typo fixes
- MINOR (X.+1.0): New features, new hardware support, module additions, non-breaking enhancements
- MAJOR (+1.0.0): Breaking changes, major architecture changes, incompatible API changes
REQUIRED for EVERY change - follow this exact order:
-
Update root
VERSIONfile FIRSTecho "5.1.2" > VERSION
-
Sync to ALL locations (use search/replace to ensure consistency):
gz302-setup.shβ Header:# Version: 5.1.2+ help text version displaygz302-lib/*.shβ All library files:# Version: 5.1.2modules/*.shβ All modules:# Version: 5.1.2command-center/VERSIONβ5.1.2command-center/src/command_center.pyβ Update About dialog version stringpkg/arch/PKGBUILDβpkgver=5.1.2README.mdβ Update any version badges or referencesdocs/CHANGELOG.mdβ Add new version entry with changes
-
Verify version sync:
# Check all version headers match grep -rn "Version:" gz302-setup.sh gz302-lib/ modules/ | grep -v "Kernel Version" cat VERSION command-center/VERSION grep "pkgver=" pkg/arch/PKGBUILD
-
Commit with version in message:
git add -A git commit -m "Bump version to 5.1.2: Fix tray icon SVG rendering"
- Fixed a bug? β PATCH:
5.1.1β5.1.2 - Added a new module? β MINOR:
5.1.2β5.2.0 - Changed installer architecture? β MAJOR:
5.2.0β6.0.0 - Updated documentation only? β PATCH:
5.1.2β6.0.0 - Fixed typo in comments? β PATCH:
6.0.0β6.0.0
NO exceptions - every merged change must increment the version number.
When updating documentation:
- Keep README.md user-focused: Installation and usage instructions
- Update version numbers per the Versioning section above
- Use clear examples: Show actual commands users would run
- Maintain consistency: Follow existing formatting and style
- Version bumped in root
VERSIONfile and synced to all locations - CHANGELOG.md updated with version entry and changes
- Code passes
bash -nsyntax check - Code passes
shellcheckwith zero warnings - Changes tested on at least one supported distribution
- All 4 distributions have equivalent implementation
- Documentation updated if needed
- Commit messages are clear and descriptive
- Commit includes version number: "Bump version to X.Y.Z: Description"
- No sensitive data (credentials, personal info) in commits
All contributions go through code review:
- Maintainers will review for code quality, security, and compatibility
- Feedback will be provided constructively
- You may be asked to make changes before merging
- Be patient - reviews may take a few days
- Questions: Open a GitHub issue with the "question" label
- Discussion: Use GitHub Discussions for general topics
- Security issues: Report privately to the maintainer
By contributing, you agree that your contributions will be provided as-is for the GZ302 community, matching the project's license.
Thank you for helping make GZ302 Linux Setup better! π