Re: [PATCH v2 2/3] init/do_cmounts.c: introduce 'user_root' for initramfs

From: Menglong Dong
Date: Wed May 26 2021 - 04:23:30 EST


On Wed, May 26, 2021 at 11:23 AM Eric W. Biederman
<ebiederm@xxxxxxxxxxxx> wrote:
>
> Menglong Dong <menglong8.dong@xxxxxxxxx> writes:
>
[...]
>
> If we are going to do this something that is so small and clean it can
> be done unconditionally always.
>
> I will see if I can dig in and look at little more. I think there is
> a reason Al Viro and H. Peter Anvin implemeted initramfs this way.
> Perhaps it was just a desire to make pivot_root unnecessary.

I don't think they are meant to make it this way. Unpack cpio to the
rootfs directly seems to be a normal operation. Maybe initramfs is just
ignored by pivot_root(), as it seems not a common scene to run the
whole system in RAM that time, I guess~

Thanks!
Menglong Dong