mass-storage-gadget64: eMMC is exported as removable media, so Windows cannot write a GPT image
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- linux, raspberry-pi, shell
- Ambito
- embedded-iot
Direzione di ricerca
Gli attributi della LUN sono impostati nello script shell configure-gadgets, nell'overlay rootfs di mass-storage-gadget64, intorno alle righe 69-73. L'issue collega quel file sul branch buildroot, quindi controlla quel repository e non questo. Confronta le impostazioni di lun.0 lì con il valore predefinito del kernel per removable e trova l'attributo mancante. Il lavoro è completo quando Windows segnala la eMMC come supporto fisso e Raspberry Pi Imager riesce a scrivere un'immagine GPT, cosa che richiede di ricostruire boot.img e di confermarla sull'hardware.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- C
- Stelle
- 1.4k
- Fork
- 318
- Merge medio
- 15h 55m
- PR unite (30g)
- 6
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di raspberrypi/usbboot
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
raspberrypi/usbboot#397 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
raspberrypi/usbboot#391 · 4 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
raspberrypi/usbboot#387 · 1 commento ·
-
Windows installer fails to install BCM2711 USB Boot driver (Code 28) – Zadig/WinUSB workaroundAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
raspberrypi/usbboot#383 · 1 commento · 2 reazioni ·
-
Add `brew` installer for OSxApertaenhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
raspberrypi/usbboot#295 · 6 commenti · 1 reazione ·
Tutte le issue di raspberrypi/usbboot
Issue simili
-
difficulty: easy docs good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Ryan-Millard/Img2Num#842 ·
I maintainer di solito rispondono entro 12 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SanderMertens/flecs#2461 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100