From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755691AbXGGVpd (ORCPT ); Sat, 7 Jul 2007 17:45:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753102AbXGGVp0 (ORCPT ); Sat, 7 Jul 2007 17:45:26 -0400 Received: from terminus.zytor.com ([192.83.249.54]:59386 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752140AbXGGVpZ (ORCPT ); Sat, 7 Jul 2007 17:45:25 -0400 Message-ID: <4690096A.4020602@zytor.com> Date: Sat, 07 Jul 2007 14:45:14 -0700 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.0 (X11/20070419) MIME-Version: 1.0 To: Jan Engelhardt CC: Bodo Eggert <7eggert@gmx.de>, linux-kernel@vger.kernel.org Subject: Re: [RFC][Patch] Allow not mounting a root fs References: <468DA42D.7050309@zytor.com> In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 # > # 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