LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-05-2013, 10:57 PM   #1
huan1989
LQ Newbie
 
Registered: Oct 2013
Posts: 6

Rep: Reputation: Disabled
Booting kernel without mount filesystem.


Hi, everybody, i am developing application on ARM system. And, i have a small problem when make and port kernel for board.
Now, i have build kernel finish, output is zImage file (using cross compile toolchain). Cotinue, i load the zImage to board via TFTP, exec with command support by bootloader (redboot). Kernel load susscess 90% , when mount filesystem, kernel had been panic, reasion because kernel not mount file system, thus, root=/dev/ram0 cound not load (root=/dev/ram0 is command line of kernel).
I want ask the linuxquesions:
1. can boot kernel without mount filesystem (like as live CD booting)?
2.if can, how do i config in kernel?

Thank and Reggards.
 
Old 12-06-2013, 09:06 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Unless you have done something to the kernel, you need to include an initrd file. Even the live CD includes an initrd file to start things off.

The initrd file is compressed cpio of a relatively small root file system that is copied to a memory resident ramdisk (the /dev/ram0) which is initialized from the initrd (after which the initrd is deallocated). This serves as the mini-root system for doing the rest of hardware initialization, and mounting a real root.

Now an embedded system frequently can have the root filesystem already decompressed and configured in a flash disk - and the kernel can be configured/directed to use that instead of an initrd (look in the file "Documentation/kernel-parameters.txt" for telling the kernel to do this).

To have a kernel that doesn't NEED a disk (even a ram disk) is possible, but you have to modify the kernels init module that processes the initrd and put whatever you want in there instead. It is no longer a generic kernel, and the GPL would require you to release the mods to any users...

I think you want the first option though - to bypass the initrd entirely and just mount a pre-defined root filesystem from a flash disk - you do have to include the drivers for the flash disk, and filesystem you have on it. These cannot be a loadable module (that is what the initrd does is to allow loadable modules to be used for the root filesystem, but even then, the ramdisk driver and filesystem must be built into the kernel).

Last edited by jpollard; 12-06-2013 at 09:14 AM.
 
Old 12-09-2013, 02:00 AM   #3
huan1989
LQ Newbie
 
Registered: Oct 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Cool

Quote:
Originally Posted by jpollard View Post
Unless you have done something to the kernel, you need to include an initrd file. Even the live CD includes an initrd file to start things off.

The initrd file is compressed cpio of a relatively small root file system that is copied to a memory resident ramdisk (the /dev/ram0) which is initialized from the initrd (after which the initrd is deallocated). This serves as the mini-root system for doing the rest of hardware initialization, and mounting a real root.

Now an embedded system frequently can have the root filesystem already decompressed and configured in a flash disk - and the kernel can be configured/directed to use that instead of an initrd (look in the file "Documentation/kernel-parameters.txt" for telling the kernel to do this).

To have a kernel that doesn't NEED a disk (even a ram disk) is possible, but you have to modify the kernels init module that processes the initrd and put whatever you want in there instead. It is no longer a generic kernel, and the GPL would require you to release the mods to any users...

I think you want the first option though - to bypass the initrd entirely and just mount a pre-defined root filesystem from a flash disk - you do have to include the drivers for the flash disk, and filesystem you have on it. These cannot be a loadable module (that is what the initrd does is to allow loadable modules to be used for the root filesystem, but even then, the ramdisk driver and filesystem must be built into the kernel).
Thank for your reply. I am creating initrd.
 
Old 12-09-2013, 04:42 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
You could also look into the "coreboot" project - this project uses Linux to replace the current BIOS boot code - but it is limited to the supported hardware that allows the substitution.

http://www.coreboot.org/Welcome_to_coreboot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where to mount usb drive on ro kernel filesystem rymjones222 Linux - Hardware 4 02-13-2013 05:42 PM
[SOLVED] Booting fail, Can't mount root filesystem. poplinux Ubuntu 3 06-03-2012 08:46 PM
Booting a custom kernel with a new root filesystem LinuxNewman Linux - General 10 04-19-2009 11:53 PM
No filesystem could mount root (new kernel) nonis Slackware 12 10-20-2008 04:14 PM


All times are GMT -5. The time now is 09:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration