LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 11-23-2009, 09:36 AM   #1
pmil
Member
 
Registered: Jul 2008
Posts: 43

Rep: Reputation: 15
Question Problem with initramfs


Hi all,

I am trying to boot my kernel with my initramfs on beagleboard (OMAP3510 target) using U-boot bootloader. I thing that I did everything right regarding the creation of the initramfs but I get the following output when trying to boot my kernel on the target:

Code:
## Booting kernel from Legacy Image at 80002000 ...
   Image Name:   Linux-2.6.32-rc7
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3029100 Bytes =  2.9 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.................................................................. done, booting the kernel.
[    0.000000] Linux version 2.6.32-rc7 (limp@ubuntu) (gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67) ) #1 Sun Nov 22 13:41:45 PST 2009
[    0.000000] CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c53c7f
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine: OMAP3 Beagle Board
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] OMAP3430 ES3.0
[    0.000000] SRAM: Mapped pa 0x40200000 to va 0xe3000000 size: 0x100000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: console=ttyS2,115200n8
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 128MB 128MB = 256MB total
[    0.000000] Memory: 253952KB available (3332K code, 307K data, 2012K init, 0K highmem)
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:402
[    0.000000] Clocking rate (Crystal/Core/MPU): 26.0/332/500 MHz
[    0.000000] Reprogramming SDRC clock to 332000000 Hz
[    0.000000] GPMC revision 5.0
[    0.000000] IRQ: Found an INTC at 0xd8200000 (revision 4.0) with 96 interrupts
[    0.000000] Total of 96 interrupts on 1 active controller
[    0.000000] OMAP34xx GPIO hardware version 2.5
[    0.000000] OMAP clockevent source: GPTIMER1 at 13000000 Hz
[    0.000000] Console: colour dummy device 80x30
[    0.000000] Calibrating delay loop... 498.07 BogoMIPS (lpj=2490368)
[    0.000000] Mount-cache hash table entries: 512
[    0.000000] CPU: Testing write buffer coherency: ok
[    0.000000] regulator: core version 0.5
[    0.000000] NET: Registered protocol family 16
[    0.000000] Found NAND on CS0
[    0.000000] Registering NAND on CS0
[   86.479217] OMAP DMA hardware revision 4.0
[   86.495178] bio: create slab <bio-0> at 0
[   86.498687] SCSI subsystem initialized
[   86.499481] usbcore: registered new interface driver usbfs
[   86.499969] usbcore: registered new interface driver hub
[   86.500274] usbcore: registered new device driver usb
[   86.500854] i2c_omap i2c_omap.1: bus 1 rev3.12 at 2600 kHz
[   86.504272] twl4030: PIH (irq 7) chaining IRQs 368..375
[   86.504302] twl4030: power (irq 373) chaining IRQs 376..383
[   86.504760] twl4030: gpio (irq 368) chaining IRQs 384..401
[   86.506439] regulator: VUSB1V5: 1500 mV normal standby
[   86.507049] regulator: VUSB1V8: 1800 mV normal standby
[   86.507629] regulator: VUSB3V1: 3100 mV normal standby
[   86.511199] twl4030_usb twl4030_usb: Initialized TWL4030 USB module
[   86.511840] regulator: VMMC1: 1850 <--> 3150 mV normal standby
[   86.512420] regulator: VDAC: 1800 mV normal standby
[   86.513031] regulator: VPLL2: 1800 mV normal standby
[   86.513641] regulator: VSIM: 1800 <--> 3000 mV normal standby
[   86.513824] i2c_omap i2c_omap.3: bus 3 rev3.12 at 100 kHz
[   86.516448] Switching to clocksource gp timer
[   86.518798] musb_hdrc: version 6.0, musb-dma, otg (peripheral+host), debug=0
[   86.519500] musb_hdrc: USB OTG mode controller at d80ab000 using DMA, IRQ 92
[   86.520080] NET: Registered protocol family 2
[   86.520294] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[   86.520874] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[   86.521148] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[   86.521331] TCP: Hash tables configured (established 8192 bind 8192)
[   86.521362] TCP reno registered
[   86.521575] NET: Registered protocol family 1
[   86.521972] RPC: Registered udp transport module.
[   86.522003] RPC: Registered tcp transport module.
[   86.522003] RPC: Registered tcp NFSv4.1 backchannel transport module.
[   86.533905] NetWinder Floating Point Emulator V0.97 (double precision)
[   86.536071] VFS: Disk quotas dquot_6.5.2
[   86.536163] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[   86.537445] NTFS driver 2.1.29 [Flags: R/O].
[   86.537750] JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[   86.538421] msgmni has been set to 496
[   86.539642] alg: No test for stdrng (krng)
[   86.539733] io scheduler noop registered
[   86.539733] io scheduler anticipatory registered (default)
[   86.539764] io scheduler deadline registered
[   86.539947] io scheduler cfq registered
[   86.540649] omapfb: configured for panel omap3beagle
[   86.550720] omapfb: DISPC version 3.0 initialized
[   86.565490] Console: switching to colour frame buffer device 128x48
[   86.578826] omapfb: Framebuffer initialized. Total vram 1572864 planes 1
[   86.578857] omapfb: Pixclock 48000 kHz hfreq 44.7 kHz vfreq 57.7 Hz
[   86.599395] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[   86.621612] serial8250.0: ttyS0 at MMIO 0x4806a000 (irq = 72) is a ST16654
[   86.642547] serial8250.1: ttyS1 at MMIO 0x4806c000 (irq = 73) is a ST16654
[   86.663391] serial8250.2: ttyS2 at MMIO 0x49020000 (irq = 74) is a ST16654
[   87.112274] console [ttyS2] enabled
[   87.127990] brd: module loaded
[   87.137115] loop: module loaded
[   87.141357] usbmon: debugfs is not available
[   87.145660] Initializing USB Mass Storage driver...
[   87.150970] usbcore: registered new interface driver usb-storage
[   87.157104] USB Mass Storage support registered.
[   87.161743] i2c /dev entries driver
[   87.277282] TCP cubic registered
[   87.280548] NET: Registered protocol family 17
[   87.285064] NET: Registered protocol family 15
[   87.289672] Power Management for TI OMAP3.
[   87.293975] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1
[   87.303833] regulator_init_complete: incomplete constraints, leaving VDVI on
[   87.311157] regulator_init_complete: incomplete constraints, leaving VDAC on
[   87.318389] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[   87.325164] Freeing init memory: 2012K
[   87.329010] Warning: unable to open an initial console.
[   87.334655] Failed to execute /init
[   87.338409] Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
I know that the first thing that will be executed is the /init file. from there, I just want to run busybox (I don't want to mount a root file system but stay with initramfs). For that, I am just including the following to /init file:

Code:
/init -> /bin/busybox
Do you know if that's the right way to do it? I also tried to pass init="/bin/busybox" to kernel command line, but I had the same problem.

I am embedding my initramfs to the kernel by specifying the path in which my initramfs source files are.

Is there something that I am missing?

Also, if you are kind enough to help me understand two more things:
- is it necessary to insert a "cosnole" environmental variable to kernel command line?

- I have an initrd file system used with a different kernel and target but it doesn't work with the kernel/target that I am using now. Is there something that makes an initrd to work only with a specific kenrel/target?

Thank you in advance.

Last edited by pmil; 11-25-2009 at 06:23 AM.
 
Old 11-24-2009, 09:09 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
I'm no expert in these matters, but as no one else has responded, and I do have an interest in the subject, I'll take a shot.
Does your kernel have built-in support for initramfs? How was your initramfs created? Howto create an initramfs image seems to have a decent recipe and useful information for this procedure.
--- rod.
 
Old 11-25-2009, 05:56 AM   #3
pmil
Member
 
Registered: Jul 2008
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks very much for willing to help!

At this time, the only progress I had is that I managed to remove the "unable to open an initial console." warning.

Quote:
Originally Posted by theNbomr View Post
Does your kernel have built-in support for initramfs?
Yes, it does. I have selected the
Code:
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
option, and have specified the path of my initramfs source in the
Code:
()    Initramfs source file(s)
option. I am just passing the source tree path of the filesystem and letting the kernel convert it to .cpio to be sure.

Quote:
Originally Posted by theNbomr View Post
How was your initramfs created? Howto create an initramfs image seems to have a decent recipe and useful information for this procedure.
--- rod.
I used exactly this guide to create it! However, because it's not my intention to mount a root filesystem from the /init file but stay with initramfs as my filesystem, I am just calling busybox from the /init file like that: /bin/busybox I am not doing anything else inside the /init.

I also added a /dev directory and created some device nodes.

Finally, I build a statically linked busybox version using my target's config file, so I thing this should be ok as well.

Any thoughts would be much appreciated!

Last edited by pmil; 11-25-2009 at 05:58 AM.
 
Old 11-25-2009, 07:26 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,465
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
As the kernel is booting I don't think the initram is faulty. But depends on how you boot the kernel. Can you provide us the lines from lilo or grub accordingly.
To me it seems as the partition/filesystem you provide within your bootloader either does not have the required modules inside the initram or is just plain wrong. Check the root option of the kernel boot line.

This is all just ideas cause I never fiddle with diskless kernel...
 
Old 11-25-2009, 08:29 AM   #5
pmil
Member
 
Registered: Jul 2008
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by zhjim View Post
As the kernel is booting I don't think the initram is faulty. But depends on how you boot the kernel. Can you provide us the lines from lilo or grub accordingly.
To me it seems as the partition/filesystem you provide within your bootloader either does not have the required modules inside the initram or is just plain wrong. Check the root option of the kernel boot line.
As I mentioned to my first post, I am using U-boot to boot the kernel as I am trying to boot it on an embedded target.

I also mentioned that I am building-in intramfs to the kernel so there is no need for root option on the kernel boot line. The lines that I use to boot it are the following:

Code:
setenv bootargs 'console=ttyS2,115200n8'
mmcinit; fatload mmc 0 0x80002000 uImage; bootm 0x80002000
Thanks.
 
Old 11-25-2009, 09:51 AM   #6
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,465
Blog Entries: 11

Rep: Reputation: 184Reputation: 184
Ups sorry I forget that your using U-boot.

A thing that I noticed after rereading your original post:
Code:
[   87.318389] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
It's the fifth line from bottom up. Maybe this does something?

Also you might stay inside the ramdisk I'd say the kernel still needs to know where it is.. maybe mount it under /dev/mem? In my opinionen the error message just states this....
Also this fortifies this to some degree (U-Boot wiki)

http://www.denx.de/wiki/view/DULG/LinuxKernelArgs

They also have some more arguments to bootm...


Maybe this can shed some light
http://www.denx.de/wiki/view/DULG/LinuxRamdiskRoot


Maybe you could try to get the ramdisk to run on a normal device with grub or lilo and see if it comes up?

I apologise in advance if all this sound grandiose.
 
Old 12-02-2009, 07:35 PM   #7
huyhoang3673
LQ Newbie
 
Registered: Aug 2009
Location: San Jose
Distribution: RedHat & Ubuntu
Posts: 13

Rep: Reputation: 0
Hi pmil,
I had the same problem like yours a few months ago and I also posted the same question here:
http://www.linuxquestions.org/questi...tramfs-745903/

Here are a few things that I did to resolve this problem. Use whatever you see fit.
1) I intended to boot the 32-bit kernel on a router but accidentally created a busybox binary on a 64-bit machine and incorporated it in to the initramfs/. After realizing this mistake, I switched to a 32-bit server and compile busybox source natively.

2) Create /dev/console device help resolve the "unable to open an initial console" problem.
3) For the "Kernel panic - not syncing: No init found. Try passing init= option to kernel", it's because the way I created initramfs/ and link it in with the kernel source is not correct. I'm pretty sure you have the same problem too. To fix it, I have to move initramfs/ to the local hard drive of the machine I'm trying to build the kernel, not an NFS space. In my case, I move it under /home/huyhoang/initramfs. Here is what I have in /initramfs:

huyhoang@achanta-lnx-001> ls
bin/ dev/ etc/ init* lib/ proc/ root/ sbin@ sys/ tmp/

My bin/init is linked with bin/busybox and I copied the same init up one level to /initramfs:
huyhoang@achanta-lnx-001> cd bin
huyhoang@achanta-lnx-001> ls -l init*
lrwxrwxrwx 1 huyhoang led-grp 7 Sep 14 15:40 init -> busybox*


huyhoang@achanta-lnx-001> cd etc
huyhoang@achanta-lnx-001> ls
fstab* hosts* inittab* mdev.conf* passwd*
group* init.d/ ld.so.cache* nsswitch.conf* profile*

Content of my inittab:

console::sysinit:/etc/init.d/rcS
console::respawn:/bin/getty -L 9600 ttyS0 vt100

When building the kernel, in make menuconfig, I enabled:[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
and specified: (/home/huyhoang/initramfs) Initramfs source file(s)

Those are the things that I did and my kernel booted successfully after that. Good luck and let me know how that goes.

Regards,
Hoang
 
  


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
initramfs ..problem detecting file system vikesh.u Linux - Kernel 2 07-15-2009 03:24 PM
Initrd/initramfs problem during suse10.2 installation ph73nt Suse/Novell 3 08-09-2008 07:31 AM
Installation problem with Hardy(initramfs) svar Ubuntu 6 05-16-2008 11:59 PM
install new kernel problem with initramfs-tools arsham Linux - General 1 10-04-2006 02:53 PM


All times are GMT -5. The time now is 03:25 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration