Image Builder PACKAGES from file

It would be quite helpful if the Makefile / make implementation would accept a file input with desired packages. Something simple like a text file with one package per line.

Thanks for considering ...

You can transform such a file into the required space-delimited string using

make PACKAGES="$(tr '\n' ' ' < file.txt)"

(edit: reduced for poignancy)

3 Likes

Thank you for the response. I'm doing something similar with zx but having a terrible time trying to convert the variable into the environment.

It would be instantly solved with the ability for make to handle it instead of having to be overly creative.

I do appreciate your share!

I had to scratch a similar itch a few years ago, and https://johannes.truschnigg.info/code/openwrt_autobuild/ was the result. I've been using it ever since (from 21.02 on). The code is certainly not pretty, but it works. The single-file script requires just Python 3.7 (or newer) with its stdlib, and takes an INI-style configuration file as the build recipe input - maybe it fits your bill! :slight_smile:

Thank you so much @colo I actually have a bash version that runs flawlessly. I've been moving all of my decades of bash to zx (read: nodejs + bash) as I delight in it's usage.

Thank you for sharing your repo, I'll certainly see if it sparks a thought on how I can overcome my current implementation.