Back in early 2016, I ran into a problem while customising a Debian Live CD that I maintain. I wanted it to include a piece of third-party, proprietary freeware, in a way that didn't break the terms of the license, while keeping the process automated. Ultimately, I found a solution that, while slightly overcomplicated, did the job pretty nicely. I documented it at on an article titled Large files on a custom Debian installer.
Earlier this year I revisited this problem, and I could find a much simpler solution that involves fewer moving parts. This is the summary:
- Create a directory
config/includes.chroot/tmpand put there the files you require.
- Make it so that your VCS ignores this directory (eg: add it to
.gitignoreif you use Git).
- Write a config hook that accesses these files at
/live-build/config/includes.chroot/tmp, running installers, copying them to the right location, or generally whatever it is you need to do with them.
And that's pretty much it. For a bonus, you could have a script that runs as part of the build process and downloads the files for you. That would help others who use your scripts later (or yourself, when you forget the details a few weeks down the line).
For an example of this, check out the pull request I created in my project. To run the buid I use a Makefile, where I added a dependency to show a message with instructions when the third-party files are not in place: https://github.com/pablobm/w2c3-livecd/pull/5