[Buildroot] [PATCH 09/20] package/skeleton: drop dependency on host-mkpasswd
Yann E. MORIN
yann.morin.1998 at free.fr
Tue Jul 18 17:25:35 UTC 2017
Setting the root pasword is done in a target-finalize hook, so we do not
need to enforce a dependency from the skeleton onto host-mkpasswd.
Dropping that dependency will simplify making skeleton a virtual
package (in up-coming changes).
This however introduces a slight change in behaviour: previously,
host-mkpasswd would only be built if we needed to hash the root password
from its plain-text value. Now, host-mkpasswd is always built as soon as
the root password is non-empty, even if already pre-hashed.
Since host-mkpasswd is a really tiny weeny package bundled in Buidlroot,
with only two C files, built as a single unit with a single gcc call,
the overhead is really minimal. Compared to the simplifications this
will allow in the skeleton packages (plural: common, sysv, systemd,
custom) to come, this overhead is acceptable.
Yet another simplification, even if small, to ease providing multiple
Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
package/skeleton/skeleton.mk | 1 -
system/Config.in | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk
index 4a66f6ceca..4ec1ecbb51 100644
@@ -121,7 +121,6 @@ SKELETON_ROOT_PASSWORD =
else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)),)
SKELETON_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
-SKELETON_DEPENDENCIES += host-mkpasswd
# This variable will only be evaluated in the finalize stage, so we can
# be sure that host-mkpasswd will have already been built by that time.
SKELETON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
diff --git a/system/Config.in b/system/Config.in
index ed539dcbe0..5cb921f108 100644
@@ -224,6 +224,7 @@ config BR2_ROOTFS_MERGED_USR
bool "Enable root login with password"
+ select BR2_PACKAGE_HOST_MKPASSWD if BR2_TARGET_GENERIC_ROOT_PASSWD != ""
Allow root to log in with a password.
More information about the buildroot