ts-7000
[Top] [All Lists]

Re: [ts-7000] Alternative to pivot_root - switch_root

To:
Subject: Re: [ts-7000] Alternative to pivot_root - switch_root
From: Triffid Hunter <>
Date: Fri, 13 Jul 2007 14:09:42 +1000 (EST)

On Thu, 12 Jul 2007, dba2020com wrote:

> I am working with a ts7250-nand2k-128 with a 4GB SanDisk
> Model:SDDR-113. I have scoured the board looking for information on
> the BusyBox switch_root command.
>
> Will someone please give a nube version of how it works and how it
> should be implemented?
>
> I would also like to "cp" it into my working directories. How would
> one go about doing this?
>
>
> Thanks
> Daniel W Conduff
> hcicontrols.com

switch_root /mount/point/of/new/root /path/of/program (same as chroot)

an example from my lvm2 initramfs for my host machine:

 /usr/src/initramfs/image $ cat init
#!/bin/sh

echo Custom LVM2 Initramfs by Triffid_Hunter
echo for Lucienne

echo -n Mounting proc...
mount -t proc proc /proc && echo OK

echo -n Activating LVM2...
vgchange -ay lucienne_hd && echo OK

echo -n Making device nodes...
vgmknodes && echo OK

echo -n Mounting rootfs...
mount -t ext3 -o ro /dev/lucienne_hd/root /newroot && echo OK

echo -n Unmounting proc...
umount /proc && echo OK

echo Hold on, switching root...
exec switch_root /newroot /sbin/init

echo hrm, have a shell instead
exec /bin/ash
--end--

cp -a is your friend ;)



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU