From nobody Mon Feb 9 16:33:22 2026 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2305B328267 for ; Fri, 14 Nov 2025 14:28:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763130496; cv=none; b=n6UUTbPKjkrn/Mbooxy3pJJmsKCQjoP/+/h2/J28awXqHd2KmVEBioDX5GGLNHnWEboXJmc8dE1w3s1ujSJLphZHmvWIwoEhClfPLovJpiFLY7sI2eGdRFc0QKCrSa1/yawv5RHkppViVw2WSADXYe0KT23B2c3aHGrbVonFvWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763130496; c=relaxed/simple; bh=Khn8xl78nWKbQ9qiwRfPIiqdd7MMix5aw37wtwcBeyI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BCB0gCqFVtxDc/VrWgLSxnfXYkqGRpXgTnmYI9d2pb7mjZM95Ap2lpK2loMVKonMUKpbAr0bkT34BOoiQWRCQQI5M7N+m+hJ54u0vWXiUO+XOhDL18qLhUVk9l6/ZAiazs2LMPUJ1yozeig/+v+IZd8xRoLQOie/+H80w+7mFO8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=RFk+7/dr; arc=none smtp.client-ip=209.85.166.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="RFk+7/dr" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-948673fdc47so90641439f.3 for ; Fri, 14 Nov 2025 06:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1763130494; x=1763735294; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zlW9sVY3dHmO2QQaQTwq9Tqd8agWgn9nVM7+PnbVmYo=; b=RFk+7/drKj+JB0Ads7dZwQTeuDy1Ftbs8h3h2NOUILT16EiIhIUCU/hgV6V2keVPvC ZYvDJ3BqUduZgHxpy60Qem4QVY/iP899m2Tg6yYYKtjCky+YPWxmPTxuD1B4OWdk4o52 A5qcK75FpYC4pHTuegbJOpyfNLM8Ac9W5fWJ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763130494; x=1763735294; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zlW9sVY3dHmO2QQaQTwq9Tqd8agWgn9nVM7+PnbVmYo=; b=SErhHeEnRa27gJ5ESDHOjwuz2iyizOi72nb6oYtfEaThKT/MmaDzoC0xV+YRRPJDYQ wkt/Ifwfa95oWuN38dFRVkR5IvIu5vv2mEz0rHmrHkmEem/wlkxxTu3U7wmD76K1ftz8 YJX/tWnfSLI8haLtclLPTsXbQ9EY6Y/+1RmDNuSzKvc21Y8rmILJvIqmEFqOEMux7NzT OPgRzJdvMIeGeTh7/Bu+ETKDmqJjcQ32YX25j4z4kGjZNuPzFm89MWbip1EMDTuu2w4v gI046u8CmdoQzW6hoQISdZZqtUfOc2xZ1pwik/oe8bkQiBsliVF///h0WTqQ3XCkgZmm Tf1A== X-Forwarded-Encrypted: i=1; AJvYcCWSiz+RoMT+4DI4X43ZEtYQ5xtCBVNrYdPYmO27eqvhN5qs/BVo2tojdmIAtlEfUKYeujB1gjJEjklBLnQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyEEC/0oq9VsSjuCepRARSRcZDGTdC4yrceQT3S2f19KYAzeGau 9jkIDAO1Kg97pXxkR2DD+a1oML+T4leYq8GKa7Bv69vqJEya4vFl9hPmox+deBqaTQ== X-Gm-Gg: ASbGncvYyN8Ba/5biglZ2D/8t/UiYbWvwOGucQc8xETnVsCtfS5shU4Q2TQ2ozjLMKN YuPVvVl/bbi9JNFga2akqjrhfP7EUivMht0fKBXzJ7SuVHi0WwBdDFW5WGJxGmdFq5HfAvUXhGC kA3bmAgwZBDRGK2p3fZ5vsdxNlfvyGzsQsa5h+qP5POG6ATvOxQZCF7S5bzLVJnmBYO+UOATh6M F4fA+tNFhZFLLSjlavuHFkMMiXlgt1Rcpe53z9tyCR/ZECxmcLkEM5Um96TKEdU2iD4N8jl8oom 2J68HxKzUwCY67L8tlKXjgFs32bv0AS8qeieHcT+iShEgUDx4VnP209nPGgKI24yHqlzB0Mqdnd ojharbmXM/9dyPR+0rC7I4yV6hlRyEncBOjr/kSIPJE6qjflevxgNE+22Uo3MfKAhmq0RT23kFj ipPWQfkgVJSeunEwc= X-Google-Smtp-Source: AGHT+IHtlD8phUcrsxxNZnSEeRERBORiCvKi70lR0tOOd7wFG1c+yfIKHGrMPWetfRl4tu7NCPgRrw== X-Received: by 2002:a05:6e02:1523:b0:433:713d:a288 with SMTP id e9e14a558f8ab-4348c94ad9emr53176765ab.32.1763130494081; Fri, 14 Nov 2025 06:28:14 -0800 (PST) Received: from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-434839cdb10sm27500205ab.32.2025.11.14.06.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Nov 2025 06:28:12 -0800 (PST) From: Simon Glass To: linux-arm-kernel@lists.infradead.org Cc: Nicolas Schier , Masahiro Yamada , Chen-Yu Tsai , Tom Rini , Ahmad Fatoum , =?UTF-8?q?J=20=2E=20Neusch=C3=A4fer?= , Simon Glass , "Reviewed-by : Nicolas Schier" , Nathan Chancellor , Ard Biesheuvel , Catalin Marinas , Josh Poimboeuf , Kees Cook , Miguel Ojeda , Nicolas Schier , Parth Pancholi , Rong Xu , Tamir Duberstein , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Will Deacon , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 6/8] kbuild: Allow adding modules into the FIT ramdisk Date: Fri, 14 Nov 2025 07:27:32 -0700 Message-ID: <20251114142741.1919072-7-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251114142741.1919072-1-sjg@chromium.org> References: <20251114142741.1919072-1-sjg@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Support 'make image.fit FIT_MODULES=3D1' to put all the modules into a ramdisk image within the FIT. Add image.fit as a target which requires modules, so that modules will built automatically when using FIT_MODULES=3D1 Signed-off-by: Simon Glass Suggested-by: Ahmad Fatoum Suggested-by: Reviewed-by: Nicolas Schier Acked-by: Nathan Chancellor --- Changes in v5: - Build modules automatically if needed (fix from Nicolas Schier) Changes in v4: - Rename the Makefile variable from 'EXTRA' to 'MAKE_FIT_FLAGS' - Use an empty FIT_MODULES to disable the feature, instead of '0' - Make use of the 'modules' dependency to ensure modules are built - Pass the list of modules to the script Makefile | 1 + arch/arm64/Makefile | 1 + scripts/Makefile.lib | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8cd46222fc48..4eccaef95826 100644 --- a/Makefile +++ b/Makefile @@ -773,6 +773,7 @@ endif # Just "make" or "make all" shall build modules as well =20 modules-targets :=3D all +modules-targets +=3D $(if $(FIT_MODULES),image.fit) modules-targets +=3D modules modules-targets +=3D nsdeps modules-targets +=3D compile_commands.json diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 73a10f65ce8b..7036f251ab40 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -174,6 +174,7 @@ endif all: $(notdir $(KBUILD_IMAGE)) =20 image.fit: dtbs +image.fit: $(if $(FIT_MODULES),modules) =20 vmlinuz.efi image.fit: Image $(BOOT_TARGETS): vmlinux diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 1d581ba5df66..c6a3aa653035 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -398,11 +398,17 @@ MAKE_FIT :=3D $(srctree)/scripts/make_fit.py # Use this to override the compression algorithm FIT_COMPRESSION ?=3D gzip =20 +# Set this to 1 to include an initrd with all the kernel modules +FIT_MODULES ?=3D + quiet_cmd_fit =3D FIT $@ - cmd_fit =3D $(MAKE_FIT) -o $@ --arch $(UIMAGE_ARCH) --os linux \ - --name '$(UIMAGE_NAME)' \ + cmd_fit =3D $(if $(FIT_MODULES), \ + find $(objtree) -name '*.ko' > $(objtree)/.modules-list 2>/dev/null &&) \ + $(MAKE_FIT) -o $@ --arch $(UIMAGE_ARCH) --os linux \ + --name '$(UIMAGE_NAME)' $(MAKE_FIT_FLAGS) \ $(if $(findstring 1,$(KBUILD_VERBOSE)),-v) \ $(if $(FIT_DECOMPOSE_DTBS),--decompose-dtbs) \ + $(if $(FIT_MODULES),--modules @$(objtree)/.modules-list) \ --compress $(FIT_COMPRESSION) -k $< @$(word 2,$^) =20 # XZ --=20 2.43.0