5

I already have few Raspberry Pi devices running Raspbian + my custom scripts. These device is internet connected and mounted at area which is hard to access, (e.g on top of a building)

Over the years, newer Raspbian version released or I created a newer custom image which I would like to deploy to all these devices easily.

Is there any example to remotely flash/update the OS images while the Pi is running live? (The scenario is like upgrading the Curiosity Mars land rover's OS from earth, then reboots it.)

goldilocks
  • 60,325
  • 17
  • 117
  • 234
Dennis
  • 383
  • 1
  • 5
  • 14

3 Answers3

3

You don't need to "flash it live". The firmware is on the SD card and loaded at every boot. Just update the system normally:

apt-get update
apt-get upgrade

The reboot. You probably want to test this in relation to whatever application software you're running on an at hand system first in case there are any glitches with that.

Most likely everything will be fine.

As others have suggested, you can also use rpi-update, which is a bash script that downloads the latest firmware from https://github.com/Hexxeh/rpi-firmware along with a kernel.

goldilocks
  • 60,325
  • 17
  • 117
  • 234
3

As far as deploying custom images remotely, I'm not sure how to go about it, but check out This. It's the Raspbian net install. You can put this on a running pi and when it restarts it auto installs a minimal raspbian image. If you check link, it github and maybe you can figure out how they did this by checking their code.

As far as just updating firmware remotely, just make sure you have rpi-update installed

 sudo apt-get install rpi-update

And then run

 sudo rpi-update 

Once firmware finished installing and there were no errors, you need to reboot to start using new firmware.

Edit: This will probably be more helpful. It's the same github repo, but it the BUILD.md file that has some useful info that may help you deploy a custom image remotely.

geoffmcc
  • 621
  • 5
  • 8
2

If you are doing remote updates, you can use a over-the-air updates tool built for this purpose to get more safety (e.g. rollback) and control (grouping, deployment status, etc). For example, Mender has official support for Raspbian now: https://hub.mender.io/t/raspberry-pi-3-model-b-b-raspbian

rduio
  • 21
  • 1