From patchwork Tue Jun 23 11:38:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 1315115 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=crapouillou.net header.i=@crapouillou.net header.a=rsa-sha256 header.s=mail header.b=whWszF6F; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49rkp82mdsz9sRN for ; Tue, 23 Jun 2020 21:39:28 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 222B68940D; Tue, 23 Jun 2020 11:39:24 +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 QQwWTkJyMJ0C; Tue, 23 Jun 2020 11:39:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 2045489236; Tue, 23 Jun 2020 11:39:22 +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 4F6341BF3E1 for ; Tue, 23 Jun 2020 11:39:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4BFB9879AB for ; Tue, 23 Jun 2020 11:39:20 +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 J4YwGWs7RniW for ; Tue, 23 Jun 2020 11:39:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from crapouillou.net (outils.crapouillou.net [89.234.176.41]) by whitealder.osuosl.org (Postfix) with ESMTPS id 414838795E for ; Tue, 23 Jun 2020 11:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1592912355; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=uGufyEXVqIFEclWe7Qqh2IfLm1xvYRT2jiO9GUIFp8w=; b=whWszF6FFtQJwwklAR8GesWN6ZounDzjGgDzGWT7yHAMJLKaXU7G1C6O3V4p1Hk00i+3R1 kcqy//Mm6OQqAERo7RdFZlQLvkeOFUHhs86GAXE8QKcj9AcS2bYvnWZd0AD6/LWfRw1zPg iq0WhBWOuSKQoyjiM1ST55+Ea9U11Z8= From: Paul Cercueil To: buildroot@busybox.net Date: Tue, 23 Jun 2020 13:38:59 +0200 Message-Id: <20200623113859.172177-1-paul@crapouillou.net> MIME-Version: 1.0 Subject: [Buildroot] [PATCH] linux: run depmod only if modules directory exists X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Cercueil Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" If the modules directory that corresponds to the version of the kernel being built has been deleted, don't try to run depmod, which will obviously fail. This can happen for instance when the modules are stripped from the main root filesystem, and placed into a separate filesystem image, so that the root filesystem and the kernel can be updated separately. Signed-off-by: Paul Cercueil --- linux/linux.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux/linux.mk b/linux/linux.mk index b90b032bb9..d31933fea1 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -490,7 +490,8 @@ endef # Run depmod in a target-finalize hook, to encompass modules installed by # packages. define LINUX_RUN_DEPMOD - if grep -q "CONFIG_MODULES=y" $(LINUX_DIR)/.config; then \ + if test -d $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED) \ + && grep -q "CONFIG_MODULES=y" $(LINUX_DIR)/.config; then \ $(HOST_DIR)/sbin/depmod -a -b $(TARGET_DIR) $(LINUX_VERSION_PROBED); \ fi endef