ev3dev / brickstrap

Tool for bootstrapping Debian and creating bootable image files for embedded systems
MIT License
35 stars 26 forks source link

Component inheritance. #32

Closed dlech closed 8 years ago

dlech commented 8 years ago

Now that I have set up the ev3dev-jessie projects as a single project, I see that it would be benificial for components to be able to include other components. I had to leave myself some notes about how the different components work and how to mix and match them. It would be much easier make the includes part of the board definition so you don't have to type them every time. The inheritance looks like this...

ev3: base, debian
rpi-base: base
rpi1: rpi-base, raspbian
rpi2: rpi-base, debian

Obviously, this is not actually how it would be implemented. But, it would allow be to just specify the one component instead of having to know which 3 to choose.

cmacq2 commented 8 years ago

The easiest way to do this is to permit the config file to pull in additional components by setting an EXTRA_COMPONENTS variable and making sure that iterate components does two loops:

You probably want a helper function to delegate to for the actual loop logic, and then call it twice appropriately from the current looping function.

You would need to check you do not include the same component twice through EXTRA_COMPONENTS (that is you need to silently omit duplicates pulled in via EXTRA_COMPONENTS).

... Basically it would look like an almost exact copy of the logic that PR #29 used when it still supported multiple images.