-
Notifications
You must be signed in to change notification settings - Fork 0
Add workflow_dispatch for on-demand builds and fix Quectel RM551E-GL modem detection #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Unable to perform a code review. You have run out of credits 😔 |
Co-authored-by: spotty118 <19340462+spotty118@users.noreply.github.com>
Co-authored-by: spotty118 <19340462+spotty118@users.noreply.github.com>
Co-authored-by: spotty118 <19340462+spotty118@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds two major features: on-demand GitHub Actions builds and comprehensive Quectel RM551E-GL 5G modem support.
- Enables workflow dispatch for selective platform/kernel builds, reducing build time from 6+ hours to ~45 minutes for single platforms
- Adds automatic detection and optimization for RM551E modems across all USB modes (QMI, MBIM, RNDIS, NCM)
- Includes comprehensive documentation for both features
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/build.yml |
Added workflow_dispatch trigger with platform and kernel selection inputs; updated matrix to support conditional builds |
.github/workflows/build-vps.yml |
New workflow for VPS package builds with distribution type selection |
common/package/modems/Makefile |
Added installation of modem optimization scripts and hotplug rules for automatic RM551E initialization |
common/package/modems/files/rm551e-init.sh |
New initialization script for automatic RM551E modem detection, driver loading, and configuration |
common/package/modems/files/modem-ca-optimize.sh |
Enhanced carrier aggregation script with RM551E-specific optimizations (5G NR CA, EN-DC, data aggregation) |
common/package/modems/src/data/2c7c-0800 |
Modem configuration for RM551E MBIM mode (PID 0x0800) |
common/package/modems/src/data/2c7c-0900 |
Modem configuration for RM551E RNDIS mode (PID 0x0900) |
common/package/modems/src/data/2c7c-0901 |
Modem configuration for RM551E NCM mode (PID 0x0901) |
common/package/modems/src/README_RM551E.md |
Comprehensive documentation for RM551E support, configuration, and troubleshooting |
RM551E_QUICK_REF.md |
Quick reference guide for RM551E AT commands and common operations |
ON_DEMAND_BUILDS.md |
User guide for triggering on-demand builds via GitHub Actions |
TEST_PLAN.md |
Detailed test plan for validating workflow and modem support features |
README.md |
Updated with on-demand build instructions and RM551E modem support information |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Install init scripts | ||
| $(INSTALL_DIR) $(1)/etc/hotplug.d/usb | ||
| echo '#!/bin/sh' > $(1)/etc/hotplug.d/usb/99-modem-init | ||
| echo '[ "$$ACTION" = "add" ] && [ "$$PRODUCT" = "2c7c/800/*" -o "$$PRODUCT" = "2c7c/801/*" -o "$$PRODUCT" = "2c7c/900/*" -o "$$PRODUCT" = "2c7c/901/*" ] && /usr/bin/rm551e-init.sh &' >> $(1)/etc/hotplug.d/usb/99-modem-init |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The hotplug rule uses a long chain of -o (OR) operators without proper grouping, which can lead to unexpected behavior due to operator precedence. The condition should use explicit grouping or be split for better maintainability.
Consider restructuring to:
echo '[ "$$ACTION" = "add" ] && { [ "$$PRODUCT" = "2c7c/800/*" ] || [ "$$PRODUCT" = "2c7c/801/*" ] || [ "$$PRODUCT" = "2c7c/900/*" ] || [ "$$PRODUCT" = "2c7c/901/*" ]; } && /usr/bin/rm551e-init.sh &' >> $(1)/etc/hotplug.d/usb/99-modem-initOr use a case statement for better readability:
case "$$PRODUCT" in
2c7c/800/*|2c7c/801/*|2c7c/900/*|2c7c/901/*)
/usr/bin/rm551e-init.sh &
;;
esac| echo '[ "$$ACTION" = "add" ] && [ "$$PRODUCT" = "2c7c/800/*" -o "$$PRODUCT" = "2c7c/801/*" -o "$$PRODUCT" = "2c7c/900/*" -o "$$PRODUCT" = "2c7c/901/*" ] && /usr/bin/rm551e-init.sh &' >> $(1)/etc/hotplug.d/usb/99-modem-init | |
| echo '[ "$$ACTION" = "add" ] && { [ "$$PRODUCT" = "2c7c/800/*" ] || [ "$$PRODUCT" = "2c7c/801/*" ] || [ "$$PRODUCT" = "2c7c/900/*" ] || [ "$$PRODUCT" = "2c7c/901/*" ]; } && /usr/bin/rm551e-init.sh &' >> $(1)/etc/hotplug.d/usb/99-modem-init |
| for dev in /dev/ttyUSB*; do | ||
| if [ -c "$dev" ]; then | ||
| # Try to communicate with the device | ||
| if timeout 2 sh -c "echo AT > $dev && cat $dev 2>/dev/null" | grep -q "OK"; then |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable $dev is not properly quoted inside the sh -c command string. While unlikely to cause issues with /dev paths, this is a shell best practice violation that could lead to word splitting or pathname expansion issues.
The command should be:
if timeout 2 sh -c "echo AT > \"$dev\" && cat \"$dev\" 2>/dev/null" | grep -q "OK"; thenAlternatively, use a different approach that doesn't require embedding the variable in the string:
if echo AT > "$dev" 2>/dev/null && timeout 2 cat "$dev" 2>/dev/null | grep -q "OK"; then| if timeout 2 sh -c "echo AT > $dev && cat $dev 2>/dev/null" | grep -q "OK"; then | |
| if timeout 2 sh -c "echo AT > \"$dev\" && cat \"$dev\" 2>/dev/null" | grep -q "OK"; then |
| workflow_dispatch: | ||
| inputs: | ||
| target: | ||
| description: 'Target platform (leave empty for all)' |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description says "leave empty for all" but since this is a type: choice input, users cannot leave it empty - they must select from the dropdown options. The description should be updated to reflect the actual behavior.
Suggested change:
description: 'Target platform to build (select "all" to build all platforms)'| description: 'Target platform (leave empty for all)' | |
| description: 'Target platform to build (select "all" to build all platforms)' |
| - 'gl-mt6000' | ||
| default: 'all' | ||
| kernel: | ||
| description: 'Kernel version (leave empty for all)' |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description says "leave empty for all" but since this is a type: choice input, users cannot leave it empty - they must select from the dropdown options. The description should be updated to reflect the actual behavior.
Suggested change:
description: 'Kernel version to use (select "all" to build both versions)'| description: 'Kernel version (leave empty for all)' | |
| description: 'Kernel version to use (select "all" to build both versions)' |
| { | ||
| "desc": "Quectel RM551E-GL 5G (RNDIS mode)", | ||
| "type": "rndis_host", | ||
| "control": 2, |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The RNDIS mode configuration uses "control": 2 while the other RM551E modes (MBIM, QMI, NCM) use "control": 4. This inconsistency should be verified against the modem's hardware specifications.
If RNDIS mode truly uses a different control interface number, this is correct. However, if all RM551E modes should use the same control interface, this should be changed to "control": 4 for consistency with the other configurations.
| "control": 2, | |
| "control": 4, |
| inputs: | ||
| vps_type: | ||
| description: 'VPS distribution type' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - 'debian' | ||
| - 'ubuntu' | ||
| - 'all' | ||
| default: 'all' |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow defines a vps_type input with options for 'debian', 'ubuntu', and 'all', but this input is never used in the workflow. The build steps always package all VPS scripts regardless of the selected option.
Either:
- Remove the unused
vps_typeinput if the workflow is meant to always build all types, or - Implement conditional logic to filter/build based on the selected VPS type
Currently, the input misleads users into thinking they can select a specific distribution type when it has no effect.
| inputs: | |
| vps_type: | |
| description: 'VPS distribution type' | |
| required: true | |
| type: choice | |
| options: | |
| - 'debian' | |
| - 'ubuntu' | |
| - 'all' | |
| default: 'all' |
| fi | ||
| done | ||
|
|
||
| return $found |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return value logic is inverted. In shell scripts, return code 0 indicates success and non-zero indicates failure. When found=1 (modem detected), the function returns 1, which is interpreted as failure by the calling code at line 94. This causes the script to exit when a modem IS detected, instead of when it's NOT detected.
Fix by changing line 26 to:
return $(( 1 - found ))Or alternatively:
[ $found -eq 1 ]
return $?| return $found | |
| return $(( 1 - found )) |
| send_at_command "$device" "AT+CFUN=0" 2 | ||
|
|
||
| # Configure USB mode for optimal performance | ||
| # Mode 3 = QMI, Mode 1 = MBIM, Mode 0 = RNDIS |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The USB mode comment is incorrect. According to the documentation and AT commands used throughout the codebase:
- Mode 0 = QMI (not Mode 3)
- Mode 1 = MBIM
- Mode 5 = RNDIS (not Mode 0)
There is no Mode 3 for this modem. The comment should be:
# Mode 0 = QMI, Mode 1 = MBIM, Mode 5 = RNDISThis is consistent with the AT command on line 46 which sets mode 0 for QMI, and with the documentation in README_RM551E.md and RM551E_QUICK_REF.md.
| # Mode 3 = QMI, Mode 1 = MBIM, Mode 0 = RNDIS | |
| # Mode 0 = QMI, Mode 1 = MBIM, Mode 5 = RNDIS |
Description
Enables on-demand builds via GitHub Actions UI and adds comprehensive support for Quectel RM551E-GL 5G modems across all USB modes.
On-Demand Builds
workflow_dispatchtobuild.ymlwith selectable target platform and kernel versionbuild-vps.ymlworkflow for independent VPS package generationQuectel RM551E-GL Support
Problem: RM551E enumerates with different PIDs depending on USB mode, causing detection failures.
Solution:
2c7c:0800(MBIM),2c7c:0801(QMI),2c7c:0900(RNDIS),2c7c:0901(NCM)rm551e-init.sh: Automatic initialization on hotplug with mode detectionmodem-ca-optimize.sh: RM551E-specific carrier aggregation (5G NR CA, EN-DC, 32KB URB/64 datagrams)/etc/hotplug.d/usb/99-modem-initauto-configures on USB connectKey optimizations:
Files Changed
Workflows:
.github/workflows/build.yml- Added workflow_dispatch matrix conditionals.github/workflows/build-vps.yml- New VPS-specific workflowModem Support:
common/package/modems/Makefile- Script installation + hotplug rulescommon/package/modems/files/rm551e-init.sh- New auto-init scriptcommon/package/modems/files/modem-ca-optimize.sh- Enhanced with RM551E detectioncommon/package/modems/src/data/2c7c-{0800,0900,0901}- Additional USB mode configsDocumentation:
ON_DEMAND_BUILDS.md- Workflow usage guideRM551E_QUICK_REF.md- AT commands referencecommon/package/modems/src/README_RM551E.md- Detailed modem documentationREADME.md- Updated with feature overviewValidation
Checklist
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.