Comment 39 for bug 2065180

Revision history for this message
Chris Halse Rogers (raof) wrote :

> I don't know how to differentiate between if `manual_add_modules` was called by a script in /usr/share/initramfs-tools or from outside.

I *think* you could have `manual_add_modules` check the environment for something like `INITRAMFS_TOOLS_IN_USER_CONFIG=1` or something, and change behaviour based on that. You'd not set it while executing files in /usr/share/initramfs-tools, then you'd set it before executing the scripts in user config directories.

> The only safer solution that I can come up with: Keep `manual_add_modules` as it is and introduce a new function (e.g. `manual_stage_modules`) that introduces the new behavior.

This would also work. This approach has the advantage that it's clearer what's happening, and the disadvantages that it needs more work in other packages to get the benefit and that it still changes the behaviour in ways which theoretically might be visible to user configuration.

I don't have a strong opinion on which approach should be taken (particularly: I've not *actually implemented* my solution, so it might be infeasible).