From nobody Tue Dec 2 02:30:06 2025 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 A5E9E3054F9 for ; Wed, 19 Nov 2025 18:14:20 +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=1763576069; cv=none; b=oAdePk4UdTCiekeQOBXDR5F3grAeR3jgZSo7bg7Jqc8hvShlDnf9dK5Ke0EX3NJd4CJxSkmCqoUKRpVf5krpKbam5PSv5BeKXQwuJ5yyyyVynOYL5ROqz/RlfgzJPeZRAgAaXDiK1T2L/qHHYYAgX50HwUr0OpTX18zFKSMIuFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763576069; c=relaxed/simple; bh=N9znOiAe5PJwsEoCpATqeH68yT6+oiXSUDjwEep8rqE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oTcp0IzXU1iKwSwXvGj/nsHN4XcVSa8PHMu8BkxqKxGVJoUCPkaUth5oaaG9DBbfgmqxj9ffE9FCPud5IFc5LRvzZsJdLxxxO7z16+DRJ9NjPvptYB6wHOf4Rna0bVvGAggqhUaL8xsIR4csmmvUvBgSD7UtWVHj9Hhhp28cbSw= 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=HU9Idn5S; 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="HU9Idn5S" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-948f8fa9451so137080539f.3 for ; Wed, 19 Nov 2025 10:14:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1763576057; x=1764180857; 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=4cU75xuJ/5xIhcW50wA4hHS4Fk7gDNqRb9uRUlMbq3I=; b=HU9Idn5Sc0tWMN4qxsg6yLFHv93vAMQ/I8sgSVGYpPdM6jF0yzLOzARkhO0n9KIHKB 374OVxf5P7PZObVGHap9Db1pmONd6uOjn1SvmwzBQLIMX+cpAsktg/snLcKySHLupyDt mvtCnGqdjYGGfw2zV9QwTX2Gtg7Zw/TY/uTZM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763576057; x=1764180857; 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=4cU75xuJ/5xIhcW50wA4hHS4Fk7gDNqRb9uRUlMbq3I=; b=vX2B9LUZA5NYbzZJ5vpPZ8p4n4mnsQ7yMAyklySj3ne60d0teEiA62POXtFr11zN5g cLNavVie/vYiLlrCWUul+oHnIBN63Yj2aXRI6/CfGpj6T51t2qbcpB7FyQwPPc4XznRj lR8+WsNvrn6t+lcyMl3c87TbnuIhzKC1w/3K89E4jY7aFzEafXX0K6M3yt9RKrf4rqCH GENijrLWWzPmyQ/t9PhhPt3OL4bfrBHuhrCkUxMHLGPj1pNLnUPY75btXge7muiZlJqg /Xx9MTd6Mu92qBM3Pcc3KNLbEERAiuzJMcRixLriCow+ry2Pe7Eah5+/LL5YYkfvRuvO qGgQ== X-Forwarded-Encrypted: i=1; AJvYcCXnV/acMYf0rEPrlZzyYQ72ZiFT57mFwxcIpAHDM9eG1BVT7OIkQ3xNvph6lwLj6ap74UH9K0Yu6EIwzuw=@vger.kernel.org X-Gm-Message-State: AOJu0Yz1o2jXHOFHTfZu3RV28xBsgIBI3mnzvXh4ro9ZV6+kQLQpSNnu tP8xsdvkcup+tHNIq4qlcuhFCB7mZpI5PBEWQKvkPBOtTcRYfS0pRpRvHf2T9TpwBw== X-Gm-Gg: ASbGncv5v5bkRC/7gXsU1NHHqZyGKu3EbOi3Ks0+dE5yye43rqH5St0SYDSG5Lfd0HW bhUF2DA6DQv278e4LeeiApMJMOg3Es5wbRbc2hPshK13tzr9tGfMbVdsAmFOKrQel67XiOvbvPW uQqGvivCjv+LLiY23LcXuNwBdcXb6HS8VD/Wp9T17wFrvoY/NpFfpvavZv/xVYqOBmuys9SGY0f 4yqeG1NX5iCzGdj7IRtn32lo1Tf2I5O6BrMnq0V4gKp3d46LvjGpGktBvzV1lDtIGRJkmGk6AVt QdV0gb0V0loXoNzMQhP2cHR0k4gaaktzyLY91crz/pVfy1BbGPHALehKEbopW21BOKEfDl6hSkp wXhh1vJfZbyNfYbSq0RJw4Lwqjy0xHGBhxqSY8wa3HtWfVIHnwdhMyLCOGC9BIGkrFy5QJfym2j qAMMuE X-Google-Smtp-Source: AGHT+IEIAcWoFGwcNgccxAP828+yd7/kMEFFY+sH8+j/iQjjBsmYniUh67wbp4Ar9H6A3QqKNZyn4Q== X-Received: by 2002:a05:6602:1607:b0:948:e11f:5b4c with SMTP id ca18e2360f4ac-9492b6ed063mr334288439f.19.1763576057415; Wed, 19 Nov 2025 10:14:17 -0800 (PST) Received: from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-949385ae254sm4838639f.1.2025.11.19.10.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Nov 2025 10:14:16 -0800 (PST) From: Simon Glass To: linux-arm-kernel@lists.infradead.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Masahiro Yamada , Tom Rini , Ahmad Fatoum , =?UTF-8?q?J=20=2E=20Neusch=C3=A4fer?= , Nicolas Schier , Chen-Yu Tsai , Simon Glass , "Reviewed-by : Nicolas Schier" , Nathan Chancellor , Ard Biesheuvel , Catalin Marinas , Josh Poimboeuf , Kees Cook , Miguel Ojeda , Nicolas Schier , Rong Xu , Tamir Duberstein , Will Deacon , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 6/8] kbuild: Allow adding modules into the FIT ramdisk Date: Wed, 19 Nov 2025 11:13:27 -0700 Message-ID: <20251119181333.991099-7-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251119181333.991099-1-sjg@chromium.org> References: <20251119181333.991099-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 is not empty. Signed-off-by: Simon Glass Suggested-by: Ahmad Fatoum Suggested-by: Reviewed-by: Nicolas Schier Acked-by: Nathan Chancellor Reviewed-by: Nicolas Schier --- Changes in v6: - Mention that FIT_MODULES just needs to be non-empty - Make use of modules.order instead of using 'find' 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 | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) 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..28e0cc0865b1 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -398,11 +398,15 @@ MAKE_FIT :=3D $(srctree)/scripts/make_fit.py # Use this to override the compression algorithm FIT_COMPRESSION ?=3D gzip =20 +# Set this to non-empty 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)' \ + --name '$(UIMAGE_NAME)' $(MAKE_FIT_FLAGS) \ $(if $(findstring 1,$(KBUILD_VERBOSE)),-v) \ $(if $(FIT_DECOMPOSE_DTBS),--decompose-dtbs) \ + $(if $(FIT_MODULES),--modules @$(objtree)/modules.order) \ --compress $(FIT_COMPRESSION) -k $< @$(word 2,$^) =20 # XZ --=20 2.43.0