public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: Askar Safin <safinaskar@gmail.com>
Cc: brauner@kernel.org, initramfs@vger.kernel.org, jack@suse.cz,
	linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org, nathan@kernel.org, nsc@kernel.org,
	patches@lists.linux.dev, rdunlap@infradead.org, rob@landley.net,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH 1/2] init: ensure that /dev/console is (nearly) always available in initramfs
Date: Mon, 23 Feb 2026 12:19:46 +1100	[thread overview]
Message-ID: <20260223121946.45b3c5b1.ddiss@suse.de> (raw)
In-Reply-To: <20260220191150.244006-1-safinaskar@gmail.com>

On Fri, 20 Feb 2026 22:11:50 +0300, Askar Safin wrote:

> David Disseldorp <ddiss@suse.de>:
> > I'd prefer not to go down this path:
> > - I think it's reasonable to expect that users who override the default
> >   internal initramfs know what they're doing WRT /dev/console creation.
> > - initramfs can be made up of concatenated cpio archives, so tools which
> >   insist on using GNU cpio and run into mknod EPERM issues could append
> >   the nodes via gen_init_cpio, while continuing to use GNU cpio for
> >   everything else.  
> 
> This cannot be done in proper way.
> 
> Let's assume we want to build *builtin* initramfs using GNU cpio and
> then concatenate to it an archive made by gen_init_cpio.
> 
> Then we want CONFIG_INITRAMFS_SOURCE to accept already existing cpio
> archive AND file in gen_init_cpio format. But, according to
> CONFIG_INITRAMFS_SOURCE docs in usr/Kconfig, this is not possible
> (I didn't check whether this is true, I just have read the docs.)

...

> This means that the only remaining way is this:
> 
> 1. Create *fake* kernel config
> 2. Build whole kernel (!!!)
> 3. Create an archive by invoking gen_init_cpio and concatenate it to
> our preexisting archive
> 4. Create config, this time for real. Specify archive created in previous
> step as CONFIG_INITRAMFS_SOURCE
> 5. Build the kernel, this time for real
> 
> I hope you agree that this is totally insane.

A two-phase build isn't insane alongside a custom internal initrams -
consider the case where the user wants to bundle kernel modules.
Buildroot has logic for this kind of two-phase build:
https://gitlab.com/buildroot.org/buildroot/-/blob/master/linux/linux.mk?ref_type=heads#L408
IIUC buildroot doesn't change the kernel config but uses an initial
dummy cpio which is updated for the final (incremental) build stage.

> So, there is no proper way to create builtin initramfs by concatenating
> archives created by GNU cpio and gen_init_cpio.

There are still other options:
- use a different initramfs archiving tool
- point GNU cpio at an existing /dev/console, or call mknod as root

> I think this is a bug in kbuild, and it probably needs to be fixed.
> 
> But I think that my patchset is a better approach. My patchset simply
> ensures that /dev/console and /dev/null are always available, no matter
> what. And thus my patchset side steps the whole issue.

I remain unconvinced. To me it still feels like a workaround for GNU
cpio's poor archive-contents-must-exist-locally interface.

Thanks, David

  reply	other threads:[~2026-02-23  1:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 21:03 [PATCH 0/2] init: ensure that /dev/console and /dev/null are (nearly) always available in initramfs Askar Safin
2026-02-19 21:03 ` [PATCH 1/2] init: ensure that /dev/console is " Askar Safin
2026-02-19 23:59   ` David Disseldorp
2026-02-20 19:11     ` Askar Safin
2026-02-23  1:19       ` David Disseldorp [this message]
2026-02-23 21:41         ` Askar Safin
2026-02-23  1:27     ` Rob Landley
2026-02-23  2:33       ` David Disseldorp
2026-02-23 16:11         ` Rob Landley
2026-02-23 17:34           ` Askar Safin
2026-02-23 19:45             ` Rob Landley
2026-02-23 23:04       ` Askar Safin
2026-02-19 21:03 ` [PATCH 2/2] init: ensure that /dev/null " Askar Safin
2026-02-20  0:26   ` David Disseldorp
2026-02-21  0:16     ` Askar Safin
2026-02-23  1:15   ` Rob Landley
2026-02-23 21:18     ` Askar Safin
2026-02-23  0:17 ` [PATCH 0/2] init: ensure that /dev/console and /dev/null are " Rob Landley
2026-02-23 20:58   ` Askar Safin
2026-02-24 19:02     ` Rob Landley
2026-03-07  3:22       ` Askar Safin
2026-03-10 12:51         ` Rob Landley
2026-03-23  3:47           ` Askar Safin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260223121946.45b3c5b1.ddiss@suse.de \
    --to=ddiss@suse.de \
    --cc=brauner@kernel.org \
    --cc=initramfs@vger.kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=rdunlap@infradead.org \
    --cc=rob@landley.net \
    --cc=safinaskar@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox