LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-11-2010, 07:17 AM   #1
ramalingampc2008
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Rep: Reputation: 0
Creating initramfs as inbuilt to the kernel and as permanent rootfs


Hi!

I request your suggestions on the following scenario.

In our eval board we have the 16MB NOR and 16MB SDRAM. in which redboot is used as bootloader and jffs2 rootfs is used.
boot script in eval board is : exec -b 0xC8040000 -l 0x200000 -c "console=ttymxc0 rootfstype=jffs2 ramdisk_size=9400 root=/dev/mtdblock3"

But in our newly fabricated board(with same size of SDRAM and NOR) we are facing problem with NOR access. Because of that we are not able to use the jffs2 rootfs. So For testing the kernel drivers we want to use initramfs as inbuild to the Kernel by giving the path to kernel config as
(/home/ram/bsp/ltib/ltib-imx27ads-20061115_eraser/rootfs.tmp) Initramfs source file(s)
in kernel menuconfig.

But I dont have answer for

1. what should be the cmdline arguments that has to be passed if the inbuilt initramfs is supposed to be permanent rootfs?
2. I gave path of rootfs.tmp(which is uncompressed form of jffs2 image) as the source for the initramfs, Is there any modifications required in init script or any where else?

Our ultimate aim is booting the kernel without any non volatile memory.
Note : Board has no ethernet support in the kernel level(So NFS is ruled out).

Your responses will be greatly appreciated.

Last edited by ramalingampc2008; 11-11-2010 at 07:26 AM.
 
Old 11-14-2010, 09:29 PM   #2
mac.tieu
Member
 
Registered: Jan 2010
Location: Vietnam
Distribution: Arch
Posts: 65

Rep: Reputation: 22
Quote:
Originally Posted by ramalingampc2008 View Post
Hi!

I request your suggestions on the following scenario.

In our eval board we have the 16MB NOR and 16MB SDRAM. in which redboot is used as bootloader and jffs2 rootfs is used.
boot script in eval board is : exec -b 0xC8040000 -l 0x200000 -c "console=ttymxc0 rootfstype=jffs2 ramdisk_size=9400 root=/dev/mtdblock3"

But in our newly fabricated board(with same size of SDRAM and NOR) we are facing problem with NOR access. Because of that we are not able to use the jffs2 rootfs. So For testing the kernel drivers we want to use initramfs as inbuild to the Kernel by giving the path to kernel config as
(/home/ram/bsp/ltib/ltib-imx27ads-20061115_eraser/rootfs.tmp) Initramfs source file(s)
in kernel menuconfig.

But I dont have answer for

1. what should be the cmdline arguments that has to be passed if the inbuilt initramfs is supposed to be permanent rootfs?
Code:
root=/dev/ram0 rw
Quote:
2. I gave path of rootfs.tmp(which is uncompressed form of jffs2 image) as the source for the initramfs, Is there any modifications required in init script or any where else?
May be you should compress 'rootfs.tmp' with gzip.
Quote:
Our ultimate aim is booting the kernel without any non volatile memory.
Note : Board has no ethernet support in the kernel level(So NFS is ruled out).

Your responses will be greatly appreciated.
 
1 members found this post helpful.
Old 11-17-2010, 01:56 AM   #3
ramalingampc2008
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mac.tieu View Post
Code:
root=/dev/ram0 rw
May be you should compress 'rootfs.tmp' with gzip.
Thank you mac.tieu for sparing the time! I referred the following link for creating initramfs.
http://blog.tuxopia.net/2010/03/buil...in-kernel.html

I am not successful with the creation of initramfs as inbuild. so I created the ramdisk and facing some prob. Please have a look at the next post and throw some light on that..


thank you!

Last edited by ramalingampc2008; 11-17-2010 at 02:01 AM.
 
Old 11-17-2010, 02:02 AM   #4
ramalingampc2008
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Hi!

We are trying to create the ramdisk.gz to use with zImage. I created the ramdisk.gz of 2.4MB compressed image using the following procedure

mke2fs -vm0 /dev/ram 6560
mount -t ext2 /dev/ram /mnt
cd /mnt
cp /bin, /sbin, /etc, /dev ... files in mnt
cd ../
umount /mnt
dd if=/dev/ram bs=1k count=6560 of=ramdisk
gzip -9 ramdisk


Then in Redboot I loaded the images using tftp as

load -v -r -b 0x400000 zImage; load -v -r -b 0x600000 ramdisk.gz

boot script edited as

exec -b 0xC0400000 -l 0x200000 -c "console=ttymxc0 root=/dev/ram0 initrd=0xC0600000 ramdisk_size=2417"


And also I tried with many alternative because I am not sure which is correct one. Following are few of them

exec -b 0xC0400000 -l 0x200000 -c "console=ttymxc0 root=/dev/ram0 initrd=0xC0600000,6.5M ramdisk_size=6560"

exec -b 0xC0400000 -l 0x200000 -c "mem=16M console=ttymxc0 root=/dev/ram0 initrd=0xC0600000,6.5M ramdisk_size=6560"


Boot log is

Redboot> exec -b 0xC0400000 -l 0x200000 -c "console=ttymxc0 root=/dev/ram0 initrd=0xC0600000 ramdisk_size=2417"
entry=0xc0008000, target=0xc0008000
Uncompressing Linux.................................................................... done, booting the kernel.
Linux version 2.6.18.1 (ram@emmys0082.emsys.net) (gcc version 4.1.1) #19 PREEMPT Tue Nov 16 10:36:27 IST 2010
CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
Machine: Freescale i.MX21ADS
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists. Total pages: 4096
Kernel command line: console=ttymxc0 root=/dev/ram0 initrd=0xC0600000 ramdisk_size=2417
MXC IRQ initialized
PID hash table entries: 128 (order: 7, 512 bytes)

WARNING: Can't generate CLOCK_TICK_RATE at 7388890 Hz
Actual CLOCK_TICK_RATE is 7388890 Hz
Console: colour dummy device 80x30
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 16MB = 16MB total
Memory: 14076KB available (1704K code, 333K data, 84K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
MXC GPIO hardware
AIPI VA base: 0xe4000000
mx21ads.c: registering mxc keypad device...
CSPI: mxc_spi-1 probed
mxc_spi mxc_spi.1: registering loopback device 'spi'
CSPI: mxc_spi-2 probed
mxc_spi mxc_spi.2: registering loopback device 'spi'
usbcore: registered new driver usbfs
usbcore: registered new driver hub
MXC I2C driver
MX21: Power management module initialized
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered

In _enable_graphic_window
mxc_sdc_fb mxc_sdc_fb.0: fb0: DISP0 BG fb device registered successfully.
Writing to ext RTC successful 2
Real TIme clock Driver v1.0
MixCOM watchdog driver v0.1, watchdog port at 0x 0
Serial: MXC Internal UART driver
mxcintuart.0: ttymxc0 at MMIO 0x1000a000 (irq = 20) is a Freescale MXC
mxcintuart.1: ttymxc1 at MMIO 0x1000b000 (irq = 19) is a Freescale MXC
mxcintuart.2: ttymxc2 at MMIO 0x1000c000 (irq = 18) is a Freescale MXC
RAMDISK driver initialized: 16 RAM disks of 2417K size 1024 blocksize
loop: loaded (max 8 devices)
MXC MTD nor Driver 2.0
mxc_nor_flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
Amd/Fujitsu Extended Query Table at 0x0040
mxc_nor_flash.0: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
RedBoot partition parsing not available
Creating 8 MTD partitions on "mxc_nor_flash.0":
0x00000000-0x00040000 : "Bootloader"
0x00040000-0x001c0000 : "nor.Kernel1"
0x001c0000-0x00340000 : "nor.kernel2"
0x00340000-0x00940000 : "nor.rootfs1"
0x00940000-0x00f40000 : "nor.rootfs2"
0x00f40000-0x00f80000 : "Parameter"
0x00fe0000-0x00fe3000 : "FIS directory"
0x00fff000-0x01000000 : "Redboot config"
Registering the SPI Driver
Device spi1.4 probed
Device spi2.4 probed
usbmon: debugfs is not available
MX2 OTG Driver ver. 1.0 built on 10:35:50 Nov 16 2010
imx21hcd: driver imx21-hcd, 2007 May 27
imx21-hcd imx21-hcd.0: USB Host Controller
imx21-hcd imx21-hcd.0: new USB bus registered, assigned bus number 1
imx21-hcd imx21-hcd.0: irq 55, io mem 0x10024000
usb usb1: Product: USB Host Controller
usb usb1: Manufacturer: Linux 2.6.18.1 imx21-hcd
usb usb1: SerialNumber: imx21-hcd.0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
roothubb 00070000
hub 1-0:1.0: 3 ports detected
FeatPwr0
usbcore: registered new driver usbmb
drivers/usb/class/magicbox.c: v0.13: USB TNT12000 Vendor Specific Device Class driver
udc: mx21_udc version 18 April 2007
TNT12000 Gadget: mb_req_free ep0=c033c460 buf=c0391be0
TNT12000 Gadget: TNT12000 Gadget, version: 0.1.2 05/21/2007
TNT12000 Gadget: using mx21_udc, OUT ep2out-bulk IN ep1in-bulk
MXC keypad loaded
input: mxckpd as /class/input/input0
i2c /dev entries driver
NET: Registered protocol family 1
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
ramdisk_execute_command <NULL>
TNT12000 Gadget: suspend
No filesystem could mount root, tried: ext3 ext2 romfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)



1. Is there any problem with the bootargument? And also Is there any guide to guide what I should pass as bootargs for ramdisk usage?

2. For ramdisk implementation, only bootargs are enough or any kernel configurations are required?


Notes:

Our system got a 16MB SDRAM, no other memory.
 
Old 11-17-2010, 03:18 AM   #5
mac.tieu
Member
 
Registered: Jan 2010
Location: Vietnam
Distribution: Arch
Posts: 65

Rep: Reputation: 22
I think your initrd was not loaded. Follow RedBoot User's Guide, you should try 'exec' command like:
Code:
exec -b 0xC0400000 -l 0x200000 -r 0xC0600000 -s 0x400000 -c "console=ttymxc0 root=/dev/ram0"
Regards,
MT
 
1 members found this post helpful.
Old 11-17-2010, 11:42 PM   #6
ramalingampc2008
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Lightbulb

Quote:
Originally Posted by mac.tieu View Post
I think your initrd was not loaded. Follow RedBoot User's Guide, you should try 'exec' command like:
Code:
exec -b 0xC0400000 -l 0x200000 -r 0xC0600000 -s 0x400000 -c "console=ttymxc0 root=/dev/ram0"
Thank you so much MT. When I modified the redboot command and ramdisk size, ramdisk is mounted.

Modified command is
Code:
exec -b 0xC0400000 -l 0x200000 -r 0xC0600000 -s 0x260000 -c "console=ttymxc0 root=/dev/ram0 initrd=0xC0600000 ramdisk_size=6560"

Last edited by ramalingampc2008; 11-17-2010 at 11:44 PM.
 
  


Reply

Tags
initramfs, permanent



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
problem wiht creating initrd (initramfs.img) file using dracut Crackel Linux - Kernel 0 10-26-2010 06:19 PM
Is Linux2.6 having inbuilt kernel program for USB and VGA? asprakash Linux - Hardware 2 05-19-2006 01:29 PM
Is Linux2.6 having inbuilt kernel program for USB and VGA? asprakash Linux - Software 1 05-19-2006 06:57 AM
How to list modules inbuilt with kernel zulfilee Linux - Software 2 02-17-2006 11:58 PM
Kernel Panic :VFS :unable to mount rootfs 16:02 abirami Linux - Software 5 01-02-2006 11:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:44 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
Open Source Consulting | Domain Registration