Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device
@ 2012-01-03 10:13 y at mail.free-electrons.com
  2012-01-03 10:13 ` [Buildroot] [PATCH 1/3] Add support for package-declared devices y at mail.free-electrons.com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: y at mail.free-electrons.com @ 2012-01-03 10:13 UTC (permalink / raw)
  To: buildroot

From: Maxime Ripard <maxime.ripard@free-electrons.com>

Hi List,

Here is a new version of the patchset adding a bit of infrastructure to handle
per package device creation and permission modifications. Since v2, I dropped
the renaming of the device table, and splitted the $(PKG)_FILES into
$(PKG)_DEVICES for device files creation and $(PKG)_PERMISSIONS for permissions
modifications. The only difference between the two are while $(PKG)_PERMISSIONS
is always used, $(PKG)_DEVICES is only used when using a static /dev.


The following changes since commit 68902f743729b3482bb6bc2ae9d0306aa9c00f65:

  ti-utils: unbreak build after libnl version bump (2011-12-26 19:33:43 +0100)

are available in the git repository at:
  http://free-electrons.com/~maxime/git/buildroot.git for-2012.02/pkg-device

Maxime Ripard (3):
      Add support for package-declared devices
      Convert busybox to the device declaration method
      Migrate Xenomai to the new infrastructure

 fs/common.mk                        |    4 ++++
 package/Makefile.package.in         |    2 ++
 package/busybox/busybox.mk          |    5 +++++
 package/xenomai/xenomai.mk          |    8 ++++++--
 target/generic/device_table.txt     |    2 --
 target/generic/device_table_dev.txt |    5 -----
 6 files changed, 17 insertions(+), 9 deletions(-)

Thanks,
-- 
Maxime Ripard

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

* [Buildroot] [PATCH 1/3] Add support for package-declared devices
  2012-01-03 10:13 [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device y at mail.free-electrons.com
@ 2012-01-03 10:13 ` y at mail.free-electrons.com
  2012-01-03 10:13 ` [Buildroot] [PATCH 2/3] Convert busybox to the device declaration method y at mail.free-electrons.com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: y at mail.free-electrons.com @ 2012-01-03 10:13 UTC (permalink / raw)
  To: buildroot

From: Maxime Ripard <maxime.ripard@free-electrons.com>

Add a way for packages to declare files they need instead of relying
only on device tables, which creates files no matter if the package is
indeed enabled, as we can see for busybox.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 fs/common.mk                |    4 ++++
 package/Makefile.package.in |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/fs/common.mk b/fs/common.mk
index f793ff9..d426f37 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -50,6 +50,10 @@ $(BINARIES_DIR)/rootfs.$(1): $(ROOTFS_$(2)_DEPENDENCIES)
 	echo "chown -R 0:0 $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 ifneq ($(ROOTFS_DEVICE_TABLES),)
 	cat $(ROOTFS_DEVICE_TABLES) > $(FULL_DEVICE_TABLE)
+ifeq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
+	echo -e '$(subst $(sep),\n,$(PACKAGES_DEVICES_TABLE))' >> $(FULL_DEVICE_TABLE)
+endif
+	echo -e '$(subst $(sep),\n,$(PACKAGES_PERMISSIONS_TABLE))' >> $(FULL_DEVICE_TABLE)
 	echo "$(HOST_DIR)/usr/bin/makedevs -d $(FULL_DEVICE_TABLE) $(TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 endif
 	echo "$(ROOTFS_$(2)_CMD)" >> $(FAKEROOT_SCRIPT)
diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index e85eb15..24333f7 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -713,6 +713,8 @@ endif
 ifeq ($$($$($(2)_KCONFIG_VAR)),y)
 
 TARGETS += $(1)
+PACKAGES_PERMISSIONS_TABLE += $$($(2)_PERMISSIONS)$$(sep)
+PACKAGES_DEVICES_TABLE += $$($(2)_DEVICES)$$(sep)
 
 ifeq ($$($(2)_SITE_METHOD),svn)
 DL_TOOLS_DEPENDENCIES += svn
-- 
1.7.4.1

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

* [Buildroot] [PATCH 2/3] Convert busybox to the device declaration method
  2012-01-03 10:13 [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device y at mail.free-electrons.com
  2012-01-03 10:13 ` [Buildroot] [PATCH 1/3] Add support for package-declared devices y at mail.free-electrons.com
@ 2012-01-03 10:13 ` y at mail.free-electrons.com
  2012-01-03 10:13 ` [Buildroot] [PATCH 3/3] Migrate Xenomai to the new infrastructure y at mail.free-electrons.com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: y at mail.free-electrons.com @ 2012-01-03 10:13 UTC (permalink / raw)
  To: buildroot

From: Maxime Ripard <maxime.ripard@free-electrons.com>

Busybox used to declare and create files even if the package was not
enabled through the device table. Remove the entries for busybox in the
device table and move them to the package declaration.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 package/busybox/busybox.mk      |    5 +++++
 target/generic/device_table.txt |    2 --
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index d18b6d0..59448d5 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -28,6 +28,11 @@ ifndef BUSYBOX_CONFIG_FILE
 	BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG))
 endif
 
+define BUSYBOX_PERMISSIONS
+/bin/busybox			 f 4755	0 0 - - - - -
+/usr/share/udhcpc/default.script f 755  0 0 - - - - -
+endef
+
 # If mdev will be used for device creation enable it and copy S10mdev to /etc/init.d
 ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),y)
 define BUSYBOX_INSTALL_MDEV_SCRIPT
diff --git a/target/generic/device_table.txt b/target/generic/device_table.txt
index 12f35b2..d3e394b 100644
--- a/target/generic/device_table.txt
+++ b/target/generic/device_table.txt
@@ -10,13 +10,11 @@
 /tmp					d	1777	0	0	-	-	-	-	-
 /etc					d	755	0	0	-	-	-	-	-
 /home/default				d	2755	1000	1000	-	-	-	-	-
-/bin/busybox				f	4755	0	0	-	-	-	-	-
 /etc/shadow				f	600	0	0	-	-	-	-	-
 /etc/passwd				f	644	0	0	-	-	-	-	-
 /etc/network/if-up.d			d	755	0	0	-	-	-	-	-
 /etc/network/if-pre-up.d		d	755	0	0	-	-	-	-	-
 /etc/network/if-down.d			d	755	0	0	-	-	-	-	-
 /etc/network/if-post-down.d		d	755	0	0	-	-	-	-	-
-/usr/share/udhcpc/default.script	f	755	0	0	-	-	-	-	-
 # uncomment this to allow starting x as non-root
 #/usr/X11R6/bin/Xfbdev		     	f	4755	0	0	-	-	-	-	-
-- 
1.7.4.1

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

* [Buildroot] [PATCH 3/3] Migrate Xenomai to the new infrastructure
  2012-01-03 10:13 [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device y at mail.free-electrons.com
  2012-01-03 10:13 ` [Buildroot] [PATCH 1/3] Add support for package-declared devices y at mail.free-electrons.com
  2012-01-03 10:13 ` [Buildroot] [PATCH 2/3] Convert busybox to the device declaration method y at mail.free-electrons.com
@ 2012-01-03 10:13 ` y at mail.free-electrons.com
  2012-01-03 10:45 ` [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device Thomas De Schampheleire
  2012-01-03 20:14 ` Thomas Petazzoni
  4 siblings, 0 replies; 6+ messages in thread
From: y at mail.free-electrons.com @ 2012-01-03 10:13 UTC (permalink / raw)
  To: buildroot

From: Maxime Ripard <maxime.ripard@free-electrons.com>

Xenomai used to have commented out devices to be created in the device
table that the user had to uncomment. Use the new infrastructure to do
just that.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 package/xenomai/xenomai.mk          |    8 ++++++--
 target/generic/device_table_dev.txt |    5 -----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/package/xenomai/xenomai.mk b/package/xenomai/xenomai.mk
index f795579..02e5152 100644
--- a/package/xenomai/xenomai.mk
+++ b/package/xenomai/xenomai.mk
@@ -98,8 +98,12 @@ endef
 
 XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_SKINS
 
-# If you use static /dev creation don't forget to update your
-#  device_table_dev.txt
+define XENOMAI_DEVICES
+/dev/rtheap  c  666  0  0  10  254  0  0  -
+/dev/rtscope c  666  0  0  10  253  0  0  -
+/dev/rtp     c  666  0  0  150 0    0  1  32
+endef
+
 ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV),y)
 XENOMAI_DEPENDENCIES += udev
 
diff --git a/target/generic/device_table_dev.txt b/target/generic/device_table_dev.txt
index 71cd083..a3d53d4 100644
--- a/target/generic/device_table_dev.txt
+++ b/target/generic/device_table_dev.txt
@@ -141,8 +141,3 @@
 
 # I2C device nodes
 /dev/i2c-	c	666	0	0	89	0	0	1	4
-
-# Xenomai
-#/dev/rtheap     c       666     0       0       10      254     0       0       -
-#/dev/rtscope    c       666     0       0       10      253     0       0       -
-#/dev/rtp        c       666     0       0       150     0       0       1       32
-- 
1.7.4.1

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

* [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device
  2012-01-03 10:13 [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device y at mail.free-electrons.com
                   ` (2 preceding siblings ...)
  2012-01-03 10:13 ` [Buildroot] [PATCH 3/3] Migrate Xenomai to the new infrastructure y at mail.free-electrons.com
@ 2012-01-03 10:45 ` Thomas De Schampheleire
  2012-01-03 20:14 ` Thomas Petazzoni
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas De Schampheleire @ 2012-01-03 10:45 UTC (permalink / raw)
  To: buildroot

On Tue, Jan 3, 2012 at 11:13 AM, <y@mail.free-electrons.com> wrote:

> From: Maxime Ripard <maxime.ripard@free-electrons.com>
>
> Hi List,
>
> Here is a new version of the patchset adding a bit of infrastructure to
> handle
> per package device creation and permission modifications. Since v2, I
> dropped
> the renaming of the device table, and splitted the $(PKG)_FILES into
> $(PKG)_DEVICES for device files creation and $(PKG)_PERMISSIONS for
> permissions
> modifications. The only difference between the two are while
> $(PKG)_PERMISSIONS
> is always used, $(PKG)_DEVICES is only used when using a static /dev.
>
>
> The following changes since commit
> 68902f743729b3482bb6bc2ae9d0306aa9c00f65:
>
>  ti-utils: unbreak build after libnl version bump (2011-12-26 19:33:43
> +0100)
>
> are available in the git repository at:
>  http://free-electrons.com/~maxime/git/buildroot.gitfor-2012.02/pkg-device
>
> Maxime Ripard (3):
>      Add support for package-declared devices
>      Convert busybox to the device declaration method
>      Migrate Xenomai to the new infrastructure
>
>  fs/common.mk                        |    4 ++++
>  package/Makefile.package.in         |    2 ++
>  package/busybox/busybox.mk          |    5 +++++
>  package/xenomai/xenomai.mk          |    8 ++++++--
>  target/generic/device_table.txt     |    2 --
>  target/generic/device_table_dev.txt |    5 -----
>  6 files changed, 17 insertions(+), 9 deletions(-)
>

for the entire series:
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

It would be good to update the documentation as well, though...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120103/be948abb/attachment.html>

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

* [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device
  2012-01-03 10:13 [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device y at mail.free-electrons.com
                   ` (3 preceding siblings ...)
  2012-01-03 10:45 ` [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device Thomas De Schampheleire
@ 2012-01-03 20:14 ` Thomas Petazzoni
  4 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2012-01-03 20:14 UTC (permalink / raw)
  To: buildroot

Le Tue,  3 Jan 2012 11:13:55 +0100,
y at mail.free-electrons.com a ?crit :

> are available in the git repository at:
>   http://free-electrons.com/~maxime/git/buildroot.git for-2012.02/pkg-device
> 
> Maxime Ripard (3):
>       Add support for package-declared devices
>       Convert busybox to the device declaration method
>       Migrate Xenomai to the new infrastructure
> 
>  fs/common.mk                        |    4 ++++
>  package/Makefile.package.in         |    2 ++
>  package/busybox/busybox.mk          |    5 +++++
>  package/xenomai/xenomai.mk          |    8 ++++++--
>  target/generic/device_table.txt     |    2 --
>  target/generic/device_table_dev.txt |    5 -----
>  6 files changed, 17 insertions(+), 9 deletions(-)

I haven't actually tested those patches, but I'm ok with the principle
and its implementation.

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-- 
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] 6+ messages in thread

end of thread, other threads:[~2012-01-03 20:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-03 10:13 [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device y at mail.free-electrons.com
2012-01-03 10:13 ` [Buildroot] [PATCH 1/3] Add support for package-declared devices y at mail.free-electrons.com
2012-01-03 10:13 ` [Buildroot] [PATCH 2/3] Convert busybox to the device declaration method y at mail.free-electrons.com
2012-01-03 10:13 ` [Buildroot] [PATCH 3/3] Migrate Xenomai to the new infrastructure y at mail.free-electrons.com
2012-01-03 10:45 ` [Buildroot] [pull request v3] Pull request for branch for-2012.02/pkg-device Thomas De Schampheleire
2012-01-03 20:14 ` Thomas Petazzoni

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