Launching Linux from Busybox (pivot_root or switch_root, or ? )

Stéphane Massot stephane.massot at smart-impulse.com
Tue Jun 10 09:05:04 UTC 2014


Hi,

On a beaglebone hardware, I want to start on a partition with a minimalist
busybox system (/dev/mmcblk0p2), run some checks on the 2 other partitions
(/dev/mmcblk0p5 & /dev/mmcblk0p6) containing more complete Linux systems
(Angström), then start on one or the other of the 2 Linux systems based on
those tests.

The problem is that I cannot find how to start another system correctly
from busybox.

What I did:

>From the (perfectly working) busybox system:





*export PATH=/bin:/sbin:/usr/bin:/usr/sbinmount -t sysfs sysfs /sys mkdir
-p /dev/ptsmount -t devpts devpts /dev/ptsmount /dev/mmcblk0p5 /mnt/root*

Then I tried 2 ways:

*1) pivot_root*







*cd /mnt/rootpivot_root . ./initrd    ./bin/mount -n --move ./initrd/sys
./sys       ./bin/mount -n --move ./initrd/proc ./proc./bin/mount -t
devtmpfs none ./dev./bin/mount -n --move ./initrd/dev/pts ./dev/pts
 exec ./usr/sbin/chroot . ./sbin/init < ./dev/ttyO0 > ./dev/ttyO0 2>&1*

This gives the following error :

*Couldn't find an alternative telinit implementation to spawn.*

It then starts a new Angström login prompt, but after logging in, any call
to "init" will return the error above, and the system doesn't work (for
example, if I call "reboot", it fails; if I call "killall busybox", it
triggers a reboot).

I tried without the "./usr/sbin/chroot . ", and it gives the same results.

*2) switch_root*

*exec switch_root -c /dev/ttyO0 /mnt/root /sbin/init*

This gives me a new busybox login prompt, and I am still on the busybox
partition


Any idea what I've done wrong ? Have I missed a step ? Any parameter I
forgot to take into account or any method to see more details about what
went wrong ?


-- 
Stéphane Massot
Lead Embedded Developper
Téléphone : +33 (0)1 84 17 31 20
Portable : +33 (0)6 79 38 18 87
stephane.massot at smart-impulse.com

SMART IMPULSE
48 rue René Clair
75018 PARIS
www.smart-impulse.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140610/52c863b4/attachment.html>


More information about the busybox mailing list