Has anyone been able to figure out how this PiBakery works - I mean, under the hood? I.e., from what I can tell, the operative trick is that it creates a shell script that gets (somehow) executed by Raspbian on first bootup.
Now, here's the thing. A large percentage of the posts on this forum are about this general class of problem - that is, they are some variation on "How do I preconfigure a Raspbian SD card?". And the answer (excluding PiBakery from the discussion for the moment) is "Drop a file in /boot with the appropriate filename and, possibly, contents" and it will happen. Obviously, this only works for a small subset of the possible things people might want to do, and many posters have argued for a more general "runme" kind of capability. That is, they would like to be able to put a file called, say, "runme.dh" in /boot and have that (shell script) be run automatically by Raspbian on first boot. Now, this hasn't happened, primarily because the powers that be either don't like the idea or don't want to have to work through all the implications such a feature might bring down upon them. They prefer to do it piecemeal, rather than provide a general hook. That's their call...
But, it seems that this is exactly what PiBakery does. Which means, as far as I can tell, that at least one of the following must be true:
1) That Mr. Ferguson has figure out a way to "hack" (and I mean that in the most positive and complimentary way) into the ext4 filesystem on the SD card of a freshly imaged Raspbian system and install a "runme" hook. This seems tricky but is, in general, doable. I've done similar types of hacking - where you figure out exactly where in an image a certain piece of information is stored and you (carefully!) over-write it. I have done this in other contexts, but not on the Raspbian image (yet).
2) That he has arranged with the Raspbian maintainers for the inserting of such a hook already (one otherwise not accessible to the general public).
3) Such a hook has always been there; it has just never been publicly documented.
I'd be really curious to know which of these it is. Furthermore, until this information is made public, I'd be leery of doing anything with PiBakery.
If this post appears in the wrong forums category, my apologies.