I find myself building up lots of versions of SD images as I incrementally develop a working system. Is there a way to manage this better, such as by capturing the SD image backup not as a img/gz but in a way that git can version control?

Grateful for any advice on how to approach this with dd plus any words of wisdom on the general approach.

  • It depends how you are doing the changes? Offline then write to SD or changes on the SD?
    – Piotr Kula
    Nov 30 '14 at 21:42
  • Have you considered a basic disk image, and then applying your changes using puppet or similar confiig management tool. It may take a little more time than burning a new complete image, but it does avoid storing/managing multiple images. Nov 30 '14 at 22:05
  • @ppumkin I'm just making changes to the working raspberry and backing-up externally
    – geotheory
    Dec 1 '14 at 12:52
  • @steve-robillard I haven't considered anything like that. Could you possibly point to any tutorial or guidance with more detail?
    – geotheory
    Dec 1 '14 at 12:52
  • 1
    I would start here nofail.de/2013/01/pulling-strings-on-raspberry-pi (but assuming you are using Raspbian would just install via sudo apt-get install puppet) I am assuming that the various copies differ in what packages/services are installed and running. With puppet you can create a manifest, store it in github and reuse individual bits (e.g. install git and create a .giconfig file). Puppetlabs also has an entire section devoted to learning puppet - puppetlabs.com/learn Also several books are available for the beginner I would recommend Puppet 3 Beginner’s Guide. Dec 1 '14 at 23:17

My approach would be somehow different, but I think its worth to try it:

Clone this repo: https://github.com/Metrological/buildroot and try to build image with it. It's quite straightforward.

Then, you can make changes to it and keep record with git easily.

That is what I do for my RPI projects and it works great. Performances and very good (better than with Raspbian or Arch) and you have full control over whole OS.

  • Thanks. That toolkit looks to go much further than this question HTML5 etc. But I'm a bit confused as it talks about being loaded onto the Pi. Does it work by version-controlling the boot partition from the 'buildroot' partition?
    – geotheory
    Dec 1 '14 at 12:49
  • I think you got it wrong. buildroot is set of scripts which are in version control system. Those scripts generate system images, including boot/ partition files and whole root filesystem. You will not have compiled binaries in version control, but scripts that can generate those binaries (this is how it is supposed to work).
    – 10robinho
    Dec 1 '14 at 14:11

As long as you don't have any requirements on real external HW (usage of GPIO et al) an alternate approach would be to run the image on kvm/qemu. Then you can create as many snapshots as you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.