Skip to content

Conversation

@Apehaenger
Copy link
Collaborator

@Apehaenger Apehaenger commented Dec 16, 2025

  • ext/pi-gen submodule update for filesystem-resize/trixie fixes
  • Fix bad mower_params.yaml defaults
  • Merged latest main
  • Add CM5 tested features
  • Fix some doc typos

Summary by CodeRabbit

  • Documentation

    • Clarified boot, hotspot and GUI/CLI guidance; updated tested-features matrix for clearer pass statuses and notes on Wi‑Fi/hostname behavior.
  • Improvements

    • Set explicit fan startup temperature; adjusted default mower angles; added a /data symlink for ROS logs; clarified DHCP/DNS/networking commentary.
  • New Features

    • Added a hotspot callback to manage DNS/DHCP during connection state changes.
    • Added hardware-debugging support and target configuration.
  • Chores

    • Updated submodule reference and added a global cloud-init toggle; removed OpenOCD from extras list.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Walkthrough

Updates to docs and test matrix, pi-gen submodule bump, added ENABLE_CLOUD_INIT flag, fan dtoverlay temp parameter, mower parameter value changes, comitup callback script and hook, OpenOCD build/install and xcore.cfg added (and removed from extras), and creation of /data with a /data/ros symlink.

Changes

Cohort / File(s) Summary
Documentation
README.md, TESTED_FEATURES.md
Text edits in README; TESTED_FEATURES.md status updates, wording and footnote adjustments.
Submodule & build config
ext/pi-gen (submodule), pi-gen.config
ext/pi-gen submodule commit updated; added ENABLE_CLOUD_INIT=0 to pi-gen.config.
Pi firmware / fan config
stage-openmower/15-pi-config/files/boot/firmware/config.addendum
Clarified fan dtoverlay description and added temp=70000 parameter to fan dtoverlay lines.
Network / dnsmasq notes
stage-openmower/25-lan/files/etc/dnsmasq.d/10-openmower.conf
Added commented note about bind-interfaces behavior; left actual config unchanged.
Comitup callback & install
stage-openmower/20-comitup/00-run-chroot.sh, stage-openmower/20-comitup/00-run.sh, stage-openmower/20-comitup/files/usr/local/bin/comitup-callback
Masked wpa-supplicant, enabled external_callback in comitup.conf, install new /usr/local/bin/comitup-callback (root:root, 0755) that manages dnsmasq state transitions (HOTSPOT/CONNECTING/CONNECTED).
Mower parameters
stage-openmower/40-openmower/files/home/openmower/params/mower_params.yaml
mow_angle_increment: 110 → 0; undock_angle: 45.0 → 0.0.
Filesystem layout / symlink
stage-openmower/40-openmower/00-run-chroot.sh
Create /data (uid 1000:1000) and symlink /data/ros/home/openmower/ros.
OpenOCD stage & config
stage-openmower/45-openocd/00-run-chroot.sh, stage-openmower/45-openocd/00-run.sh, stage-openmower/45-openocd/files/xcore.cfg
New chroot build/install script to compile/install OpenOCD; stage installs xcore.cfg into user/root openmower-cli dirs; adds GPIO-based SWD config for Raspberry Pi 5.
Build/package adjustments
stage-openmower/50-extras/00-packages-nr
Removed openocd from extras package list.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • ClemensElflein

Poem

🐇 I hopped through docs and tiny gears,

Fans wait till seventy thousand cheers,
A callback quiets DHCP's call,
Angles reset and builds stand tall,
I nibble bits and celebrate it all 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'RC3 Prospect' is vague and does not clearly convey the specific changes made in the pull request. Consider using a more descriptive title that summarizes the main change, such as 'RC3: Update pi-gen submodule, fix mower params, add CM5 support, and improve documentation' or a shorter alternative highlighting the primary change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
README.md (1)

48-48: Consider using "until" for more formal documentation style.

Lines 48 and 79 use "till", which is less formal. For technical documentation, "until" is preferred.

Apply this diff:

-4. Your Pi will boot multiple times. Be patient and wait till the green activity LED becomes silent for ≥ 10 seconds.<br>
+4. Your Pi will boot multiple times. Be patient and wait until the green activity LED becomes silent for ≥ 10 seconds.<br>
-Please wait till Pi/xCore's green LED becomes silent for ≥ 10 seconds.
+Please wait until Pi/xCore's green LED becomes silent for ≥ 10 seconds.

Also applies to: 79-79

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 599ce05 and 24d5415.

📒 Files selected for processing (6)
  • README.md (4 hunks)
  • TESTED_FEATURES.md (1 hunks)
  • ext/pi-gen (1 hunks)
  • stage-openmower/15-pi-config/files/boot/firmware/config.addendum (2 hunks)
  • stage-openmower/25-lan/files/etc/dnsmasq.d/10-openmower.conf (1 hunks)
  • stage-openmower/40-openmower/files/home/openmower/params/mower_params.yaml (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[style] ~48-~48: Consider using the more formal “until”.
Context: ...oot multiple times. Be patient and wait till the green activity LED becomes silent f...

(TILL)


[style] ~79-~79: Consider using the more formal “until”.
Context: ...uring the final boot step. Please wait till Pi/xCore’s green LED becomes silent for...

(TILL)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (6)
stage-openmower/40-openmower/files/home/openmower/params/mower_params.yaml (1)

41-41: Clarify the default undocking angle change.

This change sets undock_angle to 0.0, establishing straight-line undocking as the default behavior for OpenMowerOS distributions. The value 0.0 is more conservative than the previous 45.0 (angled undocking). Note that undock_angled_distance is correctly only applied when undocking at an angle (non-zero angle), so no parameter inconsistency exists. Users can override this default in their own configurations.

ext/pi-gen (1)

1-1: Submodule update verified to include resize and Trixie fixes.

The new commit 7dadcf1 includes the intended fixes: "stage2: Enable first boot resize and fstrim service" addresses the resize component, and multiple commits support Trixie compatibility (cloud-init support, architecture updates, service configurations). The update aligns with the PR objective and introduces no apparent breaking changes.

stage-openmower/15-pi-config/files/boot/firmware/config.addendum (1)

48-50: LGTM! Clear documentation and sensible fan control defaults.

The updated comments and addition of the temp=70000 parameter (70°C startup temperature) improve both clarity and functionality. The configuration is consistent across CM4 and CM5, and 70°C is a reasonable threshold for fan activation on Raspberry Pi modules.

Also applies to: 59-60, 69-70

README.md (1)

48-48: LGTM! Documentation improvements enhance clarity.

The wording changes successfully shift from procedural warnings to more observational, user-friendly guidance. The emphasis on LED indicators as boot completion signals and the clearer workflow descriptions improve the overall user experience.

Also applies to: 63-63, 77-77, 79-79, 100-100, 105-105

TESTED_FEATURES.md (1)

7-9: LGTM! CM5 testing progress documented.

The feature matrix updates reflect successful validation of key features on CM5 hardware, consistent with the PR objectives. The comprehensive testing across Auto-reboot, SSH, network, and container features demonstrates good release candidate readiness.

Also applies to: 11-11, 13-16, 19-23, 26-26

stage-openmower/25-lan/files/etc/dnsmasq.d/10-openmower.conf (1)

5-6: Configuration is correct and consistent—no issues found.

The dnsmasq binding configuration does not present the concerns raised. There is no no-dhcp-interface=wlan0 directive to remove in the current configuration, and no wlan0 interface exists in the network setup. The configuration is internally consistent: eth0 is assigned the static IP 172.16.78.1/24, bind-interfaces restricts dnsmasq to eth0, listen-address correctly specifies 127.0.0.1 and 172.16.78.1 (which resides on eth0), and the DHCP range 172.16.78.150-200 aligns with eth0's subnet. No changes needed.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
TESTED_FEATURES.md (2)

19-23: Document the gap: Why do networking and service features consistently pass on CM4/CM5 but remain Todo on Pi4?

Lines 19–23 show a clear pattern: internal/external LAN, SSH, WebTerminal, and Dockge all pass on CM4 and CM5 but are marked 🟡 (Todo) on Pi4. This asymmetry deserves explanation for future maintainers. Is this a known Pi4 issue, test coverage gap, or environmental difference?

Consider adding a "Known issues by hardware" or "Test notes" section clarifying the root causes.


18-18: Clarify the intent of 🔁 (Retry) and 🟡 (Todo) status designations.

Line 18 shows CM4 Comitup as 🔁 (Retry), implying intermittent failure. Line 26 shows OpenOCD as 🟡 (Todo) across all variants. These statuses would benefit from inline notes explaining whether they are blockers for release, known intermittent issues, or simply not yet tested. Add a "Notes" section or brief inline comments to document the owner/priority for each pending feature.

Also applies to: 26-26

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5441fa0 and b32f2bc.

📒 Files selected for processing (1)
  • TESTED_FEATURES.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (2)
TESTED_FEATURES.md (2)

7-9: Good coverage for core OS and authentication features across all hardware variants.

Lines 7-9 show all three hardware variants passing core OS validation (reboot, Debian 13, release string). Lines 11, 13–16 demonstrate strong test coverage for user identity and SSH access across the board. This aligns well with the PR objective to document CM5-tested features.

Also applies to: 11-11, 13-16


27-27: LGTM.

Container shell functionality is working reliably across all three hardware variants.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Fix all issues with AI Agents 🤖
In @stage-openmower/20-comitup/00-run-chroot.sh:
- Line 19: The chown invocation uses the host $ROOTFS_DIR prefix and the
recursive flag but runs inside the chroot where $ROOTFS_DIR is not available;
change the command in 00-run-chroot.sh that references chown -R root:root
"$ROOTFS_DIR/usr/local/bin/comitup-callback" to use the absolute path inside the
chroot (/usr/local/bin/comitup-callback) and drop the -R flag since this targets
a single file (i.e., chown root:root on /usr/local/bin/comitup-callback).
🧹 Nitpick comments (6)
stage-openmower/20-comitup/00-run-chroot.sh (1)

18-18: Improve sed robustness for different config states.

The current pattern assumes external_callback: exists and is commented with # . This won't handle cases where:

  • The line doesn't exist at all
  • The line is already uncommented
  • There are spaces before #
🔎 More robust approach
-sed -i 's/^# external_callback:.*/external_callback: \/usr\/local\/bin\/comitup-callback' /etc/comitup.conf
+# Remove any existing external_callback line (commented or not)
+sed -i '/^#\?[[:space:]]*external_callback:/d' /etc/comitup.conf
+# Add the new external_callback configuration
+echo "external_callback: /usr/local/bin/comitup-callback" >> /etc/comitup.conf

Alternatively, use alternate delimiter to avoid escaping:

-sed -i 's/^# external_callback:.*/external_callback: \/usr\/local\/bin\/comitup-callback' /etc/comitup.conf
+sed -i 's|^#\?[[:space:]]*external_callback:.*|external_callback: /usr/local/bin/comitup-callback|' /etc/comitup.conf
stage-openmower/20-comitup/files/usr/local/bin/comitup-callback (5)

1-1: Consider adding error handling flags.

The script doesn't use set -e or set -u, which are recommended for system scripts to catch errors early and prevent undefined variable usage.

🔎 Proposed addition
 #!/bin/bash
+set -euo pipefail
 # Callback script for comitup to manage dnsmasq

Note: pipefail ensures errors in pipes are caught as well.


13-19: Improve dnsmasq termination and error visibility.

Two issues in the HOTSPOT handling:

  1. pkill -9 uses SIGKILL which doesn't allow graceful cleanup. Consider trying SIGTERM first.
  2. Redirecting stderr to /dev/null hides potential errors that could be useful for debugging.
🔎 Proposed improvements
     HOTSPOT)
         log "Entering HOTSPOT mode - stopping dnsmasq"
-        systemctl stop "$DNSMASQ_SERVICE" 2>/dev/null
-        pkill -9 dnsmasq 2>/dev/null
+        if ! systemctl stop "$DNSMASQ_SERVICE" 2>&1 | tee -a "$LOG"; then
+            log "systemctl stop failed, trying SIGTERM"
+            pkill dnsmasq 2>&1 | tee -a "$LOG" || true
+            sleep 1
+            # Only use SIGKILL if process still exists
+            pkill -9 dnsmasq 2>&1 | tee -a "$LOG" || true
+        fi
         # Ensure no dnsmasq is listening on port 67
         ss -ulpn | grep :67 && log "WARNING: Port 67 still occupied"
     ;;

18-18: Tighten port 67 check pattern.

The current pattern grep :67 could match false positives like :670, :6700, or source ports ending in 67.

🔎 More precise pattern
-        ss -ulpn | grep :67 && log "WARNING: Port 67 still occupied"
+        ss -ulpn | grep -E '[:.]67[[:space:]]' && log "WARNING: Port 67 still occupied"

Or even more specifically check for port 67 in the local address column:

-        ss -ulpn | grep :67 && log "WARNING: Port 67 still occupied"
+        ss -ulpn | awk '$5 ~ /:67$/ { found=1; print } END { exit !found }' && log "WARNING: Port 67 still occupied"

23-26: Improve error visibility for dnsmasq start.

Similar to the stop operation, redirecting stderr to /dev/null hides potential startup errors.

🔎 Log startup errors
     CONNECTED)
         log "Entering CONNECTED mode - restarting dnsmasq"
-        systemctl start "$DNSMASQ_SERVICE" 2>/dev/null
+        if ! systemctl start "$DNSMASQ_SERVICE" 2>&1 | tee -a "$LOG"; then
+            log "ERROR: Failed to start dnsmasq"
+        fi
     ;;

5-5: Consider log rotation for production use.

The log file /var/log/comitup-callback.log will grow indefinitely. Consider configuring logrotate or implementing size checks.

This could be addressed by creating a logrotate configuration file, for example at /etc/logrotate.d/comitup-callback:

/var/log/comitup-callback.log {
    weekly
    rotate 4
    compress
    missingok
    notifempty
}

This configuration could be added in the 00-run.sh or 00-run-chroot.sh scripts.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b32f2bc and d8bb3cc.

📒 Files selected for processing (4)
  • stage-openmower/20-comitup/00-run-chroot.sh
  • stage-openmower/20-comitup/00-run.sh
  • stage-openmower/20-comitup/files/usr/local/bin/comitup-callback
  • stage-openmower/25-lan/files/etc/dnsmasq.d/10-openmower.conf
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (2)
stage-openmower/20-comitup/00-run.sh (1)

10-10: LGTM!

The install command correctly copies the callback script with appropriate execute permissions (0755) and follows the same pattern as the other install commands.

stage-openmower/25-lan/files/etc/dnsmasq.d/10-openmower.conf (1)

5-10: LGTM!

The added comment block provides helpful context about the bind-interfaces limitation and references the workaround implemented in the comitup-callback script. No functional changes to the dnsmasq configuration.

- mask wpa-supplicant.service to avoid interference with NetworkManager
- fix sed command for enabling external_callback in comitup.conf
- correct chown path for comitup-callback script
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @pi-gen.config:
- Line 37: The config variable ENABLE_CLOUD_INIT in pi-gen.config is unused;
wire it into the build by checking ENABLE_CLOUD_INIT in the appropriate stage
script(s) that install or purge packages (e.g., the stage install scripts where
packages are installed/removed, such as any stage's install.sh or packages.cfg
handlers) and conditionally prevent cloud-init from being installed or
explicitly remove it when ENABLE_CLOUD_INIT=0, or remove the unused variable
entirely and implement an alternative mechanism (for example, add logic in the
stage's package installation step to skip "cloud-init" when ENABLE_CLOUD_INIT is
"0" or add a cleanup step that purges cloud-init when it's disabled); update the
scripts to reference the ENABLE_CLOUD_INIT variable (and export/read it if
needed) so the setting actually controls cloud-init installation.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8bb3cc and ad096a7.

📒 Files selected for processing (2)
  • pi-gen.config
  • stage-openmower/20-comitup/00-run-chroot.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • stage-openmower/20-comitup/00-run-chroot.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @TESTED_FEATURES.md:
- Line 11: Update the feature name text in TESTED_FEATURES.md by removing the
extra space so "Hostname (non- default) `hostname`" becomes "Hostname
(non-default) `hostname`" (locate the table row containing "Hostname (non-
default) `hostname`" and adjust the spacing in the parentheses).
🧹 Nitpick comments (1)
TESTED_FEATURES.md (1)

7-27: Consider documenting Pi4 limitations in notes section.

The feature matrix shows a consistent pattern of Pi4 (HW-V1) having more "todo" statuses compared to CM4/CM5 (HW-V2) across networking and configuration features (lines 10, 12, 14, 17–20). While this may reflect real hardware generation differences, the notes section (lines 29–31) does not clarify whether Pi4 gaps are known hardware limitations, testing backlog, or deprecated support. A clarifying note would help future maintainers and users understand the expected support timeline for Pi4.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9e34b9f and a0aeb1b.

📒 Files selected for processing (1)
  • TESTED_FEATURES.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
TESTED_FEATURES.md (1)

7-27: CM5 support well-integrated into feature matrix.

The matrix effectively adds CM5 testing coverage across all features, with CM5 results largely mirroring CM4 outcomes. This aligns well with the PR objective to add CM5 tested features. The new OpenOCD remote debugging row (line 26) appropriately marks all variants as "todo," reflecting a feature in early testing stages.

Please confirm that the CM5 test results in lines 7–27 are based on actual testing rather than projections, especially for features where CM5 differs from Pi4 (e.g., lines 10, 12, 14, 17–20).

- add new stage 45-openocd with build script for openocd from source
- add installation script to deploy xcore.cfg configuration files for user and root
- include xcore.cfg configuration for raspberry pi 4/5 as bitbang adapter using linuxgpiod driver
- remove openocd from extras packages list as it is now built from source
- create /data directory for persistent storage
- add symbolic link from /data/ros to /home/openmower/ros for easy "latest" log access
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI Agents
In @stage-openmower/45-openocd/00-run-chroot.sh:
- Line 20: The make invocation uses an unquoted command substitution in the
parallelism flag (the line with make -j$(nproc)); update that invocation to
quote the command substitution so the shell handles it safely (i.e., change the
-j$(nproc) usage to use a quoted command substitution) to satisfy ShellCheck and
follow best practices.

In @stage-openmower/45-openocd/files/xcore.cfg:
- Around line 35-41: The fallback logic currently uses "info exists GPIO_CHIP"
which only checks for definition and will treat an empty string from
find_rp1_alias as valid; instead, after setting GPIO_CHIP via "set GPIO_CHIP
[string index [find_rp1_alias] end]" test that GPIO_CHIP is non-empty (e.g.,
check [string length $GPIO_CHIP] > 0 or compare $GPIO_CHIP ne "") and only then
assign _GPIO_CHIP=$GPIO_CHIP, otherwise set _GPIO_CHIP to 0 so the empty-string
result from find_rp1_alias falls back to 0.
🧹 Nitpick comments (2)
stage-openmower/45-openocd/files/xcore.cfg (1)

21-27: Consider explicit return for clarity.

The proc works correctly (implicitly returns empty string when no match found), but an explicit return "" after the loop would make the behavior clearer.

🔎 Proposed refactor
 proc find_rp1_alias {} {
         foreach f [glob -directory "/proc/device-tree/aliases" "gpio\[0-9\]"] {
                 if {[string match "*/rp1/*" [read_file $f]]} {
                         return $f
                 }
         }
+        return ""
 }
stage-openmower/45-openocd/00-run-chroot.sh (1)

14-21: Consider cleanup and shallow clone to reduce image size.

The script leaves build artifacts in /opt/openocd after installation, and clones the full repository history. Consider:

  1. Using git clone --depth=1 to reduce clone time and size.
  2. Removing /opt/openocd after make install to save space in the final image.
🔎 Proposed refactor
 # Clone OpenOCD repository
-git clone https://github.com/raspberrypi/openocd.git --recursive
+git clone --depth=1 https://github.com/raspberrypi/openocd.git --recursive
 
 # Bootstrap, configure, compile, and install OpenOCD
 cd openocd
 ./bootstrap
 ./configure --enable-ftdi --enable-sysfsgpio --enable-bcm2835gpio --enable-linuxgpiod
 make -j"$(nproc)"
 make install
+
+# Cleanup build artifacts
+cd /opt
+rm -rf openocd
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0aeb1b and 268aeb5.

📒 Files selected for processing (6)
  • TESTED_FEATURES.md
  • stage-openmower/40-openmower/00-run-chroot.sh
  • stage-openmower/45-openocd/00-run-chroot.sh
  • stage-openmower/45-openocd/00-run.sh
  • stage-openmower/45-openocd/files/xcore.cfg
  • stage-openmower/50-extras/00-packages-nr
💤 Files with no reviewable changes (1)
  • stage-openmower/50-extras/00-packages-nr
🚧 Files skipped from review as they are similar to previous changes (1)
  • TESTED_FEATURES.md
🧰 Additional context used
🪛 Shellcheck (0.11.0)
stage-openmower/45-openocd/00-run-chroot.sh

[warning] 20-20: Quote this to prevent word splitting.

(SC2046)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (4)
stage-openmower/40-openmower/00-run-chroot.sh (1)

17-20: LGTM! Clean persistent storage setup.

The /data directory and symlink provide convenient access to ROS logs. The ownership setting (1000:1000) is consistent with other directories in this script, and the target /home/openmower/ros is created earlier (lines 12-13).

stage-openmower/45-openocd/files/xcore.cfg (2)

12-19: LGTM! Proper error handling.

The read_file proc correctly handles file-open failures with catch and returns an empty string, which is appropriate for the callers.


43-48: Verify adapter configuration after fixing GPIO_CHIP.

The adapter GPIO configuration looks correct, but ensure it functions properly once the GPIO_CHIP fallback logic (lines 35-41) is fixed.

stage-openmower/45-openocd/00-run.sh (1)

1-10: LGTM! Clean installation script.

The script correctly installs xcore.cfg to both user and root configuration directories with appropriate permissions (0664 for config files, 0755 for directories) and ownership. The use of install -D properly handles intermediate directory creation.

- add chown command to ensure proper ownership of /home/openmower/.config directory for user 1000
- remove explicit target user ownership from install commands for user openmower config files to rely on chroot setup
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @stage-openmower/45-openocd/00-run-chroot.sh:
- Line 3: The chown invocation on the path "/home/openmower/.config" can fail if
the directory doesn't exist (causing the script to exit under the shell -e
setting); modify the script to ensure the directory exists before changing
ownership by creating it if missing (e.g. use mkdir -p /home/openmower/.config)
or guard chown with a test ([ -d /home/openmower/.config ] && chown -R 1000:1000
/home/openmower/.config) so the chown line in the script will not error when the
directory is absent.
🧹 Nitpick comments (2)
stage-openmower/45-openocd/00-run-chroot.sh (2)

7-9: Clean up apt cache to reduce image size.

After installing build dependencies, the apt cache and package lists remain in the image, increasing its size unnecessarily.

🔎 Proposed fix to clean up apt cache
 # Install dependencies
 apt-get update
 apt-get install -y --no-install-recommends autoconf automake build-essential curl libftdi-dev libtool libusb-1.0-0-dev git pkg-config rpi.gpio-common texinfo libgpiod-dev libjim-dev
+apt-get clean
+rm -rf /var/lib/apt/lists/*

15-16: Consider using shallow clone for efficiency.

Cloning the full repository history increases build time and consumes unnecessary disk space. Since the build only needs the latest version, a shallow clone would be more efficient.

🔎 Proposed fix for shallow clone
 # Clone OpenOCD repository
-git clone https://github.com/raspberrypi/openocd.git --recursive
+git clone https://github.com/raspberrypi/openocd.git --depth 1 --recursive --shallow-submodules

Additionally, consider pinning to a specific commit hash or tag for reproducible builds and supply-chain security.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 268aeb5 and c25bae8.

📒 Files selected for processing (2)
  • stage-openmower/45-openocd/00-run-chroot.sh
  • stage-openmower/45-openocd/00-run.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • stage-openmower/45-openocd/00-run.sh
🧰 Additional context used
🪛 Shellcheck (0.11.0)
stage-openmower/45-openocd/00-run-chroot.sh

[warning] 22-22: Quote this to prevent word splitting.

(SC2046)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (3)
stage-openmower/45-openocd/00-run-chroot.sh (3)

1-1: LGTM!

The shebang with -e flag ensures the script exits immediately on any command failure, which is appropriate for build pipelines.


11-13: LGTM!

The directory creation and navigation are correct. Using mkdir -p ensures the command succeeds even if /opt already exists.


18-23: Build and install sequence looks correct.

The standard autotools build sequence (bootstrap → configure → make → make install) is appropriate for OpenOCD. The configure flags enable the necessary hardware interfaces for Raspberry Pi GPIO support.

- add additional check to ensure GPIO_CHIP is not an empty string before assignment
- prevent potential configuration errors when GPIO_CHIP variable exists but has empty value
- update test status for ESC access on HW-V2 CM4 (🟡 -> ✅)
- update test status for OpenOCD remote debugging on HW-V2 CM4 and CM5 (🟡 -> ✅)
- add clarifying footnote for Comitup captive portal WiFi configuration

🔧 chore(openocd): simplify xcore configuration script

- remove dynamic `find_rp1_alias` procedure and associated logic which fails on CM4
- hardcode `_GPIO_CHIP` variable to `0` for consistency
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @TESTED_FEATURES.md:
- Line 34: Fix the grammar in the footnote text by changing "entering you home
WiFi credentials" to "entering your home WiFi credentials" in the
TESTED_FEATURES.md footnote.
🧹 Nitpick comments (1)
stage-openmower/45-openocd/files/xcore.cfg (1)

27-27: GPIO_CHIP hardcoding removes flexibility but simplifies code.

Line 27 hardcodes _GPIO_CHIP to 0, replacing the previous dynamic find_rp1_alias logic. This intentional simplification (per commit message) trades flexibility for reliability by eliminating the previously buggy dynamic detection.

Consider adding a comment explaining why this is acceptable (e.g., "GPIO chip is always 0 on Raspberry Pi 5") for future maintainers who might wonder about this design choice.

💭 Optional: Add clarifying comment
 set _GPIO_CHIP 0
+# Note: GPIO chip index is always 0 on Raspberry Pi 5 with gpiod
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 04e1066 and b3ace29.

📒 Files selected for processing (2)
  • TESTED_FEATURES.md
  • stage-openmower/45-openocd/files/xcore.cfg
🧰 Additional context used
🪛 LanguageTool
TESTED_FEATURES.md

[grammar] ~34-~34: Ensure spelling is correct
Context: ...o power-cycle your mower after entering you home WiFi credentials

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (2)
stage-openmower/45-openocd/files/xcore.cfg (2)

12-19: Safe file reading with proper error handling.

The read_file proc correctly uses catch to handle file-opening errors and gracefully returns an empty string on failure. This is appropriate for reading optional system files like /sys/module/pcie_aspm/parameters/policy.


21-25: Helpful PCIe ASPM performance diagnostic.

The warning about PCIe ASPM settings is useful for users debugging bitbang performance. Using read_file ensures the check is non-fatal if the file doesn't exist on older kernels.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
TESTED_FEATURES.md (1)

25-25: Fix plural form for consistency with adjacent feature.

Line 25 uses singular "Port" while line 24 uses plural "Ports" for the same command pattern. Align to plural for consistency.

📝 Proposed fix
-| GNSS access                              | Port get exposed via `openmower ...` cmd      |      ✅       |      🟡       |      🟡       |
+| GNSS access                              | Ports get exposed via `openmower ...` cmd     |      ✅       |      🟡       |      🟡       |
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3ace29 and d4f0e6d.

📒 Files selected for processing (1)
  • TESTED_FEATURES.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

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.

3 participants