Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2832379pxb; Mon, 19 Apr 2021 15:26:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj7nWWUFH1GQJQgOqM9c2S2TNqq8x9lPYXs7AJMa6cuDxOsXKnS1qF5gS5pZ9nI8v4AVAq X-Received: by 2002:a17:902:a70f:b029:ea:d4a8:6a84 with SMTP id w15-20020a170902a70fb02900ead4a86a84mr25823165plq.42.1618871168979; Mon, 19 Apr 2021 15:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618871168; cv=none; d=google.com; s=arc-20160816; b=dGtEf/Uuo9lGFGZC5YfmRKbWGPvvdJAl+GXe0nrl14NOBjBe0gLZOmppwTE8KayG9H /3dLjjVclLERYxEhVmmZeOmRTmAFz6vPEgecNNfLFaB728DK0Cidls1SvAwluOVHEoud cHEvKiTZfx+NNG+qfswOoW8wJTBtcAKJR5ffipXf0SvJy7Gu8FYk0piAfCsl9lIYrElh aEMONLtSbpyznTC22yWgUqlJphviKhaBe/CwyLTonPJA6gGFDiwSTjEH/EWVkLj6lEGk agn6y+SuGRY+854MH7mosH/jNjqhh7N0cr0GetEKd9ad82aQ/M+AGLvgcaoiWDmcqlOO ntCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=s4Q4KeT+aEE/OwsAE9aacFN8BXDaHZAzNphILgcRt3k=; b=bYWuaXWaGKgC61OtAnkRalNOcbK4h5Oj3kOPIZ4mUAKErIHI/ky9QKmUWaFiuaVwP4 U+LiIwrNQbaY8EuPbH0v3fp/hGS8G8Hu/IdKkncoAmdFt4N1pgogWsMUuVlASRs4Z400 bfvG0sGj+RoGVSk/78ILYQib6dsWv8Z1UZ0fLaU2uzEBoyOBNKtKpcJHoYIk9FObZov/ J8q/eKqJucVNPQcuFzxlUjSc97sdzyWv2qpfJOyCBKdklnM8Mr7MuLeA79HRbQCVLMbo 3uevK/yLp10ox9fZn0rxcuNNVf/caRoXcPziv6ZaZwA/VR5R4sVApLTfrodRGd3SNtNY 6mWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2021032801 header.b=B7wFVncM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u133si17612258pgc.332.2021.04.19.15.25.57; Mon, 19 Apr 2021 15:26:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2021032801 header.b=B7wFVncM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242584AbhDSU4X (ORCPT + 99 others); Mon, 19 Apr 2021 16:56:23 -0400 Received: from terminus.zytor.com ([198.137.202.136]:50939 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241817AbhDSU4S (ORCPT ); Mon, 19 Apr 2021 16:56:18 -0400 Received: from tazenda.hos.anvin.org ([IPv6:2601:646:8602:8be0:7285:c2ff:fefb:fd4]) (authenticated bits=0) by mail.zytor.com (8.16.1/8.15.2) with ESMTPSA id 13JKslbW2399793 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 19 Apr 2021 13:54:58 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 13JKslbW2399793 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2021032801; t=1618865698; bh=s4Q4KeT+aEE/OwsAE9aacFN8BXDaHZAzNphILgcRt3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B7wFVncMlEl0LsPcexbIIrru/6YdcNhrI1+H/ipS4EgVGRDPG4xJoVlovV6+ROBxn PqarEgDrRLLusc6s1YPTZU5VGh/4ljnHsZp+61ZAjZhInE/ZTIsZ6DQ6vPoFh+D/Y2 Tvoe4MgUjtaiqXqS0kX+kCK1cCuswq/FmFBP0/EBvCTH4VnuJUrw5QK/jYJBBzeeAY e6IZ/eT75GXBXDcGp26YB04XbsBpKJycWH7xAPHABw67YkJeBWHE5BssI2LywuTMQB WZtU8DdE4SZ9ga4pJajaisaH2R7pqaQUOM88NcmtpqEiyrWdpp9SUS4YT6hS1R+Z7j HkPm/omtydE/g== From: "H. Peter Anvin" To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andy Lutomirski , Alexander Viro , Masahiro Yamada , Michal Marek Cc: Linux Kernel Mailing List , Kbuild Mailing List , "H. Peter Anvin" Subject: [PATCH 3/3] x86/boot: Add option to add modules.img to {fd,hd,iso}image Date: Mon, 19 Apr 2021 13:54:38 -0700 Message-Id: <20210419205438.1531413-4-hpa@zytor.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210419205438.1531413-1-hpa@zytor.com> References: <20210419205438.1531413-1-hpa@zytor.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "H. Peter Anvin" (Intel) Make it easy to generate a disk image which includes the all-modules initramfs image. Signed-off-by: H. Peter Anvin (Intel) --- arch/x86/Makefile | 3 ++- arch/x86/boot/Makefile | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 943f26a32834..74f4e66568d7 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -309,7 +309,8 @@ define archhelp echo ' isoimage - Create a boot CD-ROM image (arch/x86/boot/image.iso)' echo ' bzdisk/fdimage*/hdimage/isoimage also accept:' echo ' FDARGS="..." arguments for the booted kernel' - echo ' FDINITRD=file initrd for the booted kernel' + echo ' FDINITRD=file initrd for the booted kernel' + echo ' FDMODS=1 to include all modules as an initrd' echo '' echo ' kvm_guest.config - Enable Kconfig items for running this kernel as a KVM guest' echo ' xen.config - Enable Kconfig items for running this kernel as a Xen guest' diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index dfbc26a8e924..601ade7adc70 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile @@ -119,9 +119,20 @@ $(obj)/compressed/vmlinux: FORCE FDARGS = # Set this if you want one or more initrds included in the image FDINITRD = +# Set this to 1 if you want usr/modules.img included in the image +FDMODS = imgdeps = $(obj)/bzImage $(obj)/mtools.conf $(src)/genimage.sh +ifneq ($(FDMODS),) +imgdeps += $(objtree)/usr/modules.img +FDINITRD += $(objtree)/usr/modules.img + +$(objtree)/usr/modules.img: + $(Q)$(MAKE) -f $(srctree)/Makefile usr/modules.img +KBUILD_MODULES := 1 +endif + $(obj)/mtools.conf: $(src)/mtools.conf.in sed -e 's|@OBJ@|$(obj)|g' < $< > $@ -- 2.30.2