All of lore.kernel.org
 help / color / mirror / Atom feed
* initramfs and system logs
@ 2024-01-17 13:43 jguittet.opensource
  2024-01-17 17:49 ` [yocto] " Khem Raj
  0 siblings, 1 reply; 8+ messages in thread
From: jguittet.opensource @ 2024-01-17 13:43 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

Dear community,

I'm currently building a professional yocto project.
There are 2 variants of the image I'm building: the first one is using classical rootfs on SD card (dev and test purpose). The other one is building an initramfs fitImage (production). I'm using INITRAMFS_IMAGE to indicate the name of the recipe building the initramfs + INITRAMFS_IMAGE_BUNDLE = "1".

Problem I get is that the initramfs image produces no logs (except kernel logs) in the console while the dev with the rootfs on the SD card have logs printed in the console. I don't understand why and where I should patch to have logs. The wanted logs are logs from init.d scripts for example (creating ssh keys, setting hwclock etc) + logs from my own applications that are properly output on the serial console with the "classic" image.

Thanks for any feedbacks!
Joel

[-- Attachment #2: Type: text/html, Size: 3746 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [yocto] initramfs and system logs
  2024-01-17 13:43 initramfs and system logs jguittet.opensource
@ 2024-01-17 17:49 ` Khem Raj
  2024-01-18  7:52   ` Mauro Salvini
  0 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2024-01-17 17:49 UTC (permalink / raw)
  To: yocto, jguittet.opensource

On Wed, Jan 17, 2024 at 5:43 AM jguittet.opensource via
lists.yoctoproject.org
<jguittet.opensource=witekio.com@lists.yoctoproject.org> wrote:
>
> Dear community,
>
> I'm currently building a professional yocto project.
> There are 2 variants of the image I'm building: the first one is using classical rootfs on SD card (dev and test purpose). The other one is building an initramfs fitImage (production). I'm using INITRAMFS_IMAGE to indicate the name of the recipe building the initramfs + INITRAMFS_IMAGE_BUNDLE = "1".
>
> Problem I get is that the initramfs image produces no logs (except kernel logs) in the console while the dev with the rootfs on the SD card have logs printed in the console. I don't understand why and where I should patch to have logs. The wanted logs are logs from init.d scripts for example (creating ssh keys, setting hwclock etc) + logs from my own applications that are properly output on the serial console with the "classic" image.

check if /dev/console is created in the initramfs init script which
runs as /sbin/init

>
> Thanks for any feedbacks!
> Joel
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> You automatically follow any topics you start or reply to.
> View/Reply Online (#62177): https://lists.yoctoproject.org/g/yocto/message/62177
> Mute This Topic: https://lists.yoctoproject.org/mt/103785822/1997914
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [yocto] initramfs and system logs
  2024-01-17 17:49 ` [yocto] " Khem Raj
@ 2024-01-18  7:52   ` Mauro Salvini
  2024-01-18  8:30     ` Joel GUITTET
  0 siblings, 1 reply; 8+ messages in thread
From: Mauro Salvini @ 2024-01-18  7:52 UTC (permalink / raw)
  To: yocto, jguittet.opensource; +Cc: raj.khem

On 17/01/24 18:49, Khem Raj wrote:
> On Wed, Jan 17, 2024 at 5:43 AM jguittet.opensource via
> lists.yoctoproject.org
> <jguittet.opensource=witekio.com@lists.yoctoproject.org> wrote:
>>
>> Dear community,
>>
>> I'm currently building a professional yocto project.
>> There are 2 variants of the image I'm building: the first one is using classical rootfs on SD card (dev and test purpose). The other one is building an initramfs fitImage (production). I'm using INITRAMFS_IMAGE to indicate the name of the recipe building the initramfs + INITRAMFS_IMAGE_BUNDLE = "1".
>>
>> Problem I get is that the initramfs image produces no logs (except kernel logs) in the console while the dev with the rootfs on the SD card have logs printed in the console. I don't understand why and where I should patch to have logs. The wanted logs are logs from init.d scripts for example (creating ssh keys, setting hwclock etc) + logs from my own applications that are properly output on the serial console with the "classic" image.
> 
> check if /dev/console is created in the initramfs init script which
> runs as /sbin/init
> 
>>
>> Thanks for any feedbacks!
>> Joel

Hi Joel,

how many console= arguments do you have on the kernel cmdline?
Kernel logs are shown on all of the declared consoles, but userspace 
logs (initrd script logs, init manager logs) are shown only on last 
console= specified in kernel cmdline.

Regards

-- 
Mauro Salvini | KOAN sas | Bergamo - Italia
embedded software engineering
http://KoanSoftware.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [yocto] initramfs and system logs
  2024-01-18  7:52   ` Mauro Salvini
@ 2024-01-18  8:30     ` Joel GUITTET
  2024-01-23 10:02       ` Joel GUITTET
  0 siblings, 1 reply; 8+ messages in thread
From: Joel GUITTET @ 2024-01-18  8:30 UTC (permalink / raw)
  To: Mauro, yocto

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

Thanks for the answers.

- /sbin/init is a symlink to /sbin/init.sysvinit and it's a binary file, not a script. Maybe I should look at the sources that build this ? Will do in parallel.

- console= arguments is the same for both my images, eg "console=ttyS0,115200n8".
The difference between the 2 images on the cmdline are only the options related to the rootfs:
* distro with the rootfs on the sdcard: "mem=128M console=ttyS0,115200n8 root=/dev/mmcblk0p4 rw rootfstype=ext4 rootwait"
* distro with the initramfs: "mem=128M console=ttyS0,115200n8"

I have done a check of /proc/consoles for both (don't know if this is really important, this returns "ttyS0                -W- (EC p a)    4:64" for both distro.

Joel

[-- Attachment #2: Type: text/html, Size: 824 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [yocto] initramfs and system logs
  2024-01-18  8:30     ` Joel GUITTET
@ 2024-01-23 10:02       ` Joel GUITTET
  2024-02-08 15:12         ` Joel GUITTET
  0 siblings, 1 reply; 8+ messages in thread
From: Joel GUITTET @ 2024-01-23 10:02 UTC (permalink / raw)
  To: Joel GUITTET, yocto

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

Hello all,

Checked init process and build option, don't find any relevant information.

Anybody getting the same issue (no output on the console at the initialization) while building an initramfs ??

Thanks!
Joel

[-- Attachment #2: Type: text/html, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [yocto] initramfs and system logs
  2024-01-23 10:02       ` Joel GUITTET
@ 2024-02-08 15:12         ` Joel GUITTET
  2024-02-08 16:00           ` Khem Raj
  0 siblings, 1 reply; 8+ messages in thread
From: Joel GUITTET @ 2024-02-08 15:12 UTC (permalink / raw)
  To: Joel GUITTET, yocto

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

Hello community!

Finally got a solution to my issue.

I created a busybox_%.bbappend file in my layer with the following content, to create the /dev/console node during the build:

> 
> # Install
> do_install:append() {
> # init process needs the console created before running
> # If the console is not available, no logs are displayed in the terminal
> install -d ${D}/dev
> mknod -m 622 ${D}/dev/console c 5 1
> }
> FILES:${PN}:append = " \
> /dev/console \
> "
> 

I also found a relevant discussion here that seems still to be up to date: https://busybox.busybox.narkive.com/Erf4teRC/modifying-init-to-create-dev-console

I hope this will help others reading this message in the future :-)

Joel

[-- Attachment #2: Type: text/html, Size: 1090 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [yocto] initramfs and system logs
  2024-02-08 15:12         ` Joel GUITTET
@ 2024-02-08 16:00           ` Khem Raj
  2024-02-08 16:12             ` Joel GUITTET
  0 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2024-02-08 16:00 UTC (permalink / raw)
  To: yocto, jguittet.opensource

On Thu, Feb 8, 2024 at 7:12 AM Joel GUITTET via lists.yoctoproject.org
<jguittet.opensource=witekio.com@lists.yoctoproject.org> wrote:
>
> Hello community!
>
> Finally got a solution to my issue.
>
> I created a busybox_%.bbappend file in my layer with the following content, to create the /dev/console node during the build:
>
> # Install
> do_install:append() {
>     # init process needs the console created before running
>     # If the console is not available, no logs are displayed in the terminal
>     install -d ${D}/dev
>     mknod -m 622 ${D}/dev/console c 5 1
> }
> FILES:${PN}:append = " \
>     /dev/console \
> "
>
> I also found a relevant discussion here that seems still to be up to date: https://busybox.busybox.narkive.com/Erf4teRC/modifying-init-to-create-dev-console
>
> I hope this will help others reading this message in the future :-)

busybox would not be appropriate recipe to create this device, since
it is also used in main rootfs, however a separate recipe or init
script would be a better place see
meta/recipes-core/initrdscripts/initramfs-framework/init

>
> Joel
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> You automatically follow any topics you start or reply to.
> View/Reply Online (#62430): https://lists.yoctoproject.org/g/yocto/message/62430
> Unfollow This Topic: https://lists.yoctoproject.org/unft/103785822/1997914
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [yocto] initramfs and system logs
  2024-02-08 16:00           ` Khem Raj
@ 2024-02-08 16:12             ` Joel GUITTET
  0 siblings, 0 replies; 8+ messages in thread
From: Joel GUITTET @ 2024-02-08 16:12 UTC (permalink / raw)
  To: Khem Raj, yocto

[-- Attachment #1: Type: text/plain, Size: 220 bytes --]

Not bad to have a separated recipe as well. I added this to busybox because init is provided by busybox in my case.
I'm not using the initramfs-framework, so the init script you indicated there doesn't help me at all.

[-- Attachment #2: Type: text/html, Size: 224 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-08 16:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-17 13:43 initramfs and system logs jguittet.opensource
2024-01-17 17:49 ` [yocto] " Khem Raj
2024-01-18  7:52   ` Mauro Salvini
2024-01-18  8:30     ` Joel GUITTET
2024-01-23 10:02       ` Joel GUITTET
2024-02-08 15:12         ` Joel GUITTET
2024-02-08 16:00           ` Khem Raj
2024-02-08 16:12             ` Joel GUITTET

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.