All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Stefan Fröberg" <stefan.froberg@petroprogram.com>
To: buildroot@busybox.net
Subject: [Buildroot] Udev on a live CD system does not appear to populate /dev
Date: Tue, 06 Nov 2012 20:37:13 +0200	[thread overview]
Message-ID: <509958D9.7050108@petroprogram.com> (raw)
In-Reply-To: <5099186E.1030409@macrium.com>

6.11.2012 16:02, Antony Vennard kirjoitti:
> 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
>
> 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. Yet, my
> buildroot/output/target contains a dev folder with subdirectories
> created by buildroot.
>
> So, I tried both creating the entries with target/generic_device_table
> for tty0, tty1, console, null. This works, 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.
>
> 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
Im not sure but I tought that device nodes /dev/null and /dev/console
(and some others)
have to always be created manually
(either with buildroot device tables, by doing the mknod thing or just
by copying those
nodes from host system to output/target/dev or fs/skeleton/dev)
to be of any use.

At least that's what I have done always, created those /dev/null and
/dev/cosole and also
/dev/ram0 etc.. myself into output/target/dev and then make my initramfs
from that directory and
 let the hotplug program (either busybox's own mdev or udev) do the rest.

Here's what I have minimally in my own buildroot's fs/skeleton/dev
folder (which is copied at the end of the buildroot
process into output/target/dev )

crw-------.  1 root root 5, 1 11.1.2012 console
lrwxrwxrwx.  1 root root   10 19.3.2012 log -> ../tmp/log
brw-rw----.  1 root root 7, 0 20.8. 00:58 loop0
crw-------.  1 root root 1, 1 11.1.2012 mem
crw-r--r--.  1 root root 1, 3 12.1.2012 null
drwxr-xr-x.  2 root root 1024 12.1.2012 pts
brw-r-----.  1 root root 5, 0 12.1.2012 ram0
crw-r--r--.  1 root root 5, 0 12.1.2012 tty
crw-------.  1 root root 4, 0 11.1.2012 tty0
crw-------.  1 root root 4, 1 11.1.2012 tty1
crw-------.  1 root root 1, 5 11.1.2012 zero

Now, some of those might not be strictly necessary and should be created
by mdev/udev.
But it's good to have them just in case.

Besides some pre-made device nodes, make sure that you have S10udev in your
output/target/etc/init.d.
That is the one responsible of starting udev.

You can also copy S10udev to fs/skeleton/etc/init.d to make sure that
it's included in
output/target/etc/init.d everytime you make complete new rebuild
(make clean && make)


Im presuming you *are* using initramfs in your early device initialization ?
(if not then you absolutely should. Live CD without initramfs is useless)

Best regards
Stefan
> Various possibly related points:
>  * I thought udev required udevd, yet I can't see that either running or
> available on the ISO, nor can I find a configuration option to create it.
>  * I have D-Bus built for the system, as I read udev required it.
>  * I can see sda1 in /sys/block/sda/sda1; likewise for other attached
> storage devices.
>
> Am I doing anything very wrong? I get the feeling I must be missing
> something for this to not work, yet I'm not sure what.
>
> Can anyone offer any advice? Happy to provide config snippets etc.
>
> Using buildroot 2012.08.
>
> Thanks,
>
> Antony
>
>
>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121106/3d142432/attachment.html>

  reply	other threads:[~2012-11-06 18:37 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 [this message]
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

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=509958D9.7050108@petroprogram.com \
    --to=stefan.froberg@petroprogram.com \
    --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 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.