I'm sorry I did not clearly worded what I intended to say. Let me try
again.
On Thu, 19 Nov 2020 03:25:28 -0000, GitLab Bridge on behalf of Ben Crocker wrote:
The warning actually comes from the text that is being cat'ed to
the output file, so I think this is legitimate, if somewhat confusing.
I am objecting to the very idea of shellcheck warning on usage of
undeclared variables. Shell is designed to mix environment variables
and script variables. If a script wants to get input from the
environment it was run in, it just accesses the given environment
variable. Such variable will not be defined anywhere in the script.
Note this relies on unknown variable evaluating to an empty string.
In retrospective, it may not have been the best design decision of the
shell authors but here we are. Triggering a warning on such (common!)
usage is unhelpful.
And no, rootfs is defined in this script; bootprefix will be set,
ultimately, by whomever invokes bls.conf.
Exactly my point. Yet you are referencing
"/lib/modules/<kernel>/bls.conf" which comes from
"$rootfs/lib/modules/<kernel>/bls.conf". You should be referencing
"/vmlinuz-<kernel>" which comes from
"$bootprefix/vmlinuz-<kernel>".
But as I said, I find the comment unnecessary.
Jiri