2009/10/30 Pan ruochen <[email protected]>: > I am porting Linux. I desire the system to start up in the flowing steps: > 1. Kernel mount rootfs from initrd. > 2. Install the NTFL drivers. > 3. Mount the real filesystem which resides in NAND flash and change > root from initrd to nand. > 4. Umount initrd to reclaim system memory. > > All seem okay except step 4. > Here is my linuxrc script: > ===================================================================== > #!/bin/sh > mkdir /sysroot > mkdir /sysroot/dev > mknod /sysroot/dev/console c 5 1 > mknod /sysroot/dev/null c 1 3 > mknod /sysroot/dev/nftla b 93 0 > mknod /sysroot/dev/nftla1 b 93 1 > cd sysroot > exec <dev/console >dev/console 2>&1 > insmod /lib/modules/2.6.27.29/nftl.ko > mount -t ext2 dev/nftla1 . > cd /sysroot > pivot_root . old_root > umount -n /old_root > exec chroot . /sbin/init > ===================================================================== > > I got an error as: > can't umount /old_root: Device or resource busy > > The kernel command line is > mem=32M rd_start=0x80800000 rd_size=8M root=/dev/ram0 rw > console=ttyS1,115200n8 init=/linuxrc > > And `mount' shows: > rootfs on / type rootfs (rw) > /dev/root on /old_root type ext2 (rw,errors=continue) > dev/nftla1 on / type ext2 (rw,errors=continue) > none on /proc type proc (rw) > > What is wrong?
You probably want to use switch_root instead of pivot_root. _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
