Skip to content

Copilot recovery build fix - #3

Closed
DUptain1993 wants to merge 8 commits into
mainfrom
copilot-recovery-build-fix
Closed

Copilot recovery build fix#3
DUptain1993 wants to merge 8 commits into
mainfrom
copilot-recovery-build-fix

Conversation

@DUptain1993

@DUptain1993 DUptain1993 commented Nov 9, 2025

Copy link
Copy Markdown
Owner

High-level PR Summary

This PR fixes build configuration issues for the TWRP recovery on the Motorola Kansas device. The changes simplify the BoardConfig.mk by switching to prebuilt kernel references, adjusting boot header version from 4 to 3, correcting partition sizes, and streamlining TWRP settings. A new .project manifest file is added to define repository dependencies for the kernel and vendor blobs. The upload-to-github.sh script is completely rewritten to trigger GitHub Actions workflows via the gh CLI instead of providing manual upload instructions.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 motorola/kansas/BoardConfig.mk
2 motorola/kansas/.project
3 upload-to-github.sh

Need help? Join our Discord

Updated architecture and bootloader configurations, modified partition sizes, and adjusted recovery settings for the Kansas device.

@recurseml recurseml Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread motorola/kansas/BoardConfig.mk
Comment thread upload-to-github.sh Outdated
Comment thread ci/init_repo.sh
Comment thread ci/init_repo.sh Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread upload-to-github.sh
echo "Branch: $MANIFEST_BRANCH"
echo

if gh workflow run "$WORKFLOW_FILE" -R "$GITHUB_USER/$GITHUB_REPO" -f manifest_branch="$MANIFEST_BRANCH"; then

Copilot AI Nov 11, 2025

Copy link

Choose a reason for hiding this comment

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

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\".

Suggested change
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

Copilot uses AI. Check for mistakes.
# Partitions
BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 32)
# --- Partitions ---
BOARD_FLASH_BLOCK_SIZE := 262144 # (256 * 1024)

Copilot AI Nov 11, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
BOARD_FLASH_BLOCK_SIZE := 262144 # (256 * 1024)
BOARD_FLASH_BLOCK_SIZE := 131072 # (128 * 1024)

Copilot uses AI. Check for mistakes.
include device/motorola/kansas/sepolicy/sepolicy.mk
# --- Android 15 / API 35 Specifics ---
# This matches the device's original firmware
PRODUCT_SHIPPING_API_LEVEL := 35

Copilot AI Nov 11, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
PRODUCT_SHIPPING_API_LEVEL := 35
BOARD_SHIPPING_API_LEVEL := 35

Copilot uses AI. Check for mistakes.
Comment thread ci/init_repo.sh
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

Copilot AI Nov 11, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
"$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

Copilot uses AI. Check for mistakes.
DUptain1993 and others added 2 commits November 10, 2025 19:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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