mkinitrd unification across distributions
 help / color / mirror / Atom feed
* [PATCH] vfs: init/main.c: change comment: opening /dev/console may fail
From: Askar Safin @ 2026-04-06  9:08 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, Christian Brauner, Alexander Viro,
	Jan Kara
  Cc: patches, kernel-janitors, Randy Dunlap, initramfs,
	David Disseldorp

This patch is for VFS.

Today comment on console_on_rootfs says that opening /dev/console never
fails. This is false. The opening may fail if /dev/console is not
present in internal initramfs. So let's update the comment.

I tried to fix the problem itself in [1], but the patchset was rejected,
so I will fix the comment instead. :)

Link: https://lore.kernel.org/all/20260219210312.3468980-1-safinaskar@gmail.com/ # [1]
Signed-off-by: Askar Safin <safinaskar@gmail.com>
---
 init/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/init/main.c b/init/main.c
index 1cb395dd9..40cfda9aa 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1645,7 +1645,10 @@ static int __ref kernel_init(void *unused)
 	      "See Linux Documentation/admin-guide/init.rst for guidance.");
 }
 
-/* Open /dev/console, for stdin/stdout/stderr, this should never fail */
+/*
+ * Open /dev/console, for stdin/stdout/stderr, this may fail if you supplied
+ * your own internal initramfs without /dev/console
+ */
 void __init console_on_rootfs(void)
 {
 	struct file *file = filp_open("/dev/console", O_RDWR, 0);

base-commit: 591cd656a1bf5ea94a222af5ef2ee76df029c1d2 (mainline)
-- 
2.47.3


^ permalink raw reply related

* Re: [PATCH] vfs: init/main.c: change comment: opening /dev/console may fail
From: Al Viro @ 2026-04-06  9:54 UTC (permalink / raw)
  To: Askar Safin
  Cc: linux-kernel, linux-fsdevel, Christian Brauner, Jan Kara, patches,
	kernel-janitors, Randy Dunlap, initramfs, David Disseldorp
In-Reply-To: <20260406090815.1495095-1-safinaskar@gmail.com>

On Mon, Apr 06, 2026 at 09:08:15AM +0000, Askar Safin wrote:

> -/* Open /dev/console, for stdin/stdout/stderr, this should never fail */
> +/*
> + * Open /dev/console, for stdin/stdout/stderr, this may fail if you supplied
> + * your own internal initramfs without /dev/console

ITYM "so if you supply your own internal initramfs, make sure /dev/console is there"

^ permalink raw reply

* Re: [PATCH] vfs: init/main.c: change comment: opening /dev/console may fail
From: Askar Safin @ 2026-04-07  6:43 UTC (permalink / raw)
  To: viro
  Cc: brauner, ddiss, initramfs, jack, kernel-janitors, linux-fsdevel,
	linux-kernel, patches, rdunlap, safinaskar
In-Reply-To: <20260406095452.GY3836593@ZenIV>

Al Viro <viro@zeniv.linux.org.uk>:
> ITYM "so if you supply your own internal initramfs, make sure /dev/console is there"

I want to write browser extension for expanding your acronyms like "ITYM".

Okay, I will fix in the next version.

-- 
Askar Safin

^ permalink raw reply

* [PATCH v2] vfs: init/main.c: change comment and pr_err: opening /dev/console may fail
From: Askar Safin @ 2026-04-07  6:59 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, Christian Brauner, Alexander Viro,
	Jan Kara
  Cc: patches, kernel-janitors, Randy Dunlap, initramfs,
	David Disseldorp

This patch is for VFS.

Today comment on console_on_rootfs says that opening /dev/console never
fails. This is false. The opening may fail if /dev/console is not
present in internal initramfs. So let's update the comment and pr_err.

I tried to fix the problem itself in [1], but the patchset was rejected,
so I will fix the comment and pr_err instead. :)

v1: https://lore.kernel.org/all/20260406090815.1495095-1-safinaskar@gmail.com/

v1 -> v2 changes: changed text and also moved it to pr_err (inspired by Al Viro)

Link: https://lore.kernel.org/all/20260219210312.3468980-1-safinaskar@gmail.com/ # [1]
Signed-off-by: Askar Safin <safinaskar@gmail.com>
---
 init/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/init/main.c b/init/main.c
index 1cb395dd9..daf115d08 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1645,13 +1645,15 @@ static int __ref kernel_init(void *unused)
 	      "See Linux Documentation/admin-guide/init.rst for guidance.");
 }
 
-/* Open /dev/console, for stdin/stdout/stderr, this should never fail */
+/* Open /dev/console, for stdin/stdout/stderr */
 void __init console_on_rootfs(void)
 {
 	struct file *file = filp_open("/dev/console", O_RDWR, 0);
 
 	if (IS_ERR(file)) {
-		pr_err("Warning: unable to open an initial console.\n");
+		pr_err("Warning: unable to open an initial console. "
+		       "You likely supplied your own internal initramfs, "
+		       "make sure /dev/console is there.\n");
 		return;
 	}
 	init_dup(file);

base-commit: bfe62a454542cfad3379f6ef5680b125f41e20f4 (mainline)
-- 
2.47.3


^ permalink raw reply related

* Customized Bags and Boxes
From: forrest.mypackagingpro @ 2026-06-08 16:28 UTC (permalink / raw)
  To: initramfs

Hi,

We are a packaging company specializing in customized boxes and labels in all sizes, materials, and styles. We offer tuck boxes, rigid boxes, mailer boxes, retail boxes, shopping bags, and a wide range of other packaging.

Please share your packaging details (box size, quantity, and style), and we’ll be happy to assist you. We also provide design assistance.

Let me know if you have any questions or job that you would like to try us on.

Best regards,
Forrest Sage
Marketing Executive
My Packaging Pro.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox