From: Julian Stecklina via B4 Relay <devnull+julian.stecklina.cyberus-technology.de@kernel.org>
To: Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Gao Xiang <xiang@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-erofs@lists.ozlabs.org,
Julian Stecklina <julian.stecklina@cyberus-technology.de>,
Niklas Sturm <niklas.sturm@secunet.com>
Subject: [PATCH v2 0/9] initrd: cleanup and erofs support
Date: Sat, 22 Mar 2025 21:34:12 +0100 [thread overview]
Message-ID: <20250322-initrd-erofs-v2-0-d66ee4a2c756@cyberus-technology.de> (raw)
On my journey towards adding erofs support for initrd, Al Viro
suggested to move the filesystem detection code into the respective
filesystem modules. This patch series implements this, while also
adding erofs support.
To achieve this, I added a macro initrd_fs_detect() that allows
filesystem modules to add a filesystem detection hooks. I then moved
all existing filesystem detection code to this new API. While I was
there I also tried to clean up some of the code.
I've tested these changes with the following kinds of initrd
images:
- ext2
- Minix v1
- cramfs (padded/unpadded)
- romfs
- squashfs
- erofs
initrds are still relevant, because they have some advantages over
initramfs. They don't require unpacking all files before starting the
init process and allows them to stay compressed in memory. They also
allow using advanced file system features, such as extended
attributes. In the NixOS community, we are heavy users of erofs, due
to its sweet spot of compression, speed and features.
That being said, I'm totally in favor of cutting down the supported
filesystems for initrd and further simplify the code. I would be
surprised, if anyone is using ext2 or Minix v1 filesystems (64 MiB
filesystem size limit!) or cramfs (16 MiB file size limit!) as an
initrd these days! Squashfs and erofs seem genuinely useful, though.
Signed-off-by: Julian Stecklina <julian.stecklina@cyberus-technology.de>
---
Changes in v2:
- Remove more legacy code
- Introduce initrd_fs_detect
- Move all other initrd filesystems to the new API
- Link to v1: https://lore.kernel.org/r/20250320-initrd-erofs-v1-1-35bbb293468a@cyberus-technology.de
---
Julian Stecklina (9):
initrd: remove ASCII spinner
initrd: fix double fput for truncated ramdisks
initrd: add a generic mechanism to add fs detectors
fs: minix: register an initrd fs detector
fs: cramfs: register an initrd fs detector
fs: romfs: register an initrd fs detector
fs: squashfs: register an initrd fs detector
fs: ext2, ext4: register an initrd fs detector
fs: erofs: register an initrd fs detector
fs/cramfs/Makefile | 5 ++
fs/cramfs/initrd.c | 41 +++++++++++++
fs/erofs/Makefile | 5 ++
fs/erofs/initrd.c | 19 ++++++
fs/ext2/Makefile | 5 ++
fs/ext2/initrd.c | 27 +++++++++
fs/ext4/Makefile | 4 ++
fs/minix/Makefile | 5 ++
fs/minix/initrd.c | 23 +++++++
fs/romfs/Makefile | 4 ++
fs/romfs/initrd.c | 22 +++++++
fs/squashfs/Makefile | 5 ++
fs/squashfs/initrd.c | 23 +++++++
include/asm-generic/vmlinux.lds.h | 6 ++
include/linux/ext2_fs.h | 9 ---
include/linux/initrd.h | 37 ++++++++++++
init/do_mounts_rd.c | 122 ++++++++------------------------------
17 files changed, 257 insertions(+), 105 deletions(-)
---
base-commit: 88d324e69ea9f3ae1c1905ea75d717c08bdb8e15
change-id: 20250320-initrd-erofs-76e925fdf68c
Best regards,
--
Julian Stecklina <julian.stecklina@cyberus-technology.de>
next reply other threads:[~2025-03-22 20:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-22 20:34 Julian Stecklina via B4 Relay [this message]
2025-03-22 20:34 ` [PATCH v2 1/9] initrd: remove ASCII spinner Julian Stecklina via B4 Relay
2025-03-25 6:42 ` David Disseldorp
2025-03-22 20:34 ` [PATCH v2 2/9] initrd: fix double fput for truncated ramdisks Julian Stecklina via B4 Relay
2025-03-22 20:34 ` [PATCH v2 3/9] initrd: add a generic mechanism to add fs detectors Julian Stecklina via B4 Relay
2025-03-24 9:35 ` Julian Stecklina
2025-03-22 20:34 ` [PATCH v2 4/9] fs: minix: register an initrd fs detector Julian Stecklina via B4 Relay
2025-03-22 23:26 ` kernel test robot
2025-03-22 20:34 ` [PATCH v2 5/9] fs: cramfs: " Julian Stecklina via B4 Relay
2025-03-22 20:34 ` [PATCH v2 6/9] fs: romfs: " Julian Stecklina via B4 Relay
2025-03-22 23:26 ` kernel test robot
2025-03-22 20:34 ` [PATCH v2 7/9] fs: squashfs: " Julian Stecklina via B4 Relay
2025-03-22 20:34 ` [PATCH v2 8/9] fs: ext2, ext4: " Julian Stecklina via B4 Relay
2025-03-22 23:36 ` kernel test robot
2025-03-22 20:34 ` [PATCH v2 9/9] fs: erofs: " Julian Stecklina via B4 Relay
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=20250322-initrd-erofs-v2-0-d66ee4a2c756@cyberus-technology.de \
--to=devnull+julian.stecklina.cyberus-technology.de@kernel.org \
--cc=brauner@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=julian.stecklina@cyberus-technology.de \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=niklas.sturm@secunet.com \
--cc=rafael@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=xiang@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®