Hi all, I've built a kernel with support for initramfs in it but haven't linked the initramfs into the kernel. The kernel and initramfs are placed at their respective memory addresses and using u-boot iminfo command I can verify that.
As soon as the kernel starts to decompress and load the initramfs it hangs while executing init from the initramfs.
This is the error I get:--
U-Boot 2014.01 (Jan 16 2019 - 17:32:13)
CPU: Freescale i.MX28 rev1.2 at 454 MHz
BOOT: NAND, 3V3
DRAM: 64 MiB
NAND: 128 MiB
Video: MXSFB: 'videomode' variable not set!
In: serial
Out: serial
Err: serial
Net: FEC0 [PRIME], FEC1
Hit any key to stop autoboot: 5 4 0
=> prn iminfo 0x42300000
## Checking Image at 42300000 ...
Legacy image found
Image Name: Root Filesystem
Created: 2019-02-22 18:40:04 UTC
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 1896596 Bytes = 1.8 MiB
Load Address: 40800000
Entry Point: 40800000
Verifying Checksum ... OK
=> iminfo 0x42300000 00000 000000
## Checking Image at 42000000 ...
Legacy image found
Image Name: Linux-2.6.35.3-flex-dvt
Created: 2019-04-09 15:46:08 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1926580 Bytes = 1.8 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
=> boot boot
Unknown command 'console=ttyAM0,115200' - try 'help'
## Booting kernel from Legacy Image at 42000000 ...
Image Name: Linux-2.6.35.3-flex-dvt
Created: 2019-04-09 15:46:08 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1926580 Bytes = 1.8 MiB
Load Address: 40008000
Entry Point: 40008000
## Loading init Ramdisk from Legacy Image at 42300000 ...
Image Name: Root Filesystem
Created: 2019-02-22 18:40:04 UTC
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 1896596 Bytes = 1.8 MiB
Load Address: 40800000
Entry Point: 40800000
Loading Kernel Image ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.35.3-670-g914558e-dvt-g4ea3bcd-dirty (srishti@iot-compile) (gcc version 4.4.4 (4.4.4_09.06.2010) ) #1 PREEMPT Tue Apr 9 21:11:13 IST 2019
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Freescale MX28EVK board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: console=ttyAM0,115200 rootfstype=ramfs root=/dev/ram rw gpmi init=/init earlyprintk=serial
.
.
.
VFS: Mounted root (ramfs filesystem) on device 0:11.
Freeing init memory: 124K
Failed to execute /init. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
Backtrace:
[<8002b990>] (dump_backtrace+0x0/0x110) from [<802d69a8>] (dump_stack+0x18/0x1c)
r7:00000013 r6:80046b14 r5:800221c8 r4:803dbd58
[<802d6990>] (dump_stack+0x0/0x1c) from [<802d6a24>] (panic+0x78/0xfc)
[<802d69ac>] (panic+0x0/0xfc) from [<800275ec>] (init_post+0xb4/0xdc)
r3:00000000 r2:83c72d00 r1:83c72e00 r0:80359312
[<80027538>] (init_post+0x0/0xdc) from [<800084fc>] (kernel_init+0x12c/0x170)
r5:800221c8 r4:803daf40
[<800083d0>] (kernel_init+0x0/0x170) from [<80046b14>] (do_exit+0x0/0x6a4)
r5:800083d0 r4:00000000
My goal here is to build a minimal firmware with kernel and initramfs only as far as I can see the log initramfs gets mounted properly but don't know the reason why it cannot execute any file from initramfs. Also, in the kernel config I've enabled the following:--
General setup --->
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
( ) Initramfs source file(s)
[*] Optimize for size
And...
Device Drivers --->
[*] Block devices --->
<*> RAM block device support
(16) Default number of RAM disks
(4096) Default RAM disk size (kbytes)
I don't know where I'm going wrong If anyone has any clue pls post your suggestions.
Regards,
Amit.