Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Regarding /dev management
@ 2013-03-09 12:26 Ezequiel Garcia
  2013-03-09 14:09 ` Peter Korsgaard
  2013-03-09 14:12 ` Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Ezequiel Garcia @ 2013-03-09 12:26 UTC (permalink / raw)
  To: buildroot

Hi everyone,

Yesterday I spent a couple hours trying to build my first buildroot fs.
In particular, I wanted to use devtmpfs
(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS)
but found that /dev is not mounted by default in skeleton fs scripts,
it should be mounted in inittab before some other things.

After some hacking in skeleton files, I managed to get the thing working.

Did I miss something? Is this the expected behavior?

Notice that I'm using the cpio image output and using the rootfs as in
initramfs.
In this case, CONFIG_DEVTMPFS=y and CONFIG_DEVTMPFS_MOUNT=y
kernel options do not matter, because... (quoting Kconfig)

""This will instruct the kernel to automatically mount the
devtmpfs filesystem at /dev, directly after the kernel has
mounted the root filesystem. The behavior can be overridden
with the commandline parameter: devtmpfs.mount=0|1.

This option does not affect initramfs based booting, here
the devtmpfs filesystem always needs to be mounted manually
after the roots is mounted.""

Perhaps we can add some hack to add:

::sysinit:/bin/mount -t devtmpfs devtmpfs /dev

to skeleton when BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS=y.

However, being new to buildroot, perhaps I'm speaking non-sense and the
developer is expected to use its own custom skeleton in this case.

Thanks,
-- 
    Ezequiel

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

* [Buildroot] Regarding /dev management
  2013-03-09 12:26 [Buildroot] Regarding /dev management Ezequiel Garcia
@ 2013-03-09 14:09 ` Peter Korsgaard
  2013-03-09 15:02   ` Ezequiel Garcia
  2013-03-09 14:12 ` Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2013-03-09 14:09 UTC (permalink / raw)
  To: buildroot

>>>>> "E" == Ezequiel Garcia <elezegarcia@gmail.com> writes:

 E> Hi everyone,
 E> Yesterday I spent a couple hours trying to build my first buildroot fs.
 E> In particular, I wanted to use devtmpfs
 E> (BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS)
 E> but found that /dev is not mounted by default in skeleton fs scripts,
 E> it should be mounted in inittab before some other things.

 E> After some hacking in skeleton files, I managed to get the thing working.

 E> Did I miss something? Is this the expected behavior?

 E> Notice that I'm using the cpio image output and using the rootfs as in
 E> initramfs.
 E> In this case, CONFIG_DEVTMPFS=y and CONFIG_DEVTMPFS_MOUNT=y
 E> kernel options do not matter, because... (quoting Kconfig)

 E> ""This will instruct the kernel to automatically mount the
 E> devtmpfs filesystem at /dev, directly after the kernel has
 E> mounted the root filesystem. The behavior can be overridden
 E> with the commandline parameter: devtmpfs.mount=0|1.

 E> This option does not affect initramfs based booting, here
 E> the devtmpfs filesystem always needs to be mounted manually
 E> after the roots is mounted.""

Indeed, for everything besides initramfs CONFIG_DEVTMPFS_MOUNT does the
right thing, and we don't need to do anything in userspace.

 E> Perhaps we can add some hack to add:

 E> ::sysinit:/bin/mount -t devtmpfs devtmpfs /dev

 E> to skeleton when BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS=y.

 E> However, being new to buildroot, perhaps I'm speaking non-sense and the
 E> developer is expected to use its own custom skeleton in this case.

We already take care of this for initramfs, see fs/cpio/init and the
ROOTFS_CPIO_ADD_INIT rule. Doesn't that work for you?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] Regarding /dev management
  2013-03-09 12:26 [Buildroot] Regarding /dev management Ezequiel Garcia
  2013-03-09 14:09 ` Peter Korsgaard
@ 2013-03-09 14:12 ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2013-03-09 14:12 UTC (permalink / raw)
  To: buildroot

Dear Ezequiel Garcia,

On Sat, 9 Mar 2013 09:26:36 -0300, Ezequiel Garcia wrote:

> Yesterday I spent a couple hours trying to build my first buildroot fs.
> In particular, I wanted to use devtmpfs
> (BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS)
> but found that /dev is not mounted by default in skeleton fs scripts,
> it should be mounted in inittab before some other things.
> 
> After some hacking in skeleton files, I managed to get the thing working.
> 
> Did I miss something? Is this the expected behavior?
> 
> Notice that I'm using the cpio image output and using the rootfs as in
> initramfs.
> In this case, CONFIG_DEVTMPFS=y and CONFIG_DEVTMPFS_MOUNT=y
> kernel options do not matter, because... (quoting Kconfig)
> 
> ""This will instruct the kernel to automatically mount the
> devtmpfs filesystem at /dev, directly after the kernel has
> mounted the root filesystem. The behavior can be overridden
> with the commandline parameter: devtmpfs.mount=0|1.
> 
> This option does not affect initramfs based booting, here
> the devtmpfs filesystem always needs to be mounted manually
> after the roots is mounted.""
> 
> Perhaps we can add some hack to add:
> 
> ::sysinit:/bin/mount -t devtmpfs devtmpfs /dev
> 
> to skeleton when BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS=y.
> 
> However, being new to buildroot, perhaps I'm speaking non-sense and the
> developer is expected to use its own custom skeleton in this case.

This problem of devtmpfs not being mounted by the kernel when booting
inside an initramfs is handled by a special init script, fs/cpio/init,
which gets automatically installed as /init in your root filesystem is
you use BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS. See the code in
fs/cpio/cpio.mk and fs/cpio/init.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] Regarding /dev management
  2013-03-09 14:09 ` Peter Korsgaard
@ 2013-03-09 15:02   ` Ezequiel Garcia
  2013-03-09 16:01     ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Ezequiel Garcia @ 2013-03-09 15:02 UTC (permalink / raw)
  To: buildroot

Hi Peter,

Thanks for your reply.

On Sat, Mar 9, 2013 at 11:09 AM, Peter Korsgaard <jacmet@uclibc.org> wrote:
>
>  E> However, being new to buildroot, perhaps I'm speaking non-sense and the
>  E> developer is expected to use its own custom skeleton in this case.
>
> We already take care of this for initramfs, see fs/cpio/init and the
> ROOTFS_CPIO_ADD_INIT rule. Doesn't that work for you?
>

Ah, I see. Yes that works for me. I was using "rdinit=/linuxrc" in my
kernel parameters. Removing that, and now it works fine! Thanks a lot!

Another question:
Isn't any configuration option to add a debugfs mount to fstab?

-- 
    Ezequiel

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

* [Buildroot] Regarding /dev management
  2013-03-09 15:02   ` Ezequiel Garcia
@ 2013-03-09 16:01     ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2013-03-09 16:01 UTC (permalink / raw)
  To: buildroot

Dear Ezequiel Garcia,

On Sat, 9 Mar 2013 12:02:05 -0300, Ezequiel Garcia wrote:

> Another question:
> Isn't any configuration option to add a debugfs mount to fstab?

No, that's really a specific customization for which the recommendation
is to use a post-build script.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

end of thread, other threads:[~2013-03-09 16:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-09 12:26 [Buildroot] Regarding /dev management Ezequiel Garcia
2013-03-09 14:09 ` Peter Korsgaard
2013-03-09 15:02   ` Ezequiel Garcia
2013-03-09 16:01     ` Thomas Petazzoni
2013-03-09 14:12 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox