On Tue, Mar 08, 2016 at 12:56:55PM +0000, Mark Rogers wrote:
On 7 March 2016 at 18:31, Chris Green cl@isbd.net wrote:
Can't you add something to rc.local that would look for files in the SD card and execute them? You'd need to change rc.local once but that's all.
The SD card is where the OS is. Any time I re-image I'll need to make the same edits.
Ah, yes I see, of course, it's a Pi isn't it.
Ie the "workflow" is:
- Download latest Raspbian disk image from the Pi website
- Use dd to copy it to SD (ie overwriting what's there)
- Use tar to extract a set of my files over the top of the freshly
created SD card
- Eject SD card and boot the Pi from it
I can add a step that makes various edits as well as just replacing files but so much of the Debian system is based around not editing system files but adding your own alongside (eg /etc/cron.d, /etc/apache2/conf.d) that it seems odd that something as fundamental as "run this on startup" isn't covered in the same way.
Won't *any* executable file in the appropriate /etc/rcX.d directory get executed for that run level?
Your tar extract can just put an executable in the appropriate run-level directory (or directories) can't it?