From patchwork Wed Jan 17 17:44:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 862431 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zMDxJ2tldz9s7f for ; Thu, 18 Jan 2018 04:44:36 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1FB7989851; Wed, 17 Jan 2018 17:44:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mLmss1WwaC2l; Wed, 17 Jan 2018 17:44:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 86AE6895F6; Wed, 17 Jan 2018 17:44:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id E05701C01EF for ; Wed, 17 Jan 2018 17:44:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DB58389023 for ; Wed, 17 Jan 2018 17:44:28 +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 HZlEleKefTX3 for ; Wed, 17 Jan 2018 17:44:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7AAF78900D for ; Wed, 17 Jan 2018 17:44:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id 723B91EE2BDD; Wed, 17 Jan 2018 18:44:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FqrxOVXr3uJe; Wed, 17 Jan 2018 18:44:25 +0100 (CET) Received: from P-ASN-Evian-romnao.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com [176.157.204.145]) by idris.smile.fr (Postfix) with ESMTPSA id 49D651EE2BD1; Wed, 17 Jan 2018 18:44:25 +0100 (CET) From: Romain Naour To: buildroot@buildroot.org Date: Wed, 17 Jan 2018 18:44:11 +0100 Message-Id: <1516211058-466-2-git-send-email-romain.naour@smile.fr> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516211058-466-1-git-send-email-romain.naour@smile.fr> References: <1516211058-466-1-git-send-email-romain.naour@smile.fr> Subject: [Buildroot] [PATCH v2 1/8] package/skeleton-init-common: add /bin/sh to /etc/shells X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add the default shell /bin/sh to /etc/shells only if BR2_SYSTEM_BIN_SH_NONE is not selected. Signed-off-by: Romain Naour Acked-by: "Yann E. MORIN" --- v2: add double-dollar after /bin/sh (Yann) remove empty /etc/shells from skeleton (Yann, Peter) move the hook right after it's defined (Yann) --- package/skeleton-init-common/skeleton-init-common.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/skeleton-init-common/skeleton-init-common.mk b/package/skeleton-init-common/skeleton-init-common.mk index 8228a81..03cb744 100644 --- a/package/skeleton-init-common/skeleton-init-common.mk +++ b/package/skeleton-init-common/skeleton-init-common.mk @@ -79,6 +79,13 @@ define SKELETON_INIT_COMMON_SET_BIN_SH rm -f $(TARGET_DIR)/bin/sh endef else +# Add /bin/sh to /etc/shells otherwise some login tools like dropbear +# can reject the user connexion. See man shells. +define SKELETON_INIT_COMMON_ADD_SH_TO_SHELLS + grep -qsE '^/bin/sh$$' $(TARGET_DIR)/etc/shells \ + || echo "/bin/sh" >> $(TARGET_DIR)/etc/shells +endef +SKELETON_INIT_COMMON_POST_INSTALL_TARGET_HOOKS += SKELETON_INIT_COMMON_ADD_SH_TO_SHELLS ifneq ($(SKELETON_INIT_COMMON_BIN_SH),) define SKELETON_INIT_COMMON_SET_BIN_SH ln -sf $(SKELETON_INIT_COMMON_BIN_SH) $(TARGET_DIR)/bin/sh