Gentoo Archives: gentoo-user

From: Richard Fish <bigfish@××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] initramfs, network diskless boot, init process, problems with switchroot (pivot_root)
Date: Wed, 21 Jun 2006 20:56:55
Message-Id: 7573e9640606211350o4042b571i514307d6ac242fc8@mail.gmail.com
In Reply to: [gentoo-user] initramfs, network diskless boot, init process, problems with switchroot (pivot_root) by Claudinei Matos
1 On 6/16/06, Claudinei Matos <claudineimatos@×××××.com> wrote:
2 > I'd created an initramfs wich mount the nfs share and do the pivot_root
3 > (actually switch_root from busybox) but the problem is exactly at this
4 > moment, 'cause when I try to do the switch_root and start the real init from
5 > the nfs share, the system appears to freeze but after some seconds it do
6 > print a message "Rebooting System" and just reboot the machine.
7
8 Sorry for the late reply...I've been on offline (vacation) for several days.
9
10 pivot_root is specifically *not* allowed from an initramfs
11 environment. What you want to do is simply mount the new root
12 filesystem, chroot into it, and execute init. Something like:
13
14 cd /new_root ; exec ./bin/chroot . ./sbin/init "$@" >dev/console
15 <dev/console 2>&1
16
17 If you are *extremely* tricky, and use a symlinked /lib directory, you
18 can actually delete everything from the initramfs before doing the
19 chroot/init calls. Let me know if you need some more details on this.
20
21 HTH,
22 -Richard
23 --
24 gentoo-user@g.o mailing list

Replies