[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 07 Jul 2007 14:45:14 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Jan Engelhardt <jengelh@...putergmbh.de>
CC: Bodo Eggert <7eggert@....de>, linux-kernel@...r.kernel.org
Subject: Re: [RFC][Patch] Allow not mounting a root fs
Jan Engelhardt wrote:
>
> Come to speak of it, I think you can have it much easier by having the kernel
> exporting the cpio image as a virtual file inside rootfs, so that you could
> re-extract it inside a tmpfs. In other words:
>
> mount -t tmpfs tmpfs /mnt;
> cd /mnt;
> cpio -diuv </initramfs.cpio;
> #
> # switch_root nukes rootfs, pivot_roots and execs some init
> klibc_switch_root .; # or something like that
>
> Of course this needs double the memory than directly mounting tmpfs as
> rootfs, but it's an idea too.
>
Well, we're doing exactly this for non-initramfs initrd, however, it
would definitely be cleaner just to overmount rootfs with a tmpfs before
extraction -- it's an absolutely trivial amount of code; the biggest
complexity would be spotting the kernel command line option to invoke it.
Yet another variant, which works on existing kernels, is to have a
nested cpio, where your rootfs consists of a trivial /init which mounts
tmpfs and extracts another tar- or cpioball.
-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists