Skip to main content
Tweeted twitter.com/StackRaspi/status/1143760939017211904
edited tags
Link
Became Hot Network Question
Grammar
Link
Milliways
  • 61.5k
  • 32
  • 108
  • 212

Using Raspberry Pi to flash it'sits own SD card

Source Link

Using Raspberry Pi to flash it's own SD card

I'm developing a Buildroot OS for the Raspberry Pi, and my workflow requires very frequent re-flashing of the SD card to test new iterations. The process of removing the SD card from the Pi, flashing it on a Windows PC and then re-inserting it takes a lot of time. I would like to write a script that uses the currently running OS on the Rpi (accessed over SSH) to

  1. Download the new SD image
  2. Flash it to the SD, overwriting all existing OS files
  3. Reboot into the new OS

Step 2 is where I'm stuck. Is it possible for an operating system to overwrite itself?