mass-storage-gadget64: eMMC is exported as removable media, so Windows cannot write a GPT image
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- linux, raspberry-pi, shell
- Área
- embedded-iot
Línea de trabajo
Los atributos de la LUN se establecen en el script de shell configure-gadgets, en el overlay de rootfs de mass-storage-gadget64, alrededor de las líneas 69-73. El issue enlaza ese archivo en la rama buildroot, así que revisa ese repositorio y no este. Compara la configuración de lun.0 allí con el valor predeterminado del kernel para removable y encuentra el atributo que falta. Está terminado cuando Windows informa la eMMC como medio fijo y Raspberry Pi Imager puede escribir una imagen GPT, lo que requiere reconstruir boot.img y confirmarlo con el hardware.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C
- Estrellas
- 1.4k
- Forks
- 318
- Merge medio
- 15 h 55 min
- PR fusionados (30 d)
- 6
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de raspberrypi/usbboot
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
raspberrypi/usbboot#397 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
raspberrypi/usbboot#391 · 4 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
raspberrypi/usbboot#387 · 1 comentario ·
-
Windows installer fails to install BCM2711 USB Boot driver (Code 28) – Zadig/WinUSB workaroundAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
raspberrypi/usbboot#383 · 1 comentario · 2 reacciones ·
-
Add `brew` installer for OSxAbiertoenhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
raspberrypi/usbboot#295 · 6 comentarios · 1 reacción ·
Todos los issues de raspberrypi/usbboot
Issues similares
-
difficulty: easy docs good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Ryan-Millard/Img2Num#842 ·
Los mantenedores suelen responder en 12 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
SanderMertens/flecs#2461 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100