Re: [dev][ubase] Implement switch_root

From: Szabolcs Nagy <nsz_AT_port70.net>
Date: Thu, 17 Apr 2014 00:07:46 +0200

* Dimitris Papastamos <dp_AT_spl9.org> [2014-04-15 17:57:25 +0100]:
> On Tue, Apr 15, 2014 at 06:44:54PM +0200, Markus Wichmann wrote:
> > Why switch_root and not pivot_root? Here's a sh mockup of how to do what
> > you wrote with pivot_root:
> >
> > set -e
> > new_root=$1
> > put_old=$2
> > [ -d $put_old ] || made_dir=1
> > mkdir -p $put_old
> > cd $new_root
> > pivot_root $new_root $put_old
> > chroot $new_root
> > umount ${put_old#$new_root}
> > [ $made_dir ] && rm -rf ${put_old#$new_root}
>
> Because if it is a shell script then it cannot be included in ubase-box

i just note that pivot_root is a linux system call
so implementing that tool is a one-liner in c

so it is easy to add if it's missing from ubase
Received on Thu Apr 17 2014 - 00:07:46 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 17 2014 - 00:12:33 CEST