All of lore.kernel.org
 help / color / mirror / Atom feed
* Always install initramfs-framework-base in case of linux-yocto & INITRAMFS_IMAGE_BUNDLE=1
@ 2019-01-29 20:00 Alexey Brodkin
  2019-01-31 21:17 ` Leon Woestenberg
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Brodkin @ 2019-01-29 20:00 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Hello,

I'd like to get more educated opinions before sending silly patches.

I'm building a uImage with built-in initramfs.
If I build any vanilla kernel (i.e. with no OE/Yocto patches)
all work well but if I switch to linux-yocto I'm getting a panic
saying:
--------------------------->8----------------------
/dev/console is missing or not a character device!
Please ensure your rootfs is properly configured
--------------------------->8----------------------

This panic comes from linux-yocto patch [1].
And the fix is simple - just add "initramfs-framework-base" to the image
so that "/dev/console" will be explicitly created on host thanks to
Patrick's fix [2].

What I don't like here is that developer has to keep in mind that
not super obvious dependency [especially since vanilla kernels just work].
So how that could be automated?

1. Use "core-image-minimal-initramfs"
   And that's what I did in the first place... but that probably work for x86
   because of COMPATIBLE_HOST = "(i.86|x86_64).*-linux".
   I tried to add "arc|" there so it becomes suitable for poor ARC users and faced
   COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
   in initramfs-module-install.
   That said not sure now if "core-image-minimal-initramfs" is really any
   "general purpose" image or not. Is there a point in trying to make it usable
   for all?

2. Just automatically add "initramfs-framework-base" to the image whenever
   both linux-yocto and INITRAMFS_IMAGE_BUNDLE=1 are used. But then what is
   the best place to do that check?
   Is "meta/recipes-kernel/linux/linux-yocto.inc" the right place?

[1] http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-cache/tree/patches/boot/check-console-device-file-on-fs-when-booting.patch
[2] https://github.com/openembedded/openembedded-core/commit/0352841cd92f6316bcac092e2fff9d28c352b36b

-Alexey


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

* Re: Always install initramfs-framework-base in case of linux-yocto & INITRAMFS_IMAGE_BUNDLE=1
  2019-01-29 20:00 Always install initramfs-framework-base in case of linux-yocto & INITRAMFS_IMAGE_BUNDLE=1 Alexey Brodkin
@ 2019-01-31 21:17 ` Leon Woestenberg
  2019-02-06 15:53   ` Alexey Brodkin
  0 siblings, 1 reply; 5+ messages in thread
From: Leon Woestenberg @ 2019-01-31 21:17 UTC (permalink / raw)
  To: Alexey Brodkin; +Cc: Patches and discussions about the oe-core layer

On Tue, Jan 29, 2019 at 9:01 PM Alexey Brodkin
<alexey.brodkin@synopsys.com> wrote:
> --------------------------->8----------------------
> /dev/console is missing or not a character device!
> Please ensure your rootfs is properly configured
> --------------------------->8----------------------

I thought /dev/console could also be created by the kernel itself onto
a "temporary filesystem for device nodes" (DEVTMPFS).
I am not sure, but here is a similar case:
http://lists.busybox.net/pipermail/buildroot/2015-March/123309.html

Is your (other) kernel configured with CONFIG_DEVTMPFS=y?

Regards,

Leon.


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

* Re: Always install initramfs-framework-base in case of linux-yocto & INITRAMFS_IMAGE_BUNDLE=1
  2019-01-31 21:17 ` Leon Woestenberg
@ 2019-02-06 15:53   ` Alexey Brodkin
  2019-02-07 14:25     ` Andrea Adami
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Brodkin @ 2019-02-06 15:53 UTC (permalink / raw)
  To: Leon Woestenberg; +Cc: Patches and discussions about the oe-core layer

Hi Leon,

> -----Original Message-----
> From: Leon Woestenberg <leon@sidebranch.com>
> Sent: Friday, February 1, 2019 12:18 AM
> To: Alexey Brodkin <alexey.brodkin@synopsys.com>
> Cc: Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>
> Subject: Re: [OE-core] Always install initramfs-framework-base in case of linux-yocto &
> INITRAMFS_IMAGE_BUNDLE=1
> 
> On Tue, Jan 29, 2019 at 9:01 PM Alexey Brodkin
> <alexey.brodkin@synopsys.com> wrote:
> > --------------------------->8----------------------
> > /dev/console is missing or not a character device!
> > Please ensure your rootfs is properly configured
> > --------------------------->8----------------------
> 
> I thought /dev/console could also be created by the kernel itself onto
> a "temporary filesystem for device nodes" (DEVTMPFS).
> I am not sure, but here is a similar case:
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.busybox.net_pipermail_buildroot_2015-
> 2DMarch_123309.html&d=DwIBaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=
> 9xab_6OSIxhk6sCiqSFEwTUASBIaA_-C_wGiSMfJn3o&s=SJ9X7QVWrd1gCdyBsL9fdY841I4qG2y47VH3Sw-IRF4&e=
> 
> Is your (other) kernel configured with CONFIG_DEVTMPFS=y?

Indeed it is.

The problem is devtmpfs is auto-mounted in prepare_namespace() which
is not executed in case of initramfs because in case of initramfs we
expect its "/init" will do everything itself, see [1].

That said enabling CONFIG_DEVTMPFS_MOUNT doesn't help with initramfs too.
So I don't see any other solution except disabling this check in case
of enabled CONFIG_BLK_DEV_INITRD, see [2].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/early-userspace/README#n140
[2] https://lists.yoctoproject.org/pipermail/linux-yocto/2019-February/007552.html

-Alexey



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

* Re: Always install initramfs-framework-base in case of linux-yocto & INITRAMFS_IMAGE_BUNDLE=1
  2019-02-06 15:53   ` Alexey Brodkin
@ 2019-02-07 14:25     ` Andrea Adami
  2019-02-08  6:41       ` Alexey Brodkin
  0 siblings, 1 reply; 5+ messages in thread
From: Andrea Adami @ 2019-02-07 14:25 UTC (permalink / raw)
  To: Alexey Brodkin; +Cc: Patches and discussions about the oe-core layer

On Wed, Feb 6, 2019 at 4:54 PM Alexey Brodkin
<alexey.brodkin@synopsys.com> wrote:
>
> Hi Leon,
>
> > -----Original Message-----
> > From: Leon Woestenberg <leon@sidebranch.com>
> > Sent: Friday, February 1, 2019 12:18 AM
> > To: Alexey Brodkin <alexey.brodkin@synopsys.com>
> > Cc: Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>
> > Subject: Re: [OE-core] Always install initramfs-framework-base in case of linux-yocto &
> > INITRAMFS_IMAGE_BUNDLE=1
> >
> > On Tue, Jan 29, 2019 at 9:01 PM Alexey Brodkin
> > <alexey.brodkin@synopsys.com> wrote:
> > > --------------------------->8----------------------
> > > /dev/console is missing or not a character device!
> > > Please ensure your rootfs is properly configured
> > > --------------------------->8----------------------
> >
> > I thought /dev/console could also be created by the kernel itself onto
> > a "temporary filesystem for device nodes" (DEVTMPFS).
> > I am not sure, but here is a similar case:
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.busybox.net_pipermail_buildroot_2015-
> > 2DMarch_123309.html&d=DwIBaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=
> > 9xab_6OSIxhk6sCiqSFEwTUASBIaA_-C_wGiSMfJn3o&s=SJ9X7QVWrd1gCdyBsL9fdY841I4qG2y47VH3Sw-IRF4&e=
> >
> > Is your (other) kernel configured with CONFIG_DEVTMPFS=y?
>
> Indeed it is.
>
> The problem is devtmpfs is auto-mounted in prepare_namespace() which
> is not executed in case of initramfs because in case of initramfs we
> expect its "/init" will do everything itself, see [1].

Hi,
I jump in because I was at the same point years ago [1]: the issue
here is basically the linux-yocto specific patch adding the check for
console.
It was simply reverted in our case...

Cheers
Andrea

[1]
http://cgit.openembedded.org/meta-openembedded/commit/meta-initramfs/recipes-kernel?id=7183bacd5c866d433467a750e485e6c01af4aafc


>
> That said enabling CONFIG_DEVTMPFS_MOUNT doesn't help with initramfs too.
> So I don't see any other solution except disabling this check in case
> of enabled CONFIG_BLK_DEV_INITRD, see [2].
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/early-userspace/README#n140
> [2] https://lists.yoctoproject.org/pipermail/linux-yocto/2019-February/007552.html
>
> -Alexey
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: Always install initramfs-framework-base in case of linux-yocto & INITRAMFS_IMAGE_BUNDLE=1
  2019-02-07 14:25     ` Andrea Adami
@ 2019-02-08  6:41       ` Alexey Brodkin
  0 siblings, 0 replies; 5+ messages in thread
From: Alexey Brodkin @ 2019-02-08  6:41 UTC (permalink / raw)
  To: Andrea Adami; +Cc: Patches and discussions about the oe-core layer

Hi Andrea,

> -----Original Message-----
> From: Andrea Adami <andrea.adami@gmail.com>
> Sent: Thursday, February 7, 2019 5:26 PM
> To: Alexey Brodkin <alexey.brodkin@synopsys.com>
> Cc: Leon Woestenberg <leon@sidebranch.com>; Patches and discussions about the oe-core layer
> <openembedded-core@lists.openembedded.org>
> Subject: Re: [OE-core] Always install initramfs-framework-base in case of linux-yocto &
> INITRAMFS_IMAGE_BUNDLE=1
> 
> On Wed, Feb 6, 2019 at 4:54 PM Alexey Brodkin
> <alexey.brodkin@synopsys.com> wrote:
> >
> > Hi Leon,
> >
> > > -----Original Message-----
> > > From: Leon Woestenberg <leon@sidebranch.com>
> > > Sent: Friday, February 1, 2019 12:18 AM
> > > To: Alexey Brodkin <alexey.brodkin@synopsys.com>
> > > Cc: Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>
> > > Subject: Re: [OE-core] Always install initramfs-framework-base in case of linux-yocto &
> > > INITRAMFS_IMAGE_BUNDLE=1
> > >
> > > On Tue, Jan 29, 2019 at 9:01 PM Alexey Brodkin
> > > <alexey.brodkin@synopsys.com> wrote:
> > > > --------------------------->8----------------------
> > > > /dev/console is missing or not a character device!
> > > > Please ensure your rootfs is properly configured
> > > > --------------------------->8----------------------
> > >
> > > I thought /dev/console could also be created by the kernel itself onto
> > > a "temporary filesystem for device nodes" (DEVTMPFS).
> > > I am not sure, but here is a similar case:
> > > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.busybox.net_pipermail_buildroot_2015-
> > >
> 2DMarch_123309.html&d=DwIBaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=lqdeeSSEes0GFDDl656eViXO7breS55ytWkhpk5R81I&m=
> > > 9xab_6OSIxhk6sCiqSFEwTUASBIaA_-C_wGiSMfJn3o&s=SJ9X7QVWrd1gCdyBsL9fdY841I4qG2y47VH3Sw-IRF4&e=
> > >
> > > Is your (other) kernel configured with CONFIG_DEVTMPFS=y?
> >
> > Indeed it is.
> >
> > The problem is devtmpfs is auto-mounted in prepare_namespace() which
> > is not executed in case of initramfs because in case of initramfs we
> > expect its "/init" will do everything itself, see [1].
> 
> Hi,
> I jump in because I was at the same point years ago [1]: the issue
> here is basically the linux-yocto specific patch adding the check for
> console.
> It was simply reverted in our case...

See this is fixed in linux-yocto now by [1].

[1] http://git.yoctoproject.org/cgit.cgi/linux-yocto/commit/?id=11e0e616ed095bb8012e1b4a231254c9656a0193&h=master

-Alexey

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

end of thread, other threads:[~2019-02-08  6:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-29 20:00 Always install initramfs-framework-base in case of linux-yocto & INITRAMFS_IMAGE_BUNDLE=1 Alexey Brodkin
2019-01-31 21:17 ` Leon Woestenberg
2019-02-06 15:53   ` Alexey Brodkin
2019-02-07 14:25     ` Andrea Adami
2019-02-08  6:41       ` Alexey Brodkin

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.