From patchwork Sun Sep 10 10:21:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov via arch-projects X-Patchwork-Id: 245 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost.localdomain [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 2966E13688F8 for ; Sun, 10 Sep 2017 10:21:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU autolearn=ham autolearn_force=no version=3.4.1 Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Sun, 10 Sep 2017 10:21:21 +0000 (UTC) Received: from orion.archlinux.org (localhost.localdomain [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 888AB65A7B455; Sun, 10 Sep 2017 10:21:19 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Sun, 10 Sep 2017 10:21:19 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 6339620856; Sun, 10 Sep 2017 10:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1505038879; bh=wF8dD+IJvoQOC5Px4tA8nLtMmAlv2quggCxFdrelYnY=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc; b=OtWDReEU+O2sRH6oTeWp/KRzXBgshfLKKrUiqvANgg3gglPnFIbwpnn7WmmI20zr0 GWeFKgjWCdMx7XdERH/ms9ECV5g28evFiYrmGKneja5kPrNKpiJisF4KHjI4f3knyg wy3/Z5IC7j+24u2gg230ffV4g+v1Rby6fVLPYA3odfcxpMZo3bsNzl5YuY2IQAhWgn CLdiIArsusjixQpm2qVzO2zRJeR25q+BDOYIny5/dvJWTG8Vljbo8v0gQictG/iLfK W3ENKOZ2RYyw7Tq275u0N9I7PkeV08armDWkEEeFIrbBOfXs5G25nImN1QaFTFDpUK vnNlV9yYzWTdkMoSEF5qyNlC1n+9mxAuusXGKwAeEI+BMJlvq15ig6IaTB7JZ5Mx7k xg72QZ/ZmHCbNzBHNBV5J7sIXCz/W5uYouIA1LbhadtZ0ldsONY7VrusQ42ZSSlmif NqlmLogc+Dc8jBBh92q/piaKnuOALTV2Of0fXzDEwsFl61etpbKpepWhfTvNfBqwox 7XPiNeEHutH/fRtVNDAsl5EkVvuzAQAQblCGh8NiSS3n/aEKrh4R4Zo1V93vjL9shZ ggfEBa+DnUebFfwRA38uTPeBscEGxN9rTbbDI/RDhU2EX/Sr9pe8+uyvhLYvmXnNZL 99ltFWhBqaOywPqKyb60C7sA= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id A964E207B0 for ; Sun, 10 Sep 2017 10:21:17 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Sun, 10 Sep 2017 10:21:17 +0000 (UTC) Received: from orion.archlinux.org (localhost.localdomain [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id CAF8265A7B451 for ; Sun, 10 Sep 2017 10:21:16 +0000 (UTC) Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Sun, 10 Sep 2017 10:21:16 +0000 (UTC) Received: by mail-qk0-x242.google.com with SMTP id g128so3949071qke.0 for ; Sun, 10 Sep 2017 03:21:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pN9Z9pS0VQ699azWSl/SNHpVQIut6+ie7R3FwccZY2c=; b=bHUbIAn0QFy4cALXCOYCFtFhd9LjuwsRZVOdRsjpUe70hK2/Uc+5roglBmSmsgVKxo EYZf5qpaeVp32WLGR97CRNdGJzB01i65uGsqcVGeVaPITpT5oHiG6RKzut1Fou5TYFc8 2xflNBybtqgMU0n9QbncKJa1nUMgiNkDtrYzazJdAzxo3oNUOI/UnKkil7EUJr0gh2uq Vv/THVIVPN6/nIUHDmQxlu/jqKzkz8Q+ek9e7MaeJS0xTk3QndS9cGs7GKX9mHGwtVld GhY5YHnP7ogXmjGJ5sEP/FsXnkmkJsCbQPPnjdADTSd4ZNX6pGzaJ6/JBzrwLowbYGAg ImeQ== X-Gm-Message-State: AHPjjUj8N4zSk+D8HowFwgFSmYrNBmCIILp6I5QiJQFZRU+T7eOYW1L/ WvTuZqhOI0BglNjkWvA= X-Google-Smtp-Source: AOwi7QBc6FAkwG0pSb/MsfHWfyte83Uz4zY8W/lAtooIWk53H2EYeKT1pq0SnipphsVOePjAN41IJQ== X-Received: by 10.55.155.203 with SMTP id d194mr10290109qke.288.1505038875355; Sun, 10 Sep 2017 03:21:15 -0700 (PDT) Received: from localhost ([109.129.103.61]) by smtp.gmail.com with ESMTPSA id p25sm4445170qte.28.2017.09.10.03.21.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Sep 2017 03:21:14 -0700 (PDT) To: arch-projects@archlinux.org Date: Sun, 10 Sep 2017 12:21:11 +0200 Message-Id: <20170910102111.28539-1-ike.devolder@gmail.com> X-Mailer: git-send-email 2.14.1 Subject: [arch-projects] [mkinitcpio][PATCH] check if module is builtin kernel in add_module X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: BlackEagle via arch-projects Reply-To: Arch Linux projects development discussion Cc: BlackEagle Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" When we want to make sure a module is added to initcpio, but the module is built in the kernel, we now get an error the module is not found. Therefore we should check if the module is builtin and don't fail when its found there. example: when sd_mod is built in your kernel you got an error before ==> ERROR: module not found: `sd_mod' but the module can be found in /lib/modules/$KERNELNAME/modules.builtin 'kernel/drivers/scsi/sd_mod.ko' Signed-off-by: BlackEagle --- functions | 3 +++ 1 file changed, 3 insertions(+) -- 2.14.1 diff --git a/functions b/functions index 941312f..3051e81 100644 --- a/functions +++ b/functions @@ -400,6 +400,9 @@ add_module() { done < <(modinfo -b "$_optmoduleroot" -k "$KERNELVERSION" -0 "$target" 2>/dev/null) if (( !found )); then + if grep "$target" "$_optmoduleroot/lib/modules/$KERNELVERSION/modules.builtin" > /dev/null 2>&1; then + return 0 + fi (( ign_errors || _addedmodules["$target"] )) && return 0 error "module not found: \`%s'" "$target" return 1