Patchwork [v3] fs/common: Create initial console device

login
register
mail settings
Submitter Markos Chandras
Date Nov. 5, 2012, 9:44 a.m.
Message ID <1352108694-11875-1-git-send-email-markos.chandras@gmail.com>
Download mbox | patch
Permalink /patch/197173/
State Accepted
Commit e1ebae700ace80ded99e1a977e28375dc4f7255d
Headers show

Comments

Markos Chandras - Nov. 5, 2012, 9:44 a.m.
From: Markos Chandras <markos.chandras@imgtec.com>

A /dev/console node must be present in rootfs when the Linux kernel
boots otherwise the kernel will print the following warning:
"Warning: unable to open an initial console"

This is because when we use an initramfs the /dev directory is not
populated at this point. This can cause problems when a program
(e.g ldso with early debugging enabled) opens a standard file
descriptor for read/write before these descriptors are actually
created by the init process later on.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 fs/cpio/cpio.mk |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Arnout Vandecappelle - Nov. 10, 2012, 2:26 a.m.
On 11/05/12 10:44, Markos Chandras wrote:
> From: Markos Chandras<markos.chandras@imgtec.com>
>
> A /dev/console node must be present in rootfs when the Linux kernel
> boots otherwise the kernel will print the following warning:
> "Warning: unable to open an initial console"
>
> This is because when we use an initramfs the /dev directory is not
> populated at this point. This can cause problems when a program
> (e.g ldso with early debugging enabled) opens a standard file
> descriptor for read/write before these descriptors are actually
> created by the init process later on.
>
> Signed-off-by: Markos Chandras<markos.chandras@imgtec.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

  Regards,
  Arnout
Markos Chandras - Nov. 21, 2012, 10:19 a.m.
On Sat, Nov 10, 2012 at 2:26 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 11/05/12 10:44, Markos Chandras wrote:
>>
>> From: Markos Chandras<markos.chandras@imgtec.com>
>>
>> A /dev/console node must be present in rootfs when the Linux kernel
>> boots otherwise the kernel will print the following warning:
>> "Warning: unable to open an initial console"
>>
>> This is because when we use an initramfs the /dev directory is not
>> populated at this point. This can cause problems when a program
>> (e.g ldso with early debugging enabled) opens a standard file
>> descriptor for read/write before these descriptors are actually
>> created by the init process later on.
>>
>> Signed-off-by: Markos Chandras<markos.chandras@imgtec.com>
>
>
> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>
>  Regards,
>  Arnout
>
Hi Arnout,

Thanks. Lets see if this will make it to the final release as this
warning is a bit annoying :)
Peter Korsgaard - Nov. 21, 2012, 10:32 a.m.
>>>>> "Markos" == Markos Chandras <markos.chandras@gmail.com> writes:

 >> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 >> Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 >> 
 >> Regards,
 >> Arnout
 >> 
 Markos> Hi Arnout,

 Markos> Thanks. Lets see if this will make it to the final release as this
 Markos> warning is a bit annoying :)

Committed, thanks.

Patch

diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk
index aa20b41..5533322 100644
--- a/fs/cpio/cpio.mk
+++ b/fs/cpio/cpio.mk
@@ -21,6 +21,8 @@  define ROOTFS_CPIO_ADD_INIT
         fi
 endef
 
+PACKAGES_PERMISSIONS_TABLE += /dev/console c 622 0 0 5 1 - - -$(sep)
+
 endif # BR2_ROOTFS_DEVICE_CREATION_STATIC
 
 ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_ADD_INIT