[Please use "reply to all", to record your messages in the bug reporting system.]
On Sun, 2019-07-07 at 19:38 +0200, Guenther Brunthaler wrote: > Am 2019-07-07 um 15:50 schrieb Ben Hutchings: > > > These functions are meant to be used by boot scripts, not by hook > > scripts. > > Thank you, this is good to know! > > Unfortunatly, this wasn't so clear for me. > > > The documentation is consistent with that. > > Actually, the documentation is *lacking* in this area. > > It does not explain at all how a hook script shall emit its diagnostic > messages. > > So the reader is left to speculations. [...] Yes, I can see how you went down this path. We should separate functions meant for use at boot time, and those few functions meant for use at either build or boot time; and then only include definitions of the latter in "hook-functions". The answer to "how to log messages" is largely the same as for any shell script: use echo or printf, and redirect warnings and errors to stderr. If you have messages that should only appear in verbose mode (mkinitramfs -v), test the "verbose" variable, e.g.: [ "${verbose}" = y ] && echo "Doing my thing" Ben. -- Ben Hutchings The Peter principle: In a hierarchy, every employee tends to rise to their level of incompetence.
signature.asc
Description: This is a digitally signed message part