Pull request for branch for-2012.02/pkg-device
From: Maxime Ripard <[email protected]>
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,
Signature · 1 line
Maxime Ripard
PATCH 1/3 Add support for package-declared devices
From: Maxime Ripard <[email protected]>
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.
--- fs/common.mk | 4 ++++ package/Makefile.package.in | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-)
fs/common.mk +4 -0
@@ -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)
package/Makefile.package.in +2 -0
@@ -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
Signature · 1 line
1.7.4.1
PATCH 2/3 Convert busybox to the device declaration method
In reply to y at mail.free-electrons.comFrom: Maxime Ripard <[email protected]>
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.
--- package/busybox/busybox.mk | 5 +++++ target/generic/device_table.txt | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-)
package/busybox/busybox.mk +5 -0
@@ -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
target/generic/device_table.txt +0 -2
@@ -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 - - - - -
Signature · 1 line
1.7.4.1
PATCH 3/3 Migrate Xenomai to the new infrastructure
In reply to y at mail.free-electrons.comFrom: Maxime Ripard <[email protected]>
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.
--- package/xenomai/xenomai.mk | 8 ++++++-- target/generic/device_table_dev.txt | 5 ----- 2 files changed, 6 insertions(+), 7 deletions(-)
package/xenomai/xenomai.mk +6 -2
@@ -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
target/generic/device_table_dev.txt +0 -5
@@ -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
Signature · 1 line
1.7.4.1
Thomas De Schampheleire
Acked-byQuoted 30 lines · On Tue, Jan 3, 2012 at 11:13 AM, <[email protected]> wrote:
From: Maxime Ripard <[email protected]>
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-deviceMaxime Ripard (3):
Add support for package-declared devices Convert busybox to the device declaration method Migrate Xenomai to the new infrastructure
Quoted 8 lines
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:
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>
Thomas Petazzoni
Acked-byLe Tue, 3 Jan 2012 11:13:55 +0100,
y at mail.free-electrons.com a ?crit :
Quoted 8 lines
are available in the git repository at:
http://free-electrons.com/~maxime/git/buildroot.git for-2012.02/pkg-deviceMaxime Ripard (3):
Add support for package-declared devices Convert busybox to the device declaration method Migrate Xenomai to the new infrastructure
Quoted 7 lines
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.
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com