action #60650
closedcoordination #60518: [functional][u][rpi][epic] Add support for real systems without IPMI or KVM-IP in openQA/os-autoinst
[functional][u][rpi] Add a system to flash a remote USB disk (and or µSD card) for generalhw backend
0%
Description
To test real hardware (Raspberry Pi 3/4 would be the first targets), we need to flash a USB stick (or uSD card, or any storage) remotely.
The easiest way seems to use another board with USB OTG, connected to a USB host of the SUT, and attach the image to boot as a USB mass storage gadget to emulate a USB disk.
We need to:
- Choose the hardware with a (working) USB OTG port, an Ethernet port and a (fast) storage big enough
- Create script to automate the copy/clean-up and mount/umount of this image on USB OTG
Another solution could have been to use WiFi SD card such as Flash Air [1], but AFAIK:
- there is no uSD version
- you can copy files to FAT partition only
- SD card must powered-up to be accessible, and the board would boot then.
[1] https://www.toshiba-memory.com/products/toshiba-wireless-sd-cards-flashair-w-04/
Updated by ggardet_arm over 4 years ago
Investigations on aarch64 hardware with an OTG port (usable as a peripheral to be able to connect to an host):
- Raspberry Pi 4: need to check if the board could be powered from header pins and OTG port used to connect to USB host
- HiKey960: USB support is not upstream yet https://en.opensuse.org/HCL:HiKey_960#Known_issues
- NVIDIA Jetson Nano: USB OTG works fine on openSUSE Tumbleweed, with linux-next (kernel 5.4 has PCIe errors)
- Nanopi Neo2: Need to check if USB OTG is compatible with external 5V and working on openSUSE
Some armv7 boards have a USB OTG port (usable as a peripheral to be able to connect to an host):
- BeagleBoneBlack: OTG port is set to peripheral in Device Tree, but it is not usable atm - https://bugzilla.opensuse.org/show_bug.cgi?id=1158654
- Arndale board: OTG port is not supported by MULTI_ARCH kernels apparently: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/usb/gadget/udc/Kconfig?h=v5.4.2#n236
- BD-SL-i.MX6 (formerly known as SabreLite): OTG port works fine
Updated by ggardet_arm over 4 years ago
We could also use a USB switch https://www.iogear.com/usb-switch.htm with a USB stick or USB HDD.
If the selection is manual, we would need to hack it to perform the switch from code (probably via a GPIO and a relay) and check the current input selected (GPIO or just check if present on "flasher" host or not, if only 2 hosts).
This should be tested to check if RPi3/4 can actually boot from a USB stick connected via this kind of system.
Updated by ggardet_arm over 4 years ago
Side notes:
RPi4 cannot boot from USB yet, but will in the future, according to https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/ and https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/bootflow_2711.md
RPi3 can boot from USB just fine.
Updated by ggardet_arm over 4 years ago
- Status changed from New to In Progress
I used a BD-SL-i.MX6 board (formerly known as SabreLite) to mount a JeOS image on USB g_mass_storage gadget for RPi3. (*.raw.xz image is copied to SabreLite via SSH, the image is then uncompressed and mounted on USB gadget).
Raspberry Pi 3 does not boot directly from this USB mass storage gadget (RPi limitation?), so I flashed an SD card with only firmware files and u-boot. U-Boot uses grub, kernel, dtb and rootfs from USB.
Updated by ggardet_arm over 4 years ago
Another solution would be a PCIe card with USB otg (or USB-C?) port, usable with g_mass_storage gadget, if it exists.
Updated by mgriessmeier over 4 years ago
- Subject changed from Add a system to flash a remote USB disk for generalhw backend to [functional][u][rpi] Add a system to flash a remote USB disk for generalhw backend
- Assignee set to ggardet_arm
Updated by ggardet_arm about 4 years ago
Add to the list:
- NVIDIA Jetson Nano
- Nanopi Neo2
Updated by ggardet_arm about 4 years ago
According to Yousaf, usb gadget works fine on Jetson Nano with openSUSE Tumbleweed with kernel next-20200228 1 on Jetson nano. Kernel v5.4 has some PCIe errors.
Updated by ggardet_arm about 4 years ago
For systems unable to boot from USB, but are able to boot from µSD cards, I have been pointed to SDWire and SD_MUX boards which are open hardware.
There is also https://shop.linux-automation.com/index.php?route=product/product&product_id=50 which is probably more expensive and is not open hardware, but still has open source software.
Updated by ggardet_arm about 4 years ago
- Subject changed from [functional][u][rpi] Add a system to flash a remote USB disk for generalhw backend to [functional][u][rpi] Add a system to flash a remote USB disk (and or µSD card) for generalhw backend
Updated by ggardet_arm about 4 years ago
- Status changed from In Progress to Resolved
We have enough solutions to close this ticket.