Initramfs, das in einen benutzerdefinierten Linux-Kernel integriert ist, wird nicht ausgeführt
Ich erstelle ein benutzerdefiniertes initramfs-Image, das ich als CPIO-Archiv im Linux-Kernel (3.2) erstelle.
Das Problem, das ich habe, ist, dass egal was ich versuche, der Kernel anscheinend nicht einmal versucht, von den initramfs auszuführen.
Die Dateien, die ich in meinem CPIO-Archiv habe:
<code>cpio -it < 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>
Init ist sehr einfach und sollte (vorerst) nur Geräte initialisieren und eine Shell erzeugen:
<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>
In der Kernel .config habe ich:
<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>
Der Kernel wird erstellt, und die Größe von uImage hängt von der Größe von initramfs ab, sodass ich weiß, dass das Image gepackt wird. Allerdings bekomme ich diese Ausgabe beim Booten:
<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! [<c000d518>] (unwind_backtrace+0x0/0xe0) from [<c0315cf8>] (panic+0x58/0x188) [<c0315cf8>] (panic+0x58/0x188) from [<c0021520>] (do_exit+0x98/0x6c0) [<c0021520>] (do_exit+0x98/0x6c0) from [<c0021e88>] (do_group_exit+0xb0/0xdc) [<c0021e88>] (do_group_exit+0xb0/0xdc) from [<c0021ec4>] (sys_exit_group+0x10/0x18) [<c0021ec4>] (sys_exit_group+0x10/0x18) from [<c00093a0>] (ret_fast_syscall+0x0/0x2c) </code>
Aus dieser Ausgabe sieht es nicht so aus, als würde es sogar versuchen, das CPIO-Archiv als initramfs zu extrahieren. Ich erwarte diese Printk-Ausgabe, die im Linux-Code init / initramfs.c enthalten ist:
<code>printk(KERN_INFO "Trying to unpack rootfs image as initramfs...\n"); </code>
Ich habe versucht, das Dateisystem nach Abschluss des Bootvorgangs (mit chroot) zu testen, und es funktioniert einwandfrei. Ich halte das Dateisystem / die Bibliotheken für vernünftig.
Kann mir jemand einen Hinweis geben, was ich falsch gemacht habe? Vielen Dank im Voraus für jede Hilfe!