2.4 kernel style boot using pivot_root (RFC)

Michal Moskal malekith at pld.org.pl
Fri Mar 8 13:46:54 CET 2002


On Fri, Mar 08, 2002 at 01:40:16PM +0100, Jan Rekorajski wrote:
> [piątek, 08 marzec 2002], Michal Moskal napisał(a):
> 
> > Hi,
> > 
> > Yesterday qboosh suggested me some additions to bsp to allow pivot_root
> > style boot using it. I thought it would be funny to have system booted up
> > this way, so I did it :)
> > 
> > There were some more or less severe problems during it.
> > 
> >   1) old root (initrd) has to be placed somewhere on real root, I suggest
> >      /var/lib/bsp/oldroot [RFC]
> 
> Why not /boot/root ?

Bacause it can be on separate partition. /lib/oldroot seems more
reasonable.

> >   2) we cannot unmount old root while bsp is running, I first thought we
> >      can unmount and freeramdisk old root in rc-scripts, however there is
> >      no standalone freeramdisk utility and even beside it, unmounting in
> >      rc-scripts seems messy, so I decided to use two stage bsp bootup.
> 
> Works for me and my Rescue CD.
> freeramdisk = /sbin/blockdev --flushbufs /dev/rd/*

Oh, I didn't know that.

> >      Bsp from initrd, at end of its life does exec /sbin/bsp (from real
> >      root filesystem, in the meantime we have to close /dev/console but
> >      this ain't problem), that unmounts oldroot, frees ramdisk and does
> >      exec /sbin/init. This works :) anyway RFC.
> 
> I can send you linuxrc.c from Rescue CD.

I would appriciate that. Anyway, without any files open I couldn't
unmount /oldroot while 1st stage bsp was running.

> >   3) there is problem with devfs. We can mount it in stage 1, unmount
> >      before trying to unmount oldroot, and mount it again in real root,
> >      so we don't have to have /dev/ram0 and /dev/console on root filesystem,
> >      but what then? leave it mounted? what about people not using it?
> >      and what if there is not devfs in kernel? RFC
> 
> Just use normal /dev at first stage.

Yes, it can be done. But someday normal /dev will be removed from
kernel. And in fact we don't need any normal device right now, bsp
can start even without /dev/console, and mount devfs.

-- 
: Michal Moskal :::::::: malekith/at/pld.org.pl :  GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::: Wroclaw University, CS Dept :  {E-,w}-- {b++,e}>+++ h



More information about the pld-devel-en mailing list