Skip to content

Conversation

@romandariana
Copy link
Contributor

Pull Request Description

Please replace this with a detailed description and motivation of the changes.
You can tick the checkboxes below with an 'x' between square brackets or just check them after publishing the PR.
If this PR contains a breaking change, list dependent PRs and try to push all related PRs at the same time.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have built Kuiper Linux image with the changes
  • I have tested new image in hardware, on relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc)

Move package installation responsibility from the central kuiper-stages.sh
loop into each stage's run.sh script. This improves the architecture:

Before:
- Central loop called install_packages() before each stage
- install_packages() had a complex elif chain with tool-specific file names
  (packages-libiio, packages-desktop-with-recommends, etc.) and config checks
- Config checks were duplicated: once in install_packages() and again in run.sh
- Adding new tools required modifying the central kuiper-stages.sh

After:
- Each stage calls install_packages() within its own config check
- install_packages() is a simple helper that looks for standard file names
  (packages, packages-with-recommends) in the stage's 00.install-packages/
- No duplication: config check only lives in run.sh
- Adding new tools only requires creating a new stage directory

Changes:
- Simplify install_packages() from 40+ lines to ~10 lines
- Move install_packages() call into each stage's run.sh
- Rename package files to standard naming (packages, packages-with-recommends)
- Embed 00.install-packages/ path in the helper function

Each stage is now self-contained: config check, package installation,
and build logic are all in one place.

Signed-off-by: Alisa-Dariana Roman <[email protected]>
Replace direct ${BASH_SOURCE%%/run.sh} usage with a SCRIPT_DIR variable
defined once at the top of each script. This improves consistency and
readability across all stage scripts.

Changes:
  - Add SCRIPT_DIR="${BASH_SOURCE%/run.sh}" to scripts that were missing it
  - Replace all ${BASH_SOURCE%%/run.sh} usages with ${SCRIPT_DIR}
  - Remove outdated comment explaining the BASH_SOURCE pattern
  - Normalize inconsistent whitespace in install commands

Benefits:
  - Single pattern across all stage scripts
  - Path extraction done once per file, not repeated
  - Eliminates % vs %% operator confusion
  - Shorter, more readable install commands

Signed-off-by: Alisa-Dariana Roman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants