On Tue, Apr 15, 2014 at 06:44:54PM +0200, Markus Wichmann wrote: > On Sun, Apr 13, 2014 at 02:10:51PM +0200, FRIGN wrote: > > Good day, > > > > sometimes, you depend on an initramfs to do stuff for you before > > the rootfs is available. > > Busybox has become the standard for "all your initramfs needs", but > > tbh, I hate working with it. > > Statically linking sbase and ubase and choosing the tools you need for > > the job almost solves the problem, but the lack of switch_root, which > > almost every initramfs depends on, forces you to use busybox (because > > util-linux doesn't link statically). > > > > Now, I would've already sent in a patch, but I am pretty sure somebody > > here already hacked it together before. So, to save my time, I better > > ask now. > > > > Cheers > > > > FRIGN > > > > -- > > FRIGN <d...@frign.de> > > > > 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 which means that it needs to be maintained separately. Also the existing build system for ubase/sbase doesn't cope with shell scripts (can be fixed but not until we have a very good reason). Cheers, sin