Re: [PATCH] pivot_root.2: Explain the initramfs case and point to switch_root(8).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/30/18 5:24 PM, Elvira Khabirova wrote:
> Based on text from Documentation/filesystems/ramfs-rootfs-initramfs.txt.
> 
> Signed-off-by: Elvira Khabirova <lineprinter@xxxxxxxxxxxx>

Thanks, Elvira. Patch applied.

Cheers,

Michael

> ---
>  man2/pivot_root.2 | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/man2/pivot_root.2 b/man2/pivot_root.2
> index 2f8f5f4b9..f01b128a3 100644
> --- a/man2/pivot_root.2
> +++ b/man2/pivot_root.2
> @@ -131,6 +131,17 @@ is Linux-specific and hence is not portable.
>  .SH NOTES
>  Glibc does not provide a wrapper for this system call; call it using
>  .BR syscall (2).
> +.PP
> +The rootfs (initial ramfs) cannot be
> +.BR pivot_root ()ed.
> +The recommended method of changing the root filesystem in this case is to delete
> +everything in rootfs, overmount rootfs with the new root, attach
> +.IR stdin / stdout / stderr
> +to the new
> +.IR /dev/console ,
> +and exec the new init. Helper
> +programs for this process exist; see
> +.BR switch_root (8).
>  .SH BUGS
>  .BR pivot_root ()
>  should not have to change root and current working directory of all other
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux