All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: julian.stecklina@cyberus-technology.de
Cc: Christoph Hellwig <hch@lst.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] initrd: support erofs as initrd
Date: Fri, 21 Mar 2025 02:08:26 +0000	[thread overview]
Message-ID: <20250321020826.GB2023217@ZenIV> (raw)
In-Reply-To: <20250320-initrd-erofs-v1-1-35bbb293468a@cyberus-technology.de>

On Thu, Mar 20, 2025 at 08:28:23PM +0100, Julian Stecklina via B4 Relay wrote:
> From: Julian Stecklina <julian.stecklina@cyberus-technology.de>
> 
> Add erofs detection to the initrd mount code. This allows systems to
> boot from an erofs-based initrd in the same way as they can boot from
> a squashfs initrd.
> 
> Just as squashfs initrds, erofs images as initrds are a good option
> for systems that are memory-constrained.
> 
> Signed-off-by: Julian Stecklina <julian.stecklina@cyberus-technology.de>

>  #include "do_mounts.h"
>  #include "../fs/squashfs/squashfs_fs.h"
> +#include "../fs/erofs/erofs_fs.h"

This is getting really unpleasant...

Folks, could we do something similar to initcalls - add a section
(.init.text.rd_detect?) with array of pointers to __init functions
that would be called by that thing in turn?  With filesystems that
want to add that kind of stuff being about to do something like

static int __init detect_minix(struct file *file, void *buf, loff_t *pos, int start_block)
{
	struct minix_super_block *minixsb = buf;
	initrd_fill_buffer(file, buf, pos, (start_block + 1) * BLOCK_SIZE);
	if (minixsb->s_magic == MINIX_SUPER_MAGIC ||
	    minixsb->s_magic == MINIX_SUPER_MAGIC2) {
		printk(KERN_NOTICE
			"RAMDISK: Minix filesystem found at block %d\n",
			start_block);
		return minixsb->s_nzones << minixsb->s_log_zone_size;
	}
	return -1;
}

initrd_detect(detect_minix);

with the latter emitting a pointer to detect_minix into that new
section?

initrd_fill_buffer() would be something along the lines of

	if (*pos != wanted) {
		*pos = wanted;
		kernel_read(file, buf, 512, pos);
	}

I mean, we can keep adding those pieces there, but...

  reply	other threads:[~2025-03-21  2:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 19:28 [PATCH] initrd: support erofs as initrd Julian Stecklina
2025-03-20 19:28 ` Julian Stecklina via B4 Relay
2025-03-21  2:08 ` Al Viro [this message]
2025-03-21  8:46   ` Christian Brauner
2025-03-21 12:49   ` Julian Stecklina
2025-03-21  5:01 ` Christoph Hellwig
2025-03-21  5:27   ` Gao Xiang
2025-03-21 13:17     ` Julian Stecklina
2025-03-21 13:57       ` Gao Xiang
2025-04-07  8:57       ` hch
2025-04-07 11:19         ` Julian Stecklina
2025-04-07 16:05         ` Gao Xiang
2025-08-25 18:27   ` Askar Safin
2025-08-26  7:59     ` Christoph Hellwig
2025-08-26 14:21       ` Byron Stanoszek
2025-08-26 15:32         ` Gao Xiang
2025-08-26 16:00           ` Gao Xiang
2025-08-27  9:22           ` Askar Safin
2025-08-27  9:48             ` Gao Xiang
2025-08-27  9:58               ` Gao Xiang
2025-08-28 16:44                 ` Askar Safin
2025-08-28 17:00                   ` Gao Xiang
2025-08-28 17:14                     ` Gao Xiang
2025-08-30 11:49                       ` Askar Safin
2025-08-30 12:23                         ` Gao Xiang
2025-08-26 17:00         ` Askar Safin
2025-03-21  8:48 ` Christian Brauner
2025-03-21  9:16 ` Thomas Weißschuh
2025-03-21 13:26   ` Julian Stecklina

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=20250321020826.GB2023217@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=julian.stecklina@cyberus-technology.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.