Copilot recovery build fix - #3
Conversation
Updated architecture and bootloader configurations, modified partition sizes, and adjusted recovery settings for the Kansas device.
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on c157339..20ccf13
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (3)
• motorola/kansas/.project
• motorola/kansas/BoardConfig.mk
• upload-to-github.sh
Updated the manifest branch to 'twrp-14.1' for compatibility.
Updated the init_repo.sh script to include licensing information, improved error handling, and adjusted default parameters for better usability.
There was a problem hiding this comment.
Pull Request Overview
This PR fixes build configuration issues for the Motorola Kansas TWRP recovery by simplifying the configuration, switching to prebuilt kernel references, and adding proper dependency management.
- Simplified BoardConfig.mk with corrected boot header version (4→3), partition sizes, and streamlined TWRP settings
- Added .project manifest to define kernel and vendor blob repository dependencies
- Rewrote upload-to-github.sh to trigger GitHub Actions workflows via gh CLI
- Improved ci/init_repo.sh with better branch detection and error handling
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| motorola/kansas/BoardConfig.mk | Simplified configuration with prebuilt kernel paths, corrected boot header version and partition sizes, streamlined TWRP flags |
| motorola/kansas/.project | Added manifest for kernel and vendor blob repository dependencies |
| upload-to-github.sh | Complete rewrite to use GitHub CLI for workflow triggering instead of manual upload instructions |
| ci/init_repo.sh | Improved branch selection logic with better fallback handling and error reporting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo "Branch: $MANIFEST_BRANCH" | ||
| echo | ||
|
|
||
| if gh workflow run "$WORKFLOW_FILE" -R "$GITHUB_USER/$GITHUB_REPO" -f manifest_branch="$MANIFEST_BRANCH"; then |
There was a problem hiding this comment.
The workflow input parameter name is incorrect. The workflow file defines the input as 'MANIFEST_BRANCH' (uppercase), but the script passes 'manifest_branch' (lowercase). This will cause the workflow to fail or use the default value. Change to -f MANIFEST_BRANCH=\"$MANIFEST_BRANCH\".
| if gh workflow run "$WORKFLOW_FILE" -R "$GITHUB_USER/$GITHUB_REPO" -f manifest_branch="$MANIFEST_BRANCH"; then | |
| if gh workflow run "$WORKFLOW_FILE" -R "$GITHUB_USER/$GITHUB_REPO" -f MANIFEST_BRANCH="$MANIFEST_BRANCH"; then |
| # Partitions | ||
| BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 32) | ||
| # --- Partitions --- | ||
| BOARD_FLASH_BLOCK_SIZE := 262144 # (256 * 1024) |
There was a problem hiding this comment.
The comment states '(256 * 1024)' but the actual value is 262144 which equals 256KB. The original value was 131072 (128KB based on page size * 32). Ensure this change is intentional and matches the device's actual flash block size, as an incorrect value can cause flashing failures.
| BOARD_FLASH_BLOCK_SIZE := 262144 # (256 * 1024) | |
| BOARD_FLASH_BLOCK_SIZE := 131072 # (128 * 1024) |
| include device/motorola/kansas/sepolicy/sepolicy.mk | ||
| # --- Android 15 / API 35 Specifics --- | ||
| # This matches the device's original firmware | ||
| PRODUCT_SHIPPING_API_LEVEL := 35 |
There was a problem hiding this comment.
Using 'PRODUCT_SHIPPING_API_LEVEL' in BoardConfig.mk is incorrect. This is a product-level variable that should be defined in device.mk or product makefiles (e.g., twrp_kansas.mk), not in BoardConfig.mk. Use 'BOARD_SHIPPING_API_LEVEL' here instead or move this to the appropriate product makefile.
| PRODUCT_SHIPPING_API_LEVEL := 35 | |
| BOARD_SHIPPING_API_LEVEL := 35 |
| echo "Running repo init -u $MANIFEST_URL -b $BRANCH" | ||
| "$repo_cmd" init --depth=1 -u "$MANIFEST_URL" -b "$BRANCH" || { echo "repo init failed"; exit 4; } | ||
| echo "Running repo init -u ${MANIFEST_URL} -b ${FINAL_BRANCH}" | ||
| "$REPO_BIN" init -u "${MANIFEST_URL}" -b "${FINAL_BRANCH}" --depth=1 --no-repo-verify |
There was a problem hiding this comment.
The '--no-repo-verify' flag disables verification of the repo tool itself, which is a security risk. Consider removing this flag unless there's a specific reason to bypass verification, as it could allow execution of malicious code if the repo tool is compromised.
| "$REPO_BIN" init -u "${MANIFEST_URL}" -b "${FINAL_BRANCH}" --depth=1 --no-repo-verify | |
| "$REPO_BIN" init -u "${MANIFEST_URL}" -b "${FINAL_BRANCH}" --depth=1 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
High-level PR Summary
This PR fixes build configuration issues for the TWRP recovery on the Motorola Kansas device. The changes simplify the
BoardConfig.mkby switching to prebuilt kernel references, adjusting boot header version from 4 to 3, correcting partition sizes, and streamlining TWRP settings. A new.projectmanifest file is added to define repository dependencies for the kernel and vendor blobs. Theupload-to-github.shscript is completely rewritten to trigger GitHub Actions workflows via theghCLI instead of providing manual upload instructions.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
motorola/kansas/BoardConfig.mkmotorola/kansas/.projectupload-to-github.sh