mass-storage-gadget64: eMMC is exported as removable media, so Windows cannot write a GPT image
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- linux, raspberry-pi, shell
- 領域
- embedded-iot
調査の方向性
LUNの属性は、mass-storage-gadget64のrootfsオーバーレイにあるシェルスクリプトconfigure-gadgetsの69〜73行目付近で設定されています。issueはこのファイルをbuildrootブランチへのリンクで示しているので、このリポジトリではなくそちらを確認してください。そこにあるlun.0の設定を、removableに対するカーネルのデフォルト値と比較し、欠けている属性を見つけてください。Windowsがeゼロ MMCを固定メディアとして認識し、Raspberry Pi GPTイメージを書き込めれば完了です。これにはboot.imgの再ビルドが必要で、実機での確認も必要です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
configure-gadgets in the mass-storage-gadget64 initramfs sets cdrom, ro and nofua for the LUN, but not removable:
removable therefore stays at the kernel default 1. Windows does not read a GPT on removable media: it mounts the whole eMMC as one "superfloppy" volume and rejects every raw write with ERROR_INVALID_FUNCTION. Raspberry Pi Imager, balenaEtcher, Win32DiskImager and diskpart all fail the same way, without any progress. Writing the same image from Linux works.
Adding one line next to the others fixes it:
echo 0 > functions/mass_storage.usb${id}/lun.0/removable
With that line, Windows shows the GPT with all partitions and Imager writes the image (13.5 GiB in about 14 minutes). We have been shipping a repacked boot.img with exactly this change; kernel, firmware and device trees are untouched.
Steps to reproduce the behaviour
- CM4 with eMMC, nRPIBOOT and USB_OTG jumpers fitted, USB connected to a Windows PC.
rpiboot -d mass-storage-gadget64(current boot.img from this repository).- Write any image with a GPT partition table to the exported disk with Raspberry Pi Imager.
- The write fails immediately; Disk Management shows one volume spanning the whole disk instead of the GPT partitions.
Workaround without rebuilding: on the gadget's serial console (USB COM port), detach the gadget, clear the bit and attach it again (re-attaching drops the console too, hence nohup):
G=/sys/kernel/config/usb_gadget/rpimsg
nohup sh -c "sleep 4; echo > $G/UDC; sleep 2; \
echo 0 > $G/functions/mass_storage.usb0/lun.0/removable; sleep 1; \
echo fe980000.usb > $G/UDC" > /tmp/fix.log 2>&1 &
Afterwards Get-CimInstance Win32_DiskDrive | Where-Object { $_.Model -match 'mmcblk' } | Select-Object Model, MediaType reports External hard disk media instead of Removable Media, and Imager writes.
Device(s)
Raspberry Pi CM4
Compute Module IO board.
Custom carrier board
RPIBOOT logs
No response
Kernel logs
No response
Device UART logs
No response
- 主要言語
- C
- スター
- 1.4k
- フォーク
- 318
- 平均マージ
- 15時間 55分
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
raspberrypi/usbboot のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
raspberrypi/usbboot#397 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
raspberrypi/usbboot#391 · コメント 4 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
raspberrypi/usbboot#387 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
raspberrypi/usbboot#383 · コメント 1 件 · リアクション 2 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
raspberrypi/usbboot#295 · コメント 6 件 · リアクション 1 件 ·
raspberrypi/usbboot の issue をすべて見る
似ている issue
-
difficulty: easy docs good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Ryan-Millard/Img2Num#842 ·
メンテナーはふだん 12 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SanderMertens/flecs#2461 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100