From patchwork Tue Dec 23 01:16:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1067 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766452625; bh=N8n5IePwPHqKD/52Y4hVQ25rUUsvB4byhLs28zcdaY8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qmKoP258vm1bb8Mlpxwj/h9LiOwMhRo6XT9wBbC9yOo8boGbMV776bLThpn6nZBSa NFvNc9p3IsWIP2GvuPfAbECpnuJcbWNIikcnqA0nN0E9xfGE+Hb905B5mD4UOLN5o7 cuE3au+d1SWAARWXgEi10ywuONCFyzopaGrxjLlwc9DkTAGCN8QzTE8o+6BQ6wtnjq ddrYGWcERFAAz2W9zphjVqwWyVdbZ1umy1liD9JYlYG7tplUFzCY11GUzYVMJNl73X dGzCSXzY/HzTeon8KRpVvXh03mxzgmkCw0oQW8YjzLYm59NXr0aDy/GtywvLH9Asox xNECINvqH0R/A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 11FFD64DB3 for ; Mon, 22 Dec 2025 18:17:05 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id T8t7deMNwKyF for ; Mon, 22 Dec 2025 18:17:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766452623; bh=N8n5IePwPHqKD/52Y4hVQ25rUUsvB4byhLs28zcdaY8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qGg8pdkPddK9QqjGdOYBWNsVF7GycQ3mIiGKhGHOeoaJkRVT/REjQqB2nClnpdd/x 3A1y7WIkcUK3V9rVLOIGMzD4xgJ0a8yAUtsoeJH7GaZQU99k9iNkLMUOQoZ6OcVhZM de58YunyOS86gM1ofHxDlHzMHwDb9EzkgHlNUwi8vdxwLHcZyRoFi76/Nj8LHDvcQP hyplNRbvZvwJ60MbH2k8Wu65qBCSHblytLMtVSNQ9OB+eRsJ/Kxzyv0gyWr220Kxgv Gh4B41ZHUhsPBDTKXmYDYMvbefavxcnKAwTyZLAX12PWJ2mGKiJwuzR0IsI36m15BW MSuKeBFAe5mqw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0C51E64D46 for ; Mon, 22 Dec 2025 18:17:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766452620; bh=BKMXKbV78/6Rwny5xDfZs42l3n9rWrQsegBU66Pn3VI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WQglS1I4Iozue8hzRSrKSlGqbvNgV21qxdrOuSVh1TjYrwiO8vHZmrZZelyha/A5J fQhvXQg5iWFGsOfExq5L5qDHgzFkgWHCqWX0ZpQNDAMfTRMwQheTi1ABxxKHhts/fG yrkktIyOMuVEgGFQtSwwrwr6BXcn2x+Vm6EQUZ/UVbDmrThhK/emJwDKjqbgv1MXGl nbHjHOWFjWIIHvBjjwreC2sDJcPxx+cFEzxc2Htnx81IDXDUsb0UR1YFN16DvGpqPf sizMNC79MEJ/w9NyY7Dm4QAvTP3RkXmqV6yOBUkXapA2IrJUaYxO2gDNdM7GRK8ME5 fTptOp/gDooRw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AED2D64D43; Mon, 22 Dec 2025 18:17:00 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id oyD0swT0Uxdq; Mon, 22 Dec 2025 18:17:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766452618; bh=Y1xs808AGC6Ou99XXXYBzZHvfw3DHnHLsg/5C3RXdKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z/tudUH9UJNnaYB0yiLuHC0dzXdZvl8sjrmzUzkjTlecRlZFjaSwHiu+WcymwwEnN YYAvFNs8v9YmN0UN4tORRcecWBraZPdntbkxPWNRYwib4oRiuCpjPzTLR1WdwvRBaH UYlGNqTKxmJ7hyR9KLOy0cNZGhtmSBmIZF/vsWeZXL/iLK3IVDFPu92/wupgVcDdbV tCEj95GnQLuckroL8BxDoIdJ0MqqY5V1yn7qW3ks2i7Bb4PT/ZPcJkQmDJMTiHKr2A AxRdiZklpPW5dFX8svyDRjxzReVnJL2GJwUKBULq+L7Y4JkxH6uOj/Ou216FasEGwR tLWFQXIJfTH1Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2FB0264DA8; Mon, 22 Dec 2025 18:16:58 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Dec 2025 18:16:23 -0700 Message-ID: <20251223011632.380026-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251223011632.380026-1-sjg@u-boot.org> References: <20251223011632.380026-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7YGOPAGFDOC5LTVDRF3EHSQJELMDXUNR X-Message-ID-Hash: 7YGOPAGFDOC5LTVDRF3EHSQJELMDXUNR X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/12] ext4l: Add ext4l_msgs env var to print messages on mount List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add runtime control for printing ext4 messages via the ext4l_msgs environment variable. When set to 'y' or '1', the recorded message buffer is printed after a successful mount. This provides a runtime alternative to the compile-time CONFIG_EXT4L_DEBUG option. Usage: setenv ext4l_msgs y Co-developed-by: Claude Signed-off-by: Simon Glass --- fs/ext4l/interface.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/fs/ext4l/interface.c b/fs/ext4l/interface.c index 9b6f4c0b02b..638f51d8c64 100644 --- a/fs/ext4l/interface.c +++ b/fs/ext4l/interface.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -127,6 +128,20 @@ struct membuf *ext4l_get_msg_buf(void) return &ext4l_msg_buf; } +/** + * ext4l_print_msgs() - Print all recorded messages + * + * Prints the contents of the message buffer to the console. + */ +static void ext4l_print_msgs(void) +{ + char *data; + int len; + + while ((len = membuf_getraw(&ext4l_msg_buf, 80, true, &data)) > 0) + printf("%.*s", len, data); +} + int ext4l_probe(struct blk_desc *fs_dev_desc, struct disk_partition *fs_partition) { @@ -263,6 +278,11 @@ int ext4l_probe(struct blk_desc *fs_dev_desc, /* Store super_block for later operations */ ext4l_sb = sb; + + /* Print messages if ext4l_msgs environment variable is set */ + if (env_get_yesno("ext4l_msgs") == 1) + ext4l_print_msgs(); + return 0; err_free_buf: