Re: [PATCH RFC] initrd: resize /dev/ram as needed
From: Christoph Hellwig
Date: Fri Mar 21 2025 - 01:02:06 EST
On Thu, Mar 20, 2025 at 08:46:14PM +0100, Julian Stecklina via B4 Relay wrote:
> From: Julian Stecklina <julian.stecklina@xxxxxxxxxxxxxxxxxxxxx>
>
> When the initrd doesn't fit into the RAM disk, we currently just die.
> This is unfortunate, because users have to manually configure the RAM
> disk size for no good reason. It also means that the kernel command
> line needs to be changed for different initrds, which is sometimes
> cumbersome.
>
> Attempt resizing /dev/ram to fit the RAM disk size instead. This makes
> initrd images work a bit more like initramfs images in that they just
> work.
>
> Of course, this only works, because we know that /dev/ram is a RAM
> disk and we can resize it freely. I'm not sure whether I've used the
> blockdev APIs here in a sane way. If not, please advise!
Just use an initramfs and avoid all these problems.