From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: pivotroot does not work with initramfs Date: Tue, 25 Nov 2003 21:02:28 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20031125200228.GA25161@suse.de> References: <20031116170438.GA4466@suse.de> <20031122164608.GA8009@suse.de> <20031122204854.GA9512@suse.de> <20031122215054.GH24159@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, Linus Torvalds Return-path: Received: from ns.suse.de ([195.135.220.2]:39401 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S263119AbTKYUJO (ORCPT ); Tue, 25 Nov 2003 15:09:14 -0500 To: viro@parcelfarce.linux.theplanet.co.uk Content-Disposition: inline In-Reply-To: <20031122215054.GH24159@parcelfarce.linux.theplanet.co.uk> List-Id: linux-fsdevel.vger.kernel.org On Sat, Nov 22, viro@parcelfarce.linux.theplanet.co.uk wrote: > On Sat, Nov 22, 2003 at 09:48:54PM +0100, Olaf Hering wrote: > > --- linuxppc-2.5_2.6.0-test9-bk.orig/fs/namespace.c 2003-10-08 = 03:52:02.000000000 +0200 > > +++ linuxppc-2.5_2.6.0-test9-bk/fs/namespace.c 2003-11-22 21:46:27= =2E000000000 +0100 > > @@ -99,6 +99,7 @@ EXPORT_SYMBOL(lookup_mnt); > > static int check_mnt(struct vfsmount *mnt) > > { > > spin_lock(&vfsmount_lock); > > + if(mnt->mnt_parent->mnt_parent !=3D mnt) > > while (mnt->mnt_parent !=3D mnt) > > mnt =3D mnt->mnt_parent; > > spin_unlock(&vfsmount_lock); >=20 > That's just plain ugly. Could you explain what the hell are you tryi= ng to > do? >=20 > If it's an attempt to make pivot_root move rootfs somewhere else - th= e above > is nowhere near enough. If it's something else, I wonder how the cou= ld > that patch change anything. >=20 > *NOTE*: attempting to move rootfs away from root of mount tree is uns= upported > and for a good reason - it complicates logics big way and doesn't buy= you > anything that couldn't be done without it. Ok, so pivot_root on rootfs is a bad idea. What I do now is to just loo= k for a /sbin/kinit binary (or something that is passed via kinit=3D) and= run this. And skip the call to mount_root() in prepare_namespace(). Seems t= o work well. kinit is supposed to find and mount the final root filesystem and mount it on /root. Then return and let prepare_namespace() do the final work, free the initmem and run the init process. I dont know what you have in mind for 2.7, how much of the code will disappear. We will hopefully use initramfs via cpio for 2.6 and get rid of linuxrc. Lets see how far we get with that plan. --=20 USB is for mice, FireWire is for men! sUse lINUX ag, n=C3=9CRNBERG - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html