[BusyBox] Problems with init after pivot_root

Matthew Schumacher matt.s at aptalaska.net
Fri Feb 27 21:30:49 UTC 2004


Ok figured this out so I figured I would add the resolution to the list 
for later searching:

First I didn't have a /dev filesystem mounted, Second I didn't use the 
devfs devices in my getty syntax.

schu

Matthew Schumacher wrote:
> Hello list,
> 
> I can't seem to make init work after I do a pivot_root in my linuxrc 
> script in my initrd image.
> 
> Here is what I am trying to do:
> 
> Boot initrd image, mount cdrom, mount fs image on the cd, pivot root to 
> the new fs image, call init on the new root.
> 
> Here is my linuxrc:
> 
> =========================================================================
> #!/bin/sh
> 
> PATH=/sbin:/bin:/usr/sbin:/usr/bin:/; export PATH
> 
> umask 022
> 
> mount -t proc none /proc
> 
> mount -t devpts none /dev/pts
> 
> mount -t iso9660 -o ro /dev/cdroms/cdrom0 /cdrom
> 
> mount -t ext2 -o loop,ro /cdrom/rootfs.img  /newroot
> 
> cd /
> 
> cd /newroot
> 
> pivot_root . initrd
> 
> exec chroot . sh -c 'exec /sbin/init'
> =========================================================================
> 
> And here is my inittab on my newroot fs:
> 
> ========================================================================
> ::sysinit:/etc/init.d/rcS
> ::ctrlaltdel:/sbin/reboot
> ::shutdown:/sbin/swapoff -a
> ::shutdown:/bin/umount -a -r
> ::restart:/sbin/init
> 
> tty1::respawn:/sbin/getty 38400 tty1
> =========================================================================
> 
> The problem is the system just hangs when it gets to init, I never get 
> the console listed in the inittab above.
> 
> Anyone know what I'm doing wrong?  I'm using devfs, linux-2.4.25, 
> busybox-1.00-pre8 init, chroot, and pivot root.
> 
> Thanks,
> schu
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> busybox mailing list
> busybox at mail.busybox.net
> http://busybox.net/mailman/listinfo/busybox



More information about the busybox mailing list