Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] Udev on a live CD system does not appear to populate /dev
Date: Wed, 07 Nov 2012 00:26:58 +0100	[thread overview]
Message-ID: <50999CC2.1090504@mind.be> (raw)
In-Reply-To: <5099186E.1030409@macrium.com>

On 06/11/12 15:02, Antony Vennard wrote:
> Hi All,
>
> I'm currently looking at using udev for a live cd environment built with
> buildroot, and I'm having trouble getting udev to pick up the machine's
> devices.
>
> I have some questions and some details that will (hopefully) help
> identify my problem

  It would help if you can do 'make savedefconfig' and post the
resulting defconfig file.

>
> Firstly, my kernel is configured to use devtmpfs:
>
> 681:CONFIG_DEVTMPFS=y
> 682:CONFIG_DEVTMPFS_MOUNT=y
>
> so as I understand it, /dev should be mounted as a tmpfs by the kernel
> and populated with /dev/null, /dev/console etc.

  Since you're making a live CD, you'll probably boot with an
initrd/initramfs.  The kernel then doesn't mount /dev automatically,
it has to be done by init script in /init (which is called instead of
/sbin/init for an initramfs).  Buildroot creates this script for you
when you build a cpio or initramfs filesystem (i.e. the things that are
typically used as initrd image).  If you're trying to use an ext2 as
an initrd (which is a bad idea), you have to copy fs/cpio/init to the
target yourself.

> Yet, my
> buildroot/output/target contains a dev folder with subdirectories
> created by buildroot.

  Yes, that's a bit silly.  It doesn't really matter, because the devtmpfs
gets mounted over it and those files are no longer visible.

  If you have an initrd/initramfs, /dev/console should ideally be there,
otherwise you get the message 'Failed to open an initial console'.  That
message is harmless though because the /init script mounts /dev, which
implicitly creates /dev/console, and when /sbin/init is execed it can use
this /dev/console.

> So, I tried both creating the entries with target/generic_device_table
> for tty0, tty1, console, null. This works,

  Yep, this sounds like you're missing a /init.

> and udev reports it is scanning for devices and done,
> yet /dev never picks up e.g. /dev/sda, or
> /dev/disk/..., or so on. I have, in this configuration, copied
> /usr/lib/udev/rules.d/* to buildroot/output/target/etc/udev/rules.d to
> no avail; as far as I can see whatever rules I supply, even from my
> Fedora or Ubuntu distributions, do not seem to affect udev.

  Note that udev doesn't create anything in /dev - it relies on the kernel
to create the device nodes. udev only does renaming, chmodding, chowning
and making symlinks.

>
> Wondering if this creation method was wrong, I have then removed all of
> the entries in /dev so that the kernel can mount its own devtmpfs. When
> booting, /dev/null and /dev/tty1 are reported as missing. I imagine
> there is nothing in /dev at this stage

  This is weird.  If there's no /dev/console, how can init report that
/dev/tty1 is missing?

[snip]

  Regards,
  Arnout
-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

      parent reply	other threads:[~2012-11-06 23:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-06 14:02 [Buildroot] Udev on a live CD system does not appear to populate /dev Antony Vennard
2012-11-06 18:37 ` Stefan Fröberg
2012-11-06 23:46   ` Arnout Vandecappelle
2012-11-07 17:56     ` Stefan Fröberg
2012-11-08  9:56       ` Antony Vennard
2012-11-08 12:35         ` Stefan Fröberg
2012-11-08 16:02           ` Antony Vennard
2012-11-08 16:20             ` Stefan Fröberg
2012-11-08 16:29             ` Stefan Fröberg
2012-11-13  6:53               ` Arnout Vandecappelle
2012-11-13 18:07                 ` Stefan Fröberg
2012-11-17 22:54                 ` Stefan Fröberg
2012-11-18 20:02                   ` Arnout Vandecappelle
2012-11-18 20:11                     ` Stefan Fröberg
2012-11-20 23:42                       ` Stefan Fröberg
2012-11-08 21:17             ` Arnout Vandecappelle
2012-11-09 12:20               ` Antony Vennard
2012-11-09 13:01                 ` Arnout Vandecappelle
2012-11-09 13:09                   ` Antony Vennard
2012-11-09 15:04                     ` Arnout Vandecappelle
2012-11-09 13:11                 ` Stefan Fröberg
2012-11-08 15:12         ` Arnout Vandecappelle
2012-11-08 21:09       ` Arnout Vandecappelle
2012-11-06 23:26 ` Arnout Vandecappelle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50999CC2.1090504@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox