[Git-commits] [grml/grml-live] 473cc3: config: convert grml-autoconfig system from zsh to...

Chris Hofstaedtler noreply at github.com
Sun Jun 22 20:42:53 CEST 2025


  Branch: refs/heads/zeha/bash
  Home:   https://github.com/grml/grml-live
  Commit: 473cc3752b753654abea28f72e6bd5e3ffa129aa
      https://github.com/grml/grml-live/commit/473cc3752b753654abea28f72e6bd5e3ffa129aa
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/usr/bin/restore-config
    M config/files/GRMLBASE/usr/bin/save-config
    M config/files/GRMLBASE/usr/share/grml-autoconfig/autoconfig.functions
    M config/files/GRMLBASE/usr/share/grml-autoconfig/grml-autoconfig

  Log Message:
  -----------
  config: convert grml-autoconfig system from zsh to bash

Convert the entire grml-autoconfig system (restore-config, save-config,
autoconfig.functions, and grml-autoconfig) from zsh to bash for better
portability and shellcheck compatibility.

Key conversion changes:
- Replace zsh-specific syntax with bash equivalents:
  * [[ pattern == *match* ]] → case statements
  * zparseopts → manual argument parsing
  * ${=variable} word splitting → standard bash
  * |& redirection → 2>&1 | for compatibility
  * pipestatus[1] → PIPESTATUS[0]

- Remove zsh dependencies:
  * Remove iszsh() function and setopt calls
  * Replace zsh math functions with bash arithmetic
  * Simplify signal trapping with proper signal names

- Fix color system integration:
  * Use $GREEN/$BLUE/$NORMAL from grml_colors
  * Maintain original color scheme in usage messages
  * Preserve grml visual identity

- Add shellcheck source directives:
  * Help shellcheck understand file relationships
  * Enable static analysis of sourced files

All scripts maintain full backward compatibility while gaining shellcheck
coverage and improved portability across shell implementations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply at anthropic.com>


  Commit: c3f54f64ce9b2142771a1470c627ffd9cb15ed66
      https://github.com/grml/grml-live/commit/c3f54f64ce9b2142771a1470c627ffd9cb15ed66
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/usr/bin/save-config

  Log Message:
  -----------
  save-config: initialize DEBUG variable

Fix "integer expression expected" error by initializing DEBUG=0
at the start of the script. The debug function expects DEBUG to be
a number for the -gt comparison, but it was never set.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply at anthropic.com>


  Commit: 66f929d85bbc1f0bae68dcac3cf77d55875eaf7e
      https://github.com/grml/grml-live/commit/66f929d85bbc1f0bae68dcac3cf77d55875eaf7e
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/etc/grml/autoconfig
    M config/files/GRMLBASE/etc/grml/autoconfig.local
    M config/files/GRMLBASE/usr/bin/restore-config
    M config/files/GRMLBASE/usr/bin/save-config
    M config/files/GRMLBASE/usr/share/grml-autoconfig/autoconfig.functions
    M config/files/GRMLBASE/usr/share/grml-autoconfig/grml-autoconfig

  Log Message:
  -----------
  config: fix shellcheck issues across all autoconfig scripts

Fix numerous shellcheck warnings and errors in the grml-autoconfig system:

Core fixes:
- Replace signal numbers with names (INT TERM SEGV)
- Fix deprecated egrep usage (use grep -E)
- Add proper quoting for variables and paths
- Separate variable declaration from assignment
- Fix cd commands with error handling (|| exit/continue)
- Replace legacy backticks with $(...) command substitution
- Fix parameter expansion quoting patterns
- Replace fragile for loops over find with while read

Script-specific improvements:
- save-config: Fix command substitution and error handling in subshells
- autoconfig.functions: Add shellcheck disable for intentionally unused variables
- All scripts: Add shellcheck source directives for proper analysis
- Preserve $EXTRACTOPTIONS word splitting behavior where needed

Maintains all functionality while improving shell script best practices
and enabling comprehensive static analysis coverage.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply at anthropic.com>


  Commit: 77efbd3d06a7a831fa4a5e7e8025bd5007a26ee0
      https://github.com/grml/grml-live/commit/77efbd3d06a7a831fa4a5e7e8025bd5007a26ee0
  Author: Chris Hofstaedtler <chris.hofstaedtler at deduktiva.com>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/usr/share/grml-autoconfig/autoconfig.functions

  Log Message:
  -----------
  autoconfig.functions: drop start of obsolete haveged, rmnologin services


  Commit: 65ce71a7a2816a8dae0e58172a58947f64568290
      https://github.com/grml/grml-live/commit/65ce71a7a2816a8dae0e58172a58947f64568290
  Author: Chris Hofstaedtler <chris.hofstaedtler at deduktiva.com>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/usr/share/grml-autoconfig/autoconfig.functions

  Log Message:
  -----------
  autoconfig.functions: remove unreachable startx code block


  Commit: 88b943cf80bbe409a4d77fa5eccf172c72d8b3ce
      https://github.com/grml/grml-live/commit/88b943cf80bbe409a4d77fa5eccf172c72d8b3ce
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/usr/share/grml-autoconfig/autoconfig.functions

  Log Message:
  -----------
  autoconfig.functions: appease shellcheck

And probably fix testcd.


  Commit: 9249e40bd1ce64c2a03d891f730937c1d5740316
      https://github.com/grml/grml-live/commit/9249e40bd1ce64c2a03d891f730937c1d5740316
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/lib/brltty/brltty.sh

  Log Message:
  -----------
  brltty.sh: appease shellcheck


  Commit: abd7f9352fa732c7b30a77b11938bdd26124f9d9
      https://github.com/grml/grml-live/commit/abd7f9352fa732c7b30a77b11938bdd26124f9d9
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/hooks/ZFS/instsoft

  Log Message:
  -----------
  ZFS/instsoft: appease shellcheck


  Commit: 7704fa9640133179bbb30d90ea801211be1ea999
      https://github.com/grml/grml-live/commit/7704fa9640133179bbb30d90ea801211be1ea999
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/scripts/GRMLBASE/26-console-setup

  Log Message:
  -----------
  GRMLBASE/26-console-setup: appease shellcheck


  Commit: 572e9cd618973de300b3176ad9ec1b04ca59056d
      https://github.com/grml/grml-live/commit/572e9cd618973de300b3176ad9ec1b04ca59056d
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/etc/udev/scripts/grml-udev-rebuildfstab

  Log Message:
  -----------
  grml-udev-rebuildfstab: appease shellcheck


  Commit: 7c2be6bfc2935f7d5ad10fab094acd643d27f4d7
      https://github.com/grml/grml-live/commit/7c2be6bfc2935f7d5ad10fab094acd643d27f4d7
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/etc/udev/scripts/forensic-mark-readonly

  Log Message:
  -----------
  forensic-mark-readonly: appease shellcheck


  Commit: 92bea24f04b079b69495ffa20ce2bc36e9b240fb
      https://github.com/grml/grml-live/commit/92bea24f04b079b69495ffa20ce2bc36e9b240fb
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/usr/share/initramfs-tools/scripts/init-top/grml

  Log Message:
  -----------
  init-top/grml: appease shellcheck


  Commit: e60dc0233f850ce6395406cac1c6ac4b49d95d3f
      https://github.com/grml/grml-live/commit/e60dc0233f850ce6395406cac1c6ac4b49d95d3f
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/usr/sbin/grml-setlang

  Log Message:
  -----------
  grml-setlang: appease shellcheck


  Commit: 0afe0b4d3edbc80309b662322c3cf4d95a3fe15c
      https://github.com/grml/grml-live/commit/0afe0b4d3edbc80309b662322c3cf4d95a3fe15c
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M config/files/GRMLBASE/usr/sbin/grml-autoconfig

  Log Message:
  -----------
  grml-autoconfig: appease shellcheck


  Commit: 5789a17a4f1bedf887677ce4ef6f191c4e0133ee
      https://github.com/grml/grml-live/commit/5789a17a4f1bedf887677ce4ef6f191c4e0133ee
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M .github/workflows/pr-review.yml
    M debian/update-grml-live-version

  Log Message:
  -----------
  workflows: simplify shellcheck with directory-based execution

Replace reviewdog with direct shellcheck execution to improve reliability:

- Remove reviewdog dependency (not working reliably for PR comments)
- Run shellcheck from each file's directory to resolve relative paths
- Expand coverage to all shell scripts in the repository
- Fix shellcheck warning in debian/update-grml-live-version
- Combine main and test script checking into single job
- Ensure shellcheck source directives work correctly

This provides reliable shellcheck execution with clear console output
and proper path resolution for all files.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply at anthropic.com>


  Commit: 55967a9d1e0e19aa080f39c88c50cf1973371bf0
      https://github.com/grml/grml-live/commit/55967a9d1e0e19aa080f39c88c50cf1973371bf0
  Author: Chris Hofstaedtler <ch at grml.org>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M .github/workflows/pr-review.yml
    A tests/autoconfig/.gitignore
    M tests/autoconfig/common_tests
    M tests/autoconfig/run_tests.sh
    M tests/autoconfig/test_bootparameters.sh
    M tests/autoconfig/test_dcsdir.sh
    M tests/autoconfig/test_debs.sh
    M tests/autoconfig/test_grmlcfg.sh

  Log Message:
  -----------
  Enable grml-autoconfig shunit2 tests


Compare: https://github.com/grml/grml-live/compare/1a54e4950c4c...55967a9d1e0e

To unsubscribe from these emails, change your notification settings at https://github.com/grml/grml-live/settings/notifications


More information about the Git-commits mailing list