Lets Build Something
19 April 2021
It may be even easier than you thought!
sudo git clone --depth=1 https://github.com/raspberrypi/tools cd tools/usbboot sudo apt-get install libusb-1.0-0-dev
sudo make
sudo ./rpiboot
Once you have this compiled and running, the rpiboot program will wait until it finds the CM4 Module.
Now we simply set the J2 jumper for disabling eMMC boot, and we plug the CM4 module into the computer, and into power.
Once the device is detected, we will have a new /dev/sda or sdb block device. We can now flash the device, or backup a image of it.
below is an example of the input file being a RPIos image, and the target being /dev/sda (assuming this is the correct device)
sudo dd if=2020-12-02-raspios-buster-armhf-lite.img of=/dev/sda bs=4MiB
if you have made a custom set of changes directly on your RPI, and you wish to make an image from it, we can do the reverse as follows:
sudo dd of=/dev/sda if=my_custom_rpi_cm4_image.img bs=4MiB