Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #91013 > unrolled thread

initramfs-tools: support for root FS on a FAT32 loop image

Started byVolodymyr Mutel <mwg@mwg.dp.ua>
First post2026-01-31 09:00 +0100
Last post2026-02-05 16:30 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.debian.kernel


Contents

  initramfs-tools: support for root FS on a FAT32 loop image Volodymyr Mutel <mwg@mwg.dp.ua> - 2026-01-31 09:00 +0100
    Re: initramfs-tools: support for root FS on a FAT32 loop image Volodymyr Mutel <mwg@mwg.dp.ua> - 2026-02-05 16:30 +0100

#91013 — initramfs-tools: support for root FS on a FAT32 loop image

FromVolodymyr Mutel <mwg@mwg.dp.ua>
Date2026-01-31 09:00 +0100
Subjectinitramfs-tools: support for root FS on a FAT32 loop image
Message-ID<Mje3D-eEpp-1@gated-at.bofh.it>
Dear Everyone,

Looking into https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/initramfs-tools/tree/scripts/local?h=ubuntu/noble ,
we can see logic added by Ubuntu in lines 220..268 for handling loop= option in the kernel cmdline,
in which case root= specifies the filesystem containing the loop image,
and loop=path/rootfs.loop specifies the path of an image file to be mounted with -o loop as a root filesystem.
Corresponding logic we see also in https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/initramfs-tools/tree/init?h=ubuntu/noble
where global variables are filled from cmdline in lines 134..145.

This logic greatly simplifies the creation of a bootable Linux instance as a set of additional files and folders
coexisting with other data on a removable FAT32 volume (like a USB storage drive), not requiring and kind of data removal or storage reformatting.

Looking into https://salsa.debian.org/kernel-team/initramfs-tools/-/blob/v0.148.3/scripts/local and
https://salsa.debian.org/kernel-team/initramfs-tools/-/blob/v0.148.3/init , I don't see any equivalent logic in Debian Trixie version,
despite it having bigger version number than that of Ubuntu Noble (0.142).

Can anyone please propose, how the same logic could be implemented within Debian Trixie and its initramfs-tools ?
Probably there could be some kind of drop-in script for top or premount stage ?
I would greatly appreciate any samples of such script[s] from you for my adoption and customization.

Thanks in advance for your help.

[toc] | [next] | [standalone]


#91083

FromVolodymyr Mutel <mwg@mwg.dp.ua>
Date2026-02-05 16:30 +0100
Message-ID<Ml9sS-fWg2-17@gated-at.bofh.it>
In reply to#91013
Volodymyr Mutel wrote:

> Looking into https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/initramfs-tools/tree/scripts/local?h=ubuntu/noble ,
> we can see logic added by Ubuntu in lines 220..268 for handling loop= option in the kernel cmdline,

> Can anyone please propose, how the same logic could be implemented within Debian Trixie and its initramfs-tools ?
> Probably there could be some kind of drop-in script for top or premount stage ?

Dear Everyone,

I implemented the required logic, as I suppose, in the simplest working way by copying most code from Ubuntu and splitting it into premount and bottom parts.
The scripts are available from https://github.com/muwlgr/scripts/blob/main/initramfs/hostloop-premount ,
that's to be copied into /etc/initramfs-tools/scripts/local-premount/ and assigned executable rights,
and from https://github.com/muwlgr/scripts/blob/main/initramfs/hostloop-bottom ,
that's to be copied into /etc/initramfs-tools/scripts/local-bottom/ and also assigned executable rights.
In my solution I use this very useful exchange of updated environment variables through /conf/param.conf

Please review the code, adopt and customize it, and share your feedback.
Also please have a look at my larger article at https://muwlgr.dreamwidth.org/54748.html
where these scripts are copied into the target filesystem from here-documents.

I would appreciate your insightful responses. Thank you in advance.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web