lkml.org 
[lkml]   [2003]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: pivot_root off an initramfs broken
Date
Followup to:  <1070496272.8280.443.camel@plato.i.bork.org>
By author: Martin Hicks <mort@wildopensource.com>
In newsgroup: linux.dev.kernel
>
> If I boot a 2.6 kernel that first execs /sbin/kinit on the initramfs,
> does some setup (mostly to find the real root filesystem), then
> pivot_roots over to the real root filesystem and execs /sbin/init the
> kernel spins inside check_mnt() while mounting /proc in the initscripts.
>

The initramfs is the "real root" -- you shouldn't pivot_root from it,
instead you should mount the new root on top of it.

This makes cleaning up a bit of an issue -- the proposed rootfs
mount_single patch takes care of that -- but it can also be done by
leaving a cleanup process with cwd inside the initramfs with would use
relative paths to clean up.

Something like this:

mount / /dev/real_root_whatever
( rm -rf . ) &
exec /sbin/init "$@"

-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
If you send me mail in HTML format I will assume it's spam.
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.019 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site