From patchwork Wed Jun 11 19:41:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 4338181 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8533E9F314 for ; Wed, 11 Jun 2014 19:42:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 453F8202F0 for ; Wed, 11 Jun 2014 19:42:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26ADD202EC for ; Wed, 11 Jun 2014 19:42:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752333AbaFKTmE (ORCPT ); Wed, 11 Jun 2014 15:42:04 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:54101 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751276AbaFKTmD (ORCPT ); Wed, 11 Jun 2014 15:42:03 -0400 Received: by mail-pb0-f47.google.com with SMTP id un15so148877pbc.6 for ; Wed, 11 Jun 2014 12:42:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hyCgIoZgn70ATYN+yvy5Ov55MkG/XJpR4rwmqf/rN+w=; b=Zxh4Ow7zhtw93I2EVU35xkezdjjJpbMu8GmtgxD6IY51UYawHLArh2YClTB+h5xcPT I6hqkvQnTvMQ5fH6QzXQRpfMLJNThYb2wFRPuChMWmAlXAzko44Ea/5wZV/gWF1ASeMh qz3mH0oJGq4yZtchimIzDGaScXF3iCDB2s2Ht7cP84cdjjcLMenBedLtWUpfUzy5aCSt B5jFG/I+PJPrQ6x3uVM+QC2/JPoqFIyAX1WAUm+LJSNJdHtd96x0fRiUDxXOzEPDAms8 XB2gpsAPVOz7dpKt2s0h5CWrbArc9cHM2kIb/7Yiv8Sblp5yopnGNOEoH1t76Og0jg30 9bvQ== X-Gm-Message-State: ALoCoQnsiJyNrrw0Jeya7avGDJcHTnfHdMlncblD0H/jsBuY45D0h1VEnNeZsDuQHODw2rUq7LD1 X-Received: by 10.66.97.4 with SMTP id dw4mr15842737pab.55.1402515722266; Wed, 11 Jun 2014 12:42:02 -0700 (PDT) Received: from localhost (50-76-60-73-ip-static.hfc.comcastbusiness.net. [50.76.60.73]) by mx.google.com with ESMTPSA id fk4sm33598585pab.23.2014.06.11.12.42.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jun 2014 12:42:01 -0700 (PDT) From: Andy Lutomirski To: "H. Peter Anvin" , x86@kernel.org Cc: Michal Marek , linux-kbuild@vger.kernel.org, "Linux-Kernel@Vger. Kernel. Org" , Andy Lutomirski Subject: [PATCH] x86,build: Fix make -jN modules_install install Date: Wed, 11 Jun 2014 12:41:57 -0700 Message-Id: <37910a32e3d223a688a2743376bdde8fbdc8ef5c.1402515662.git.luto@amacapital.net> X-Mailer: git-send-email 1.9.3 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Every few months, I forget why I type: $ sudo make -j12 modules_install && sudo make -j12 install instead of just: $ sudo make -j12 modules_install install I try the latter, it appears to work, and then my machine won't boot because dracut got confused. This fixes it once and for all: if you ask make to install modules and a kernel, you almost certainly want the modules installed *first* so that your initramfs scripts can find the modules. Signed-off-by: Andy Lutomirski --- arch/x86/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 33f71b0..7280d28 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -240,6 +240,15 @@ PHONY += install install: $(Q)$(MAKE) $(build)=$(boot) $@ +# If installing modules and a kernel, it's very likely that some initramfs +# script associated with installing the kernel will reference the modules, +# so make sure that modules are installed first. +ifneq ($(filter modules_install,$(MAKECMDGOALS)),) + ifneq ($(filter modules_install,$(MAKECMDGOALS)),) + install: modules_install + endif +endif + PHONY += vdso_install vdso_install: $(Q)$(MAKE) $(build)=arch/x86/vdso $@