[yocto] Yocto procedure to write generated image to hdd

Iván Castell icastell at nayarsystems.com
Fri Mar 2 00:52:37 PST 2018


First of all, thank you for your support Mr. Anuj.

I extracted "initrd" image contents:

$ binwalk initrd

DECIMAL       HEXADECIMAL     DESCRIPTION
------------------------------------------------------------
--------------------
0             0x0             ASCII cpio archive (SVR4 with no CRC), file
name: "kernel", file name length: "0x00000007", file size: "0x00000000"
120           0x78            ASCII cpio archive (SVR4 with no CRC), file
name: "kernel/x86", file name length: "0x0000000B", file size: "0x00000000"
244           0xF4            ASCII cpio archive (SVR4 with no CRC), file
name: "kernel/x86/microcode", file name length: "0x00000015", file size:
"0x00000000"
376           0x178           ASCII cpio archive (SVR4 with no CRC), file
name: "kernel/x86/microcode/.enuineIntel.align.0123456789abc", file name
length: "0x00000036", file size: "0x00000000"
540           0x21C           ASCII cpio archive (SVR4 with no CRC), file
name: "kernel/x86/microcode/GenuineIntel.bin", file name length:
"0x00000026", file size: "0x00183400"
1586864       0x1836B0        ASCII cpio archive (SVR4 with no CRC), file
name: "TRAILER!!!", file name length: "0x0000000B", file size: "0x00000000"
1587200       0x183800        gzip compressed data, maximum compression,
from Unix, last modified: 2018-02-28 14:29:13

$ dd if=initrd bs=1587200 skip=1 | gunzip | cpio -idm

Now I have the initrd filesystem available. I can confirm there is a bug in
that filesystem because the "init" script uses "sleep" but that tool is not
installed on it.

# Prints a message and start a endless loop
fatal() {
    echo $1 >/dev/console
    echo >/dev/console

    if [ -n "$bootparam_init_fatal_sh" ]; then
        sh
    else
    while [ "true" ]; do
        sleep 3600
    done
    fi
}

As you pointed, that "init" script is located into
poky/meta/recipes-core/initrdscripts/initramfs-framework/init. In that init
script there are two calls to "fatal" function. Maybe this information can
be useful to discover what is happening.

I have tested adding suggested "init_fatal_sh" bootarg but I don't get any
shell to debug the problem.



2018-03-02 9:15 GMT+01:00 Anuj Mittal <anuj.mittal at intel.com>:

> On 03/02/2018 03:41 PM, Iván Castell wrote:
> >
> > 2018-03-02 0:41 GMT+01:00 Anuj Mittal <anuj.mittal at intel.com
> > <mailto:anuj.mittal at intel.com>>:
> >
> >     Hi,
> >
> >     On 03/01/2018 07:20 PM, Iván Castell wrote:
> >     >
> >     > Is this the proper way to install the generated image in the hard
> >     disk?
> >     > Maybe I am doing something wrong?
> >
> >     Does the image boot up if you select 'boot'?
> >
> >
> > I tested selecting 'boot' option and it happens exactly the same: a
> > black screen appears when booting with default options, and when adding
> > "noapic", the screen is flooded of "sleep: command not found" messages.
> >
> >
> >
> >     Do you eventually get options to select storage media after all
> >     these 'not found' messages if you select 'install'?
> >
> >
> > After waiting more than 5 minutes, the "sleep: command not found"
> > message continues flooding the screen.
> >
> >
> >
> >     Can you share the logs?
> >
> >
> > If I could, I would do it, but I have no way to get those logs out of
> > the box without a terminal available.
>
> The error is probably coming from
> meta/recipes-core/initrdscripts/initramfs-framework/init.
>
> You can pass a boot parameter 'init_fatal_sh' and that should help you
> drop to a shell and debug this problem further.
>
>


-- 




*NOTA LEGAL*
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario y se encuentra protegido por Ley. Cualquier persona distinta
de su destinataria tiene prohibida su reproducción, uso, divulgación, copia
o impresión total o parcial. Si ha recibido este correo electrónico por
error, se ruega lo notifique de inmediato al remitente borrando el mensaje
original juntamente con sus ficheros anexos. Gracias.

De conformidad con lo establecido en la LOPD, NAYAR SYSTEMS SL garantiza la
adopción de las medidas necesarias para asegurar el tratamiento
confidencial de los datos de carácter personal. Así mismo le informamos de
la inclusión de sus datos en un fichero bajo la responsabilidad de NAYAR
SYSTEMS SL, con la finalidad de poder atender los compromisos derivados de
la relación que mantenemos con usted. Si lo desea, puede ejercer sus
derechos de acceso, rectificación, cancelación y oposición mediante un
escrito a la siguiente dirección: info at nayarsystems.com

*LEGAL NOTE*
This email and any attachments to it contains is confidential information
exclusively intended for the recipients. Any divulgation, copy or
distribution to third parties is prohibited without written permission of
NAYAR SYSTEMS SL. If you have received this e-mail in error, please notify
the sender immediately. In accordance with Law 15/1999 of 13 December on
the Protection of Personal Data, the NAYAR SYSTEMS SL guarantees that it
has adopted the necessary measures to ensure the confidential treatment of
personal information. We also inform you that you can exercise your access,
rectification, cancellation and opposition rights by send us a mail to:
info at nayarsystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20180302/5a4a0c14/attachment.html>


More information about the yocto mailing list