Note that there are some explanatory texts on larger screens.

plurals
  1. POInitramfs built into custom Linux kernel is not running
    primarykey
    data
    text
    <p>I am building a custom initramfs image that I am building as a CPIO archive into the Linux kernel (3.2).</p> <p>The issue I am having is that no matter what I try, the kernel does not appear to even attempt to run from the initramfs.</p> <p>The files I have in my CPIO archive:</p> <pre><code>cpio -it &lt; initramfs.cpio . init usr usr/sbin lib lib/libcrypt.so.1 lib/libm.so lib/libc.so.6 lib/libgcc_s.so lib/libcrypt-2.12.2.so lib/libgcc_s.so.1 lib/libm-2.12.2.so lib/libc.so lib/libc-2.12.2.so lib/ld-linux.so.3 lib/ld-2.12.2.so lib/libm.so.6 proc sbin mnt mnt/root root etc bin bin/sh bin/mknod bin/mount bin/busybox sys dev 4468 blocks </code></pre> <p>Init is very simple, and should just init devices and spawn a shell (for now):</p> <pre><code>#!/bin/sh mount -t devtmpfs none /dev mount -t proc none /proc mount -t sysfs none /sys /bin/busybox --install -s exec /bin/sh </code></pre> <p>In the kernel .config I have:</p> <pre><code>CONFIG_INITRAMFS_SOURCE="../initramfs.cpio" CONFIG_INITRAMFS_ROOT_UID=0 CONFIG_INITRAMFS_ROOT_GID=0 CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=1 CONFIG_BLK_DEV_RAM_SIZE=32768 </code></pre> <p>Kernel builds and the uImage size is larger depending on the initramfs size, so I know the image is being packed. However I get this output when I boot:</p> <pre><code>console [netcon0] enabled netconsole: network logging started omap_rtc omap_rtc: setting system clock to 2000-01-02 00:48:38 UTC (946774118) Warning: unable to open an initial console. Freeing init memory: 1252K mmc0: host does not support reading read-only switch. assuming write-enable. mmc0: new high speed SDHC card at address e624 mmcblk0: mmc0:e624 SU08G 7.40 GiB mmcblk0: p1 Kernel panic - not syncing: Attempted to kill init! [&lt;c000d518&gt;] (unwind_backtrace+0x0/0xe0) from [&lt;c0315cf8&gt;] (panic+0x58/0x188) [&lt;c0315cf8&gt;] (panic+0x58/0x188) from [&lt;c0021520&gt;] (do_exit+0x98/0x6c0) [&lt;c0021520&gt;] (do_exit+0x98/0x6c0) from [&lt;c0021e88&gt;] (do_group_exit+0xb0/0xdc) [&lt;c0021e88&gt;] (do_group_exit+0xb0/0xdc) from [&lt;c0021ec4&gt;] (sys_exit_group+0x10/0x18) [&lt;c0021ec4&gt;] (sys_exit_group+0x10/0x18) from [&lt;c00093a0&gt;] (ret_fast_syscall+0x0/0x2c) </code></pre> <p>From that output, it does not look like it is even trying to extract the CPIO archive as initramfs. I expect to see this printk output, which is present in linux code init/initramfs.c:</p> <pre><code>printk(KERN_INFO "Trying to unpack rootfs image as initramfs...\n"); </code></pre> <p>I tried the filesystem once booting is complete (using chroot) and it works fine... so I believe the filesystem/libraries are sane.</p> <p>Could anyone give me some pointers as to what I may have incorrect? Thanks in advance for any assistance! </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload