mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] Add the ability to mount filesystems during initramfs expansion
@ 2026-01-24  0:39 H. Peter Anvin
  2026-01-24  0:39 ` [RFC PATCH 1/3] fs/init: move creating the mount data_page into init_mount() H. Peter Anvin
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: H. Peter Anvin @ 2026-01-24  0:39 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Jan Kara, Jonathan Corbet,
	H. Peter Anvin
  Cc: linux-fsdevel, linux-doc, linux-kernel, Lennart Poettering,
	systemd-devel

At Plumber's 2024, Lennart Poettering of the systemd project requested
the ability to overmount the rootfs with a separate tmpfs before
initramfs expansion, so the populated tmpfs can be unmounted.

This patchset takes this request and goes one step further: it allows
(mostly) arbitrary filesystems mounts during initramfs processing.

This is done by having the initramfs expansion code detect the special
filename "!!!MOUNT!!!" which is then parsed into a simplified
fstab-type mount specification and the directory in which the
!!!MOUNT!!! entry is used as the mount point.

This specific method was chosen for the following reasons:

1. This information is specific to the expectations of the initramfs;
   therefore using kernel command line options is not
   appropriate. This way the information is fully contained within the
   initramfs itself.
2. The sequence !!! is already special in cpio, due to the "TRAILER!!!"
   entries.
3. The filename "!!!MOUNT!!!" will typically be sorted first, which
   means using standard find+cpio tools to create the initramfs still
   work.
4. Similarly, standard cpio can still expand the initramfs.
5. If run on a legacy kernel, the !!!MOUNT!!! file is created, which
   is easy to detect in the initramfs code which can then activate
   some fallback code.
6. It allows for multiple filesystems to be mounted, possibly of
   different types and in different locations, e.g. the initramfs can
   get started with /dev, /proc, and /sys already booted.

The patches are:

    1/3: fs/init: move creating the mount data_page into init_mount()
    2/3: initramfs: support mounting filesystems during initramfs expansion
    3/3: Documentation/initramfs: document mount points in initramfs

--- 
 .../driver-api/early-userspace/buffer-format.rst   | 60 +++++++++++++-
 fs/init.c                                          | 23 +++++-
 include/linux/init_syscalls.h                      |  3 +-
 init/do_mounts.c                                   | 17 +---
 init/initramfs.c                                   | 95 +++++++++++++++++++++-
 5 files changed, 175 insertions(+), 23 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-02-03 16:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-24  0:39 [PATCH 0/3] Add the ability to mount filesystems during initramfs expansion H. Peter Anvin
2026-01-24  0:39 ` [RFC PATCH 1/3] fs/init: move creating the mount data_page into init_mount() H. Peter Anvin
2026-01-24  0:39 ` [RFC PATCH 2/3] initramfs: support mounting filesystems during initramfs expansion H. Peter Anvin
2026-01-24  0:39 ` [RFC PATCH 3/3] Documentation/initramfs: document mount points in initramfs H. Peter Anvin
2026-01-24 17:41 ` [PATCH 0/3] Add the ability to mount filesystems during initramfs expansion Askar Safin
2026-01-24 18:33   ` H. Peter Anvin
2026-01-25  0:07   ` H. Peter Anvin
2026-02-02  7:38 ` [EXT] [systemd-devel] " Windl, Ulrich
2026-02-03 16:11   ` H. Peter Anvin

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®