From patchwork Sun Jul 12 14:35:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 494128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id A89E41402B4 for ; Mon, 13 Jul 2015 00:36:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C0C8091355; Sun, 12 Jul 2015 14:36:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FDMyD2VWWG-C; Sun, 12 Jul 2015 14:36:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 82E02913A2; Sun, 12 Jul 2015 14:36:06 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 985591C2847 for ; Sun, 12 Jul 2015 14:35:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 95856A2E88 for ; Sun, 12 Jul 2015 14:35:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6UFmB5xmNam8 for ; Sun, 12 Jul 2015 14:35:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from exchange.essensium.com (220.77.144.195.ipv4.evonet.be [195.144.77.220]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0D325A2E8C for ; Sun, 12 Jul 2015 14:35:57 +0000 (UTC) Received: from vandecaa-laptop.home (10.8.0.10) by beleexch01.local.ess-mail.com (10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Sun, 12 Jul 2015 16:35:33 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: Date: Sun, 12 Jul 2015 16:35:30 +0200 Message-ID: <1436711730-20599-5-git-send-email-arnout@mind.be> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436711730-20599-1-git-send-email-arnout@mind.be> References: <1436711730-20599-1-git-send-email-arnout@mind.be> MIME-Version: 1.0 X-Originating-IP: [10.8.0.10] X-ClientProxiedBy: beleexch01.local.ess-mail.com (10.3.7.8) To beleexch01.local.ess-mail.com (10.3.7.8) Subject: [Buildroot] [PATCH 5/5] system: use backtick instead of $(shell ...) make function X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 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) --- This one is a bit complicated so could perhaps also be dropped. It is only useful for printvars, not for per-package staging. --- system/system.mk | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/system/system.mk b/system/system.mk index 2794667..a85678f 100644 --- a/system/system.mk +++ b/system/system.mk @@ -69,19 +69,17 @@ ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y) ifeq ($(TARGET_GENERIC_ROOT_PASSWD),) SYSTEM_ROOT_PASSWORD = else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(TARGET_GENERIC_ROOT_PASSWD)),) -SYSTEM_ROOT_PASSWORD = $(TARGET_GENERIC_ROOT_PASSWD) +SYSTEM_ROOT_PASSWORD = '$(TARGET_GENERIC_ROOT_PASSWD)' else PACKAGES += 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 "$(TARGET_GENERIC_PASSWD_METHOD)" "$(TARGET_GENERIC_ROOT_PASSWD)") +SYSTEM_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(TARGET_GENERIC_PASSWD_METHOD)" "$(TARGET_GENERIC_ROOT_PASSWD)"`" endif else # !BR2_TARGET_ENABLE_ROOT_LOGIN -SYSTEM_ROOT_PASSWORD = * +SYSTEM_ROOT_PASSWORD = "*" endif define 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 += SYSTEM_SET_ROOT_PASSWD