From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/3] Create menu entry to select device creation method
Date: Sun, 3 Apr 2011 12:18:29 +0200 [thread overview]
Message-ID: <20110403121829.5a46d779@surf> (raw)
In-Reply-To: <201104021921.50612.yann.morin.1998@anciens.enib.fr>
Hello,
On Sat, 2 Apr 2011 19:21:50 +0200
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> wrote:
> > +ifneq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
> ^^^^^^
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS,$(@D)/.config)
> > + $(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS_MOUNT,$(@D)/.config)
> > +endif
>
> This should be BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS, no?
This is what I originally implemented, but I was told that using
devtmpfs was easier even in the udev/mdev cases for the early boot part
(i.e before udev/mdev are working).
See
http://lists.busybox.net/pipermail/buildroot/2010-December/039886.html
for Peter's comment on the matter.
> > +ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),y)
> > + $(call KCONFIG_SET_OPT,CONFIG_UEVENT_HELPER_PATH,\"/sbin/mdev\",$(@D)/.config)
> > +endif
>
> As I suggest below, I'd move that into the startup script.
Hmm, why not.
> > $(TARGET_MAKE_ENV) $(MAKE) $(LINUX26_MAKE_FLAGS) -C $(@D) oldconfig
> > $(Q)touch $@
> >
> > diff --git a/package/busybox/S10mdev b/package/busybox/S10mdev
> > new file mode 100644
> > index 0000000..472810b
> > --- /dev/null
> > +++ b/package/busybox/S10mdev
> > @@ -0,0 +1,22 @@
> > +#!/bin/sh
> > +#
> > +# Start mdev....
> > +#
> > +
> > +case "$1" in
> > + start)
> > + echo "Starting mdev..."
> > + /sbin/mdev -s
>
> >From busybox/docs/mdev.txt:
>
> Here's a typical code snippet from the init script:
> [0] mount -t proc proc /proc
> [1] mount -t sysfs sysfs /sys
> [2] echo /sbin/mdev > /proc/sys/kernel/hotplug
> [3] mdev -s
>
> I see that [2] is done in the kernel's .config. I find it non-obvious,
> and I would move that to the script above. It makes it easier to
> follow.
I guess that's a matter of taste. I have no strong opinion here.
> Also, I did not see where /dev is mounted (as a tmpfs). If / is a RO file
> system, then you can't use dynamic nodes, or you need a RW file system on
> /dev.
/dev is a devtmpfs filesystem, thanks to the kernel options that you
highlighted above, and it is mounted automatically by the kernel thanks
to the CONFIG_DEVTMPFS_MOUNT option.
> > + ;;
> > + stop)
>
> For completeness:
> echo "/bin/true" > /proc/sys/kernel/hotplug
> killall mdev
> sleep 2 # Leave it some time to proerly quit (adjust delay)
> killall -9 mdev
mdev is not a daemon (contrary to udev), so there's no point in killing
it. It's a utility that the kernel runs where there are events to
handle.
So I don't think there's a lot of point in having the stop), restart)
and reload) commands for mdev.
Regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2011-04-03 10:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-02 16:53 [Buildroot] [pull request] Pull request for branch for-2011.05/dev-handling Thomas Petazzoni
2011-04-02 16:53 ` [Buildroot] [PATCH 1/3] Create menu entry to select device creation method Thomas Petazzoni
2011-04-02 17:21 ` Yann E. MORIN
2011-04-03 10:18 ` Thomas Petazzoni [this message]
2011-04-03 18:05 ` Yann E. MORIN
2011-04-03 18:07 ` Yann E. MORIN
2011-04-02 16:53 ` [Buildroot] [PATCH 2/3] Simplify udev startup script Thomas Petazzoni
2011-04-02 16:53 ` [Buildroot] [PATCH 3/3] Allow several device tables and split in two parts our device table Thomas Petazzoni
2011-04-02 17:31 ` Yann E. MORIN
2011-04-03 18:22 ` Thomas De Schampheleire
-- strict thread matches above, loose matches on Subject: below --
2011-03-07 21:21 [Buildroot] [pull request] Pull request for branch for-2011.05/dev-handling Thomas Petazzoni
2011-03-07 21:21 ` [Buildroot] [PATCH 1/3] Create menu entry to select device creation method Thomas Petazzoni
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=20110403121829.5a46d779@surf \
--to=thomas.petazzoni@free-electrons.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox