Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Mar 2013 13:05:24 +0530
From:      "Jayachandran C." <jchandra@freebsd.org>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   [PATCH] kenv issue when there is no static environment
Message-ID:  <CA%2B7sy7CL5VKD9WSJ%2B0mH5p-VUMYhLrjw0V4=PSzPRzwe_oNvFw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--bcaec54b48d06ddddd04d71466c4
Content-Type: text/plain; charset=ISO-8859-1

Planning to check the attached patch later this week, please let me
know if there any objections.

----

In case where there are no static kernel environment entries, the
function init_dynamic_kenv() adds an incorrect entry at position 0 of
the dynamic kernel environment. This entry is usually empty and
confuses kenv(1). The entries added later by kenv(1) does not seem to
be added, even though they are.

The environment passed to the kernel can be empty when it is loaded
from a bootloader other than loader(8).


JC.

--bcaec54b48d06ddddd04d71466c4
Content-Type: application/octet-stream; name="kenv-fix.patch"
Content-Disposition: attachment; filename="kenv-fix.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_hdvbcwrf0

SW5kZXg6IHN5cy9rZXJuL2tlcm5fZW52aXJvbm1lbnQuYwo9PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMva2Vy
bi9rZXJuX2Vudmlyb25tZW50LmMJKHJldmlzaW9uIDI0Nzc2NSkKKysrIHN5cy9rZXJuL2tlcm5f
ZW52aXJvbm1lbnQuYwkod29ya2luZyBjb3B5KQpAQCAtMjMxLDIwICsyMzEsMjMgQEAgaW5pdF9k
eW5hbWljX2tlbnYodm9pZCAqZGF0YSBfX3VudXNlZCkKIAlrZW52cCA9IG1hbGxvYygoS0VOVl9T
SVpFICsgMSkgKiBzaXplb2YoY2hhciAqKSwgTV9LRU5WLAogCQlNX1dBSVRPSyB8IE1fWkVSTyk7
CiAJaSA9IDA7Ci0JZm9yIChjcCA9IGtlcm5fZW52cDsgY3AgIT0gTlVM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Ms
IGlnbm9yaW5nICVzXG4iLAotCQkJICAgIGNwKTsKIAl9CiAJa2VudnBbaV0gPSBOVUxMOwogCg==
--bcaec54b48d06ddddd04d71466c4--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B7sy7CL5VKD9WSJ%2B0mH5p-VUMYhLrjw0V4=PSzPRzwe_oNvFw>