Hi,

    I have built a initramfs. The /etc/inittab is:

::sysinit:/etc/init.d/rcS
tty1::askfirst:/bin/sh
tty2::askfirst:/bin/sh
tty3::askfirst:/bin/sh
tty4::askfirst:/bin/sh
tty5::askfirst:/bin/sh
tty6::askfirst:/bin/sh
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r

The /etc/init.d/rcS is:

#!/bin/sh
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mdev -s
mount /dev/hda1 /mnt
exec switch_root /mnt /sbin/init

When the kernel booting, I got these message on the screen:

BusyBox v1.19.2 (2011-10-22 16:15:41 CST) multi-call binary.

Usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT [ARGS]

Free initramfs and switch to another root fs:
chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /,
execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint.

Options:
        -c DEV  Reopen stdio to DEV after switch

I have check the conditions of switch_root as follows:
1. 'ls /mnt' to ensure that the /dev/hda1 is mounted successfully.
2. In rcS, the switch_root command is called by exec. So, the
switch_root command runs in the process with PID = 1.

It seems that the switch_root didn't give any error messages, but just
failed to change the root filesystem. How can I deal with the problem?
Thx.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to