>On Sun, 30 Jun 2013 16:24:47 +0800
>Chen Qi <chen_...@163.com> wrote:
>
> Thanks for your reply.
> 
> I tried both approaches.
> No matter I used the 'defconfig + devtmpfs' approach or I used the
> 'host config file' approach, I always met the following error.
> '''
> VFS: Cannot open root device "sdb1" or unknown-block(0,0)

Okay, now you are getting somewhere. This error appears, if it appears,
after the kernel bootstrapped itself and is now trying to boot the
userland.

What the error MEANS is that the kernel can not find and use the
filesystem for the root filesystem. Heres a checklist of the things
that could prevent it from doing that, from memory:
1. It can not use the PCI bus to talk to the disk controler. Because
   your kernel boots itself, you can rule this out.
2. The kernel can not talk to the USB controler. Check that you have
   enabled the proper USB version (UHCI, OHCI.. et cetera).
3. The kernel has no concept of the USB storage device so it can not
   conceive of it. Make sure you have "USB mass storage" enabled. IIRC,
   you might also need a few other things related to mass storage.
4. The kernel does not know anything about partitions. There is a group
   of options regarding partitioning. Turn on appropriate (unless you
   have something special, that means "PC partition table").
5. The kernel can not read the filesystem. Make sure that the
   filesystems you enabled in the kernel match whatever filesystem is
   on the partition you want to mount. Does your USB drive use the
   NTFS filesystem? Have you enabled the NTFS driver in the kernel?

> To conclue, I have basically two questions here:
> 1. Which modules/drivers are essential to make a rootfs on a USB
> media mounted correctly when the kernel starts up?
> 2. How could I know which kernel config items to enable from the
> output of 'lspci'? Any resource on documents on this area?

You also have a third option: make an initramfs and use that. I'll
explain.

With initramfs, your root filesystem is inside the kernel. You don't
have to worry about all the things in the list I wrote above. However,
you can only reasonably make a small filesystem fit into the kernel
that way. This is usefull for gaining the command line because you can
then hack around and see what is happening, if anything.

The method for this I find most comfortable is to use `cpio' to make an
archive of the filesystem and then just pass this to the kernels
Makefile (there is an option, I think in the "general options" section).

For this to work, first copy `init' from $LFS/sbin/init to $LFS/, then
use `cpio' to make an archive, put the path to the archive into the
appropriate configuration option and recompile the kernel. Take note
that decompressing this big kernel can easily take 5+ minutes. So,
when booting, GRUB will start the kernel, you will see a message to the
effect of "uncompressing kernel" and then for several minutes nothing
will happen except for the light on your USB stick blinking. This is
normal.

-- 
You don't need an AI for a robot uprising.
Humans will do just fine.

Attachment: signature.asc
Description: PGP signature

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to