Skip to content

Conversation

KenAdamson
Copy link

Summary

This PR fixes a critical bug where rpi-clone fails to detect and copy boot files on modern Raspberry Pi OS systems that mount the boot partition at /boot/firmware instead of the legacy /boot location.

Problem

  • Modern Raspberry Pi OS (Bookworm and later) mounts the boot partition at /boot/firmware
  • rpi-clone v2.0.22 only checks for /boot, causing it to miss the boot partition
  • This results in cloned SD cards with empty boot partitions that won't boot

Solution

Added backward-compatible detection for both mount points:

  • Checks /boot/firmware first (modern systems)
  • Falls back to /boot if not found (legacy systems)
  • Updates all boot partition detection logic throughout the script
  • Properly handles cmdline.txt in both locations

Changes Made

  1. Updated boot device detection to check both /boot/firmware and /boot
  2. Modified partition mount point checks to recognize both locations
  3. Updated cmdline.txt path detection for both directory structures
  4. Maintained full backward compatibility with older Raspberry Pi OS versions

Testing

  • Tested on Raspberry Pi with modern OS (boot at /boot/firmware)
  • Successfully clones USB disk to SD card with proper boot files
  • Cloned SD card boots correctly

This fix ensures rpi-clone works correctly on both modern and legacy Raspberry Pi OS installations.

KenAdamson and others added 2 commits September 7, 2025 14:45
Modern Raspberry Pi OS (Bookworm and later) mounts the boot partition
at /boot/firmware instead of the legacy /boot location. This causes
rpi-clone to fail to detect and copy boot files, resulting in
unbootable cloned SD cards.

This commit adds backward-compatible support for both mount points:
- Check /boot/firmware first (modern), then fall back to /boot (legacy)
- Update all boot partition detection logic
- Handle cmdline.txt in both locations
- Preserve compatibility with older Raspberry Pi OS versions

Fixes the issue where cloned SD cards have empty boot partitions when
using rpi-clone on systems with /boot/firmware mount point.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Update README to clearly indicate this is an actively maintained fork
- Highlight key improvements including modern Raspberry Pi OS compatibility
- Update installation instructions to use this fork
- Bump version to 2.0.23 to indicate changes from original

This fork addresses critical issues that have been unresolved in the
original repository since 2020, particularly the boot partition detection
for modern Raspberry Pi OS systems.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@framps
Copy link

framps commented Sep 8, 2025

Please check his fork which is a maintained fork of Bills repository and already contains code which supports Bookworm 😉

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