skeleton: use backtick instead of $(shell ...) make function
Only the instance for setting the root password is changed. The instance in SYSTEM_GETTY is harmless since it just uses echo and tail. If SKELETON_TARGET_GENERIC_ROOT_PASSWD is passed as a hashed password by the user, it contains $, so the '-quotes are needed. If it is not, we need the backtick to be expanded so "-quotes are needed. Therefore, the quoting is moved to the definition of SYSTEM_ROOT_PASSWORD. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
3d1530f467
commit
0291f7c220
@ -95,19 +95,19 @@ ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
|
||||
ifeq ($(SKELETON_TARGET_GENERIC_ROOT_PASSWD),)
|
||||
SYSTEM_ROOT_PASSWORD =
|
||||
else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)),)
|
||||
SYSTEM_ROOT_PASSWORD = $(SKELETON_TARGET_GENERIC_ROOT_PASSWD)
|
||||
SYSTEM_ROOT_PASSWORD = '$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)'
|
||||
else
|
||||
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.
|
||||
SYSTEM_ROOT_PASSWORD = $(shell $(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)")
|
||||
SYSTEM_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_TARGET_GENERIC_PASSWD_METHOD)" "$(SKELETON_TARGET_GENERIC_ROOT_PASSWD)"`"
|
||||
endif
|
||||
else # !BR2_TARGET_ENABLE_ROOT_LOGIN
|
||||
SYSTEM_ROOT_PASSWORD = *
|
||||
SYSTEM_ROOT_PASSWORD = "*"
|
||||
endif
|
||||
|
||||
define SKELETON_SYSTEM_SET_ROOT_PASSWD
|
||||
$(SED) 's,^root:[^:]*:,root:$(SYSTEM_ROOT_PASSWORD):,' $(TARGET_DIR)/etc/shadow
|
||||
$(SED) s,^root:[^:]*:,root:$(SYSTEM_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
|
||||
endef
|
||||
TARGET_FINALIZE_HOOKS += SKELETON_SYSTEM_SET_ROOT_PASSWD
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user