From: alexpdp7 Date: Sat, 24 May 2025 09:15:09 +0000 (+0200) Subject: Replace explanation with link to tool X-Git-Url: https://xn--ix-yja.es/gitweb/?a=commitdiff_plain;h=f80c05aa6f4967be6377ef76513aef26c4dcb51c;p=alex.git Replace explanation with link to tool --- diff --git a/hardware/using-an-rpi-zero-as-an-usb-drive-to-install-operating-systems.md b/hardware/using-an-rpi-zero-as-an-usb-drive-to-install-operating-systems.md index c05e748..30dd737 100644 --- a/hardware/using-an-rpi-zero-as-an-usb-drive-to-install-operating-systems.md +++ b/hardware/using-an-rpi-zero-as-an-usb-drive-to-install-operating-systems.md @@ -10,39 +10,4 @@ There are alternatives: * netboot.xyz and other netboot images can boot operating systems over the network. * Multiboot USB software like Ventoy or YUMI. -## Using a Raspberry Pi Zero - -Linux devices can emulate USB mass storage devices (and other kinds of USB devices). - -However, powering a Linux device using a USB port might draw more current than it is safe, damaging the device powering the Linux device (e.g. a laptop you want to boot from USB). - -A simple option is getting a Raspberry Pi Zero (I used the 2 W model) with the [EP-0097](https://wiki.52pi.com/index.php/EP-0097) USB adapter. -This should be safe. -However, without any additional setup, the procedures I describe only work when using an always-on USB port. - -(Assembling the Raspberry Pi Zero into the USB adapter is straightforward. -However, I was confused: you must mount the thin acrylic shield below the USB dongle extension board, then the thick shield over the board, then the Raspberry Pi.) - -1. Use the Raspberry Pi Imager to create a MicroSD card for your Raspberry Pi Zero, configuring remote access via SSH and your wireless network. -1. Add `dtoverlay=dwc2` to `/boot/firmware/config.txt` to enable USB trickery, as per [the adapter instructions](https://wiki.52pi.com/index.php/EP-0097#For_the_latest_Raspberry_Pi_OS). -1. Connect the Raspberry Pi with the adapter into an always-on USB port of the device you want to use. -1. Stall the device boot process until you set everything up on the Raspberry. -1. Connect via ssh over wireless to the Raspberry Pi. -1. Download the image you want to use. -1. Use the `rmmod` command to remove any modules starting with `g_`. -1. Run `modprobe g_mass_storage file=/path/to/image` -1. After running this command, the device should be able to boot the image. - -### Notes - -* You can run a command such as `while date ; do sleep 1 ; done` to monitor that the Raspberry Pi does not reboot or poweroff. - -### Ideas - -Create an automated process that: - -* Installs Raspbian lite to an SD card -* Alters the SD partitions to create a large UDF partition -* Enables a systemd service on boot that exposes `/udf/image` as USB mass storage -* Then users can either manipulate the SD card through SSH, or by mounting the UDF partition -* `/udf/image` can be a symbolic link +See https://github.com/alexpdp7/rpi-zero-usb-iso/ for a tool to do this with a Raspberry Pi.