> 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).
> 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).