d-i can be pre-seed by specifying parameters on the kernel command line,
but instead of using /proc/cmdline for that, env2debconf relies on
the kernel passing unrecognized parameters as environment variables.
Usual form of d-i parameters include slashes and dashes, such as
rescue/enable=true - which is not valid for regular shell variables.
Neither bash nor dash `set' builtin displays such environment vars,
while `env' command does. d-i used `set' with busybox's ash, but
this one displayed these vars in the past but stopped doing that at
some point. And after that time, d-i relied on reverting the
corresponding commit from busybox in order to restore old `set'
behavior.
Instead of relying on a hackish/questionable patch to busybox, let's
just use `env' here instead of `sed'.
This is a simple version. The more correct approach, I think, is to parse
/proc/cmdline in this place (and rename env2debconf to cmdline2debconf
maybe). This also will help with hostname= which, when given, gets eaten
by the kernel, not passing it as environment variable, -- so that the
first half of env2debconf tries to guess if hostname= has been specified
or not. But that's for later time.
---
I can commit this directly, I guess, but since d-i is not my area at all,
and I never, ever, committed to any of its components, I'm sending this
to the ML first.
env2debconf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/env2debconf b/env2debconf
index c75b06b..9c3794d 100755
--- a/env2debconf
+++ b/env2debconf
@@ -32,7 +32,7 @@ NEWLINE='
'
OLDIFS=$IFS
IFS=$NEWLINE
-for line in $(set); do
+for line in $(env); do
var="${line%%=*}"
val="${line#[!=]*=}"
# support preseeding without forcing seen flag
--
2.47.3