lkml.org 
[lkml]   [2021]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6 2/2] init/do_mounts.c: create second mount for initramfs
Hello,

On Wed, Jul 28, 2021 at 4:07 PM Petr Mladek <pmladek@suse.com> wrote:
>
[...]
>
> I guess that you have seen the following message printed by
> console_on_rootfs():
>
> "Warning: unable to open an initial console."
>
> This function is responsible for opening stdin, stdout, stderr
> file to be used by the init process.
>
> I am not sure how this is supposed to work with the pivot_root
> and initramfs.
>
>
> Some more details:
>
> console_on_rootfs() tries to open /dev/console. It is created
> by tty_init(). The open() callback calls:
>
> + tty_kopen()
> + tty_lookup_driver()
> + console_device()
>
> , where console_device() iterates over all registered consoles
> and returns the first with tty binding.
>
> There is ttynull_console that might be used as a fallback. But I
> am not sure if this is what you want.

I didn't figure out the relation between initramfs and initial console,
could you please tell me how this warning came up? I can't
reproduce it in qemu with this command:

qemu-system-x86_64 -nographic -m 2048M -smp cores=4,sockets=1 -s
-kernel ./bzImage -initrd ./rootfs.cpio -append "rdinit=/init
console=ttyS0"

Thanks!
Menglong Dong

>
> Best Regards,
> Petr

\
 
 \ /
  Last update: 2021-07-29 15:27    [W:2.022 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site