All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [pull request] Pull request for branch for-2011.11/pkg-device
@ 2011-09-02 12:08 Maxime Ripard
  2011-09-02 12:08 ` [Buildroot] [PATCH 1/2] Add support for package-declared devices Maxime Ripard
  2011-09-02 12:09 ` [Buildroot] [PATCH 2/2] Convert busybox to the device declaration method Maxime Ripard
  0 siblings, 2 replies; 16+ messages in thread
From: Maxime Ripard @ 2011-09-02 12:08 UTC (permalink / raw)
  To: buildroot

Hello,

Here is a minor set of improvement on how the devices are
declared in buildroot. For now, All the devices to be created
were in two files generic to every compilation. This was fine
for most usage, but was a bit problematic when packages needed
to create files or use specific permissions.

This set of patches are addressing this issue by creating a
new $(PKG)_DEVICES variable, containing the package specific
devices, using the makedevs syntax.

The following changes since commit facd602dcad54df769ac759886f48f248b61e692:

  Update for 2011.08 (2011-08-31 13:44:55 +0200)

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

Maxime Ripard (2):
      Add support for package-declared devices
      Convert busybox to the device declaration method

 Makefile                        |    4 ++++
 fs/common.mk                    |    1 +
 package/Makefile.package.in     |    1 +
 package/busybox/busybox.mk      |    5 +++++
 target/generic/device_table.txt |    2 --
 5 files changed, 11 insertions(+), 2 deletions(-)

Thanks,
-- 
Maxime Ripard

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-02 12:08 [Buildroot] [pull request] Pull request for branch for-2011.11/pkg-device Maxime Ripard
@ 2011-09-02 12:08 ` Maxime Ripard
  2011-09-04 21:36   ` Arnout Vandecappelle
  2011-09-02 12:09 ` [Buildroot] [PATCH 2/2] Convert busybox to the device declaration method Maxime Ripard
  1 sibling, 1 reply; 16+ messages in thread
From: Maxime Ripard @ 2011-09-02 12:08 UTC (permalink / raw)
  To: buildroot

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>
---
 Makefile                    |    4 ++++
 fs/common.mk                |    1 +
 package/Makefile.package.in |    1 +
 3 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 9ed46fc..b293d2f 100644
--- a/Makefile
+++ b/Makefile
@@ -52,6 +52,10 @@ qstrip=$(strip $(subst ",,$(1)))
 comma:=,
 empty:=
 space:=$(empty) $(empty)
+define newline
+
+
+endef
 
 ifneq ("$(origin O)", "command line")
 O:=output
diff --git a/fs/common.mk b/fs/common.mk
index f793ff9..46d191b 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -50,6 +50,7 @@ $(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)
+	echo -e '$(subst $(newline),\n,$(PACKAGES_DEVICE_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 868bf28..d8d435e 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -541,6 +541,7 @@ endif
 ifeq ($$($$($(2)_KCONFIG_VAR)),y)
 
 TARGETS += $(1)
+PACKAGES_DEVICE_TABLE += $$($(2)_DEVICES)$$(newline)
 
 ifeq ($$($(2)_SITE_METHOD),svn)
 DL_TOOLS_DEPENDENCIES += svn
-- 
1.7.4.1

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

* [Buildroot] [PATCH 2/2] Convert busybox to the device declaration method
  2011-09-02 12:08 [Buildroot] [pull request] Pull request for branch for-2011.11/pkg-device Maxime Ripard
  2011-09-02 12:08 ` [Buildroot] [PATCH 1/2] Add support for package-declared devices Maxime Ripard
@ 2011-09-02 12:09 ` Maxime Ripard
  1 sibling, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2011-09-02 12:09 UTC (permalink / raw)
  To: buildroot

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 1782a73..719f679 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_DEVICES
+/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] 16+ messages in thread

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-02 12:08 ` [Buildroot] [PATCH 1/2] Add support for package-declared devices Maxime Ripard
@ 2011-09-04 21:36   ` Arnout Vandecappelle
  2011-09-05  6:52     ` Thomas Petazzoni
                       ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Arnout Vandecappelle @ 2011-09-04 21:36 UTC (permalink / raw)
  To: buildroot


On Friday 02 September 2011 14:08:59, Maxime Ripard wrote:
> 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.

 Good idea!  This will also make it possible to create setuid executables.

> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  Makefile                    |    4 ++++
>  fs/common.mk                |    1 +
>  package/Makefile.package.in |    1 +
>  3 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 9ed46fc..b293d2f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -52,6 +52,10 @@ qstrip=$(strip $(subst ",,$(1)))
>  comma:=,
>  empty:=
>  space:=$(empty) $(empty)
> +define newline
> +
> +
> +endef
> 
>  ifneq ("$(origin O)", "command line")
>  O:=output
> diff --git a/fs/common.mk b/fs/common.mk
> index f793ff9..46d191b 100644
> --- a/fs/common.mk
> +++ b/fs/common.mk
> @@ -50,6 +50,7 @@ $(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)
> +	echo -e '$(subst $(newline),\n,$(PACKAGES_DEVICE_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 868bf28..d8d435e 100644
> --- a/package/Makefile.package.in
> +++ b/package/Makefile.package.in
> @@ -541,6 +541,7 @@ endif
>  ifeq ($$($$($(2)_KCONFIG_VAR)),y)
> 
>  TARGETS += $(1)
> +PACKAGES_DEVICE_TABLE += $$($(2)_DEVICES)$$(newline)

 Since it anyway will be echo -e'd, why not just use the following?

+PACKAGES_DEVICE_TABLE += \n$$($(2)_DEVICES)

(I haven't tried it, but I expect the terminating space and the initial empty 
line are not a problem.)


 Regards,
 Arnout


> 
>  ifeq ($$($(2)_SITE_METHOD),svn)
>  DL_TOOLS_DEPENDENCIES += svn

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-04 21:36   ` Arnout Vandecappelle
@ 2011-09-05  6:52     ` Thomas Petazzoni
  2011-09-05 16:15       ` Maxime Ripard
  2011-09-05  9:11     ` Maxime Ripard
  2011-09-05 10:08     ` Michael S. Zick
  2 siblings, 1 reply; 16+ messages in thread
From: Thomas Petazzoni @ 2011-09-05  6:52 UTC (permalink / raw)
  To: buildroot

Hello,

Le Sun, 4 Sep 2011 23:36:43 +0200,
Arnout Vandecappelle <arnout@mind.be> a ?crit :

>  Good idea!  This will also make it possible to create setuid
> executables.

Yes, exactly. However, I don't really like the name <pkg>_DEVICE_TABLE
because, it might be for other purposes as well (setting setuid bit,
giving specific owner/group or permissions, etc.). Does anyone has an
idea for a better name?

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] 16+ messages in thread

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-04 21:36   ` Arnout Vandecappelle
  2011-09-05  6:52     ` Thomas Petazzoni
@ 2011-09-05  9:11     ` Maxime Ripard
  2011-09-05 10:08     ` Michael S. Zick
  2 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2011-09-05  9:11 UTC (permalink / raw)
  To: buildroot

On 04/09/2011 23:36, Arnout Vandecappelle wrote:
> On Friday 02 September 2011 14:08:59, Maxime Ripard wrote:
>> 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.
> 
>  Good idea!  This will also make it possible to create setuid executables.
> 
>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>> ---
>>  Makefile                    |    4 ++++
>>  fs/common.mk                |    1 +
>>  package/Makefile.package.in |    1 +
>>  3 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 9ed46fc..b293d2f 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -52,6 +52,10 @@ qstrip=$(strip $(subst ",,$(1)))
>>  comma:=,
>>  empty:=
>>  space:=$(empty) $(empty)
>> +define newline
>> +
>> +
>> +endef
>>
>>  ifneq ("$(origin O)", "command line")
>>  O:=output
>> diff --git a/fs/common.mk b/fs/common.mk
>> index f793ff9..46d191b 100644
>> --- a/fs/common.mk
>> +++ b/fs/common.mk
>> @@ -50,6 +50,7 @@ $(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)
>> +	echo -e '$(subst $(newline),\n,$(PACKAGES_DEVICE_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 868bf28..d8d435e 100644
>> --- a/package/Makefile.package.in
>> +++ b/package/Makefile.package.in
>> @@ -541,6 +541,7 @@ endif
>>  ifeq ($$($$($(2)_KCONFIG_VAR)),y)
>>
>>  TARGETS += $(1)
>> +PACKAGES_DEVICE_TABLE += $$($(2)_DEVICES)$$(newline)
> 
>  Since it anyway will be echo -e'd, why not just use the following?
> 
> +PACKAGES_DEVICE_TABLE += \n$$($(2)_DEVICES)
> 
> (I haven't tried it, but I expect the terminating space and the initial empty 
> line are not a problem.)

Well, this will work, but we still have to keep the call to subst to
replace the new lines coming from packages defining several devices by
\n. So maybe this is better to stay consistent and use the newline
constant everywhere.


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

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-04 21:36   ` Arnout Vandecappelle
  2011-09-05  6:52     ` Thomas Petazzoni
  2011-09-05  9:11     ` Maxime Ripard
@ 2011-09-05 10:08     ` Michael S. Zick
  2 siblings, 0 replies; 16+ messages in thread
From: Michael S. Zick @ 2011-09-05 10:08 UTC (permalink / raw)
  To: buildroot

On Sun September 4 2011, Arnout Vandecappelle wrote:
> 
> On Friday 02 September 2011 14:08:59, Maxime Ripard wrote:
> > 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.
> 
>  Good idea!  This will also make it possible to create setuid executables.
> 
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > ---
> >  Makefile                    |    4 ++++
> >  fs/common.mk                |    1 +
> >  package/Makefile.package.in |    1 +
> >  3 files changed, 6 insertions(+), 0 deletions(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index 9ed46fc..b293d2f 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -52,6 +52,10 @@ qstrip=$(strip $(subst ",,$(1)))
> >  comma:=,
> >  empty:=
> >  space:=$(empty) $(empty)
> > +define newline
> > +
> > +
> > +endef
> > 
> >  ifneq ("$(origin O)", "command line")
> >  O:=output
> > diff --git a/fs/common.mk b/fs/common.mk
> > index f793ff9..46d191b 100644
> > --- a/fs/common.mk
> > +++ b/fs/common.mk
> > @@ -50,6 +50,7 @@ $(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)
> > +	echo -e '$(subst $(newline),\n,$(PACKAGES_DEVICE_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 868bf28..d8d435e 100644
> > --- a/package/Makefile.package.in
> > +++ b/package/Makefile.package.in
> > @@ -541,6 +541,7 @@ endif
> >  ifeq ($$($$($(2)_KCONFIG_VAR)),y)
> > 
> >  TARGETS += $(1)
> > +PACKAGES_DEVICE_TABLE += $$($(2)_DEVICES)$$(newline)
> 
>  Since it anyway will be echo -e'd, why not just use the following?
> 
> +PACKAGES_DEVICE_TABLE += \n$$($(2)_DEVICES)
> 
> (I haven't tried it, but I expect the terminating space and the initial empty 
> line are not a problem.)
>

Couldn't the initial empty line be avoided by a fixed device declaration
that initializes PACKAGES_DEVICE_TABLE with something either harmless or
required?
Such as: /dev/console or /dev/null?

Mike 
> 
>  Regards,
>  Arnout
> 
> 
> > 
> >  ifeq ($$($(2)_SITE_METHOD),svn)
> >  DL_TOOLS_DEPENDENCIES += svn
> 

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-05  6:52     ` Thomas Petazzoni
@ 2011-09-05 16:15       ` Maxime Ripard
  2011-09-06 16:03         ` Arnout Vandecappelle
  0 siblings, 1 reply; 16+ messages in thread
From: Maxime Ripard @ 2011-09-05 16:15 UTC (permalink / raw)
  To: buildroot

Hi,

On 05/09/2011 08:52, Thomas Petazzoni wrote:
> Hello,
> 
> Le Sun, 4 Sep 2011 23:36:43 +0200,
> Arnout Vandecappelle <arnout@mind.be> a ?crit :
> 
>>  Good idea!  This will also make it possible to create setuid
>> executables.
> 
> Yes, exactly. However, I don't really like the name <pkg>_DEVICE_TABLE
> because, it might be for other purposes as well (setting setuid bit,
> giving specific owner/group or permissions, etc.). Does anyone has an
> idea for a better name?

I agree, I don't like it neither, but I have no idea on what could be
better...

Files, maybe, but I find it way too generic.

Maxime

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

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-05 16:15       ` Maxime Ripard
@ 2011-09-06 16:03         ` Arnout Vandecappelle
  2011-09-07  9:21           ` Maxime Ripard
  0 siblings, 1 reply; 16+ messages in thread
From: Arnout Vandecappelle @ 2011-09-06 16:03 UTC (permalink / raw)
  To: buildroot


On Monday 05 September 2011 18:15:14, Maxime Ripard wrote:
> Hi,
> 
> On 05/09/2011 08:52, Thomas Petazzoni wrote:
> > Hello,
> > 
> > Le Sun, 4 Sep 2011 23:36:43 +0200,
> > 
> > Arnout Vandecappelle <arnout@mind.be> a ?crit :
> >>  Good idea!  This will also make it possible to create setuid
> >> executables.
> > 
> > Yes, exactly. However, I don't really like the name <pkg>_DEVICE_TABLE
> > because, it might be for other purposes as well (setting setuid bit,
> > giving specific owner/group or permissions, etc.). Does anyone has an
> > idea for a better name?
> 
> I agree, I don't like it neither, but I have no idea on what could be
> better...
> 
> Files, maybe, but I find it way too generic.

 How about _FILE_MOD_TABLE (cfr. chmod)?

 BTW, BR2_ROOTFS_DEVICE_TABLE the device_table.txt files should change in the 
same way.


 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-06 16:03         ` Arnout Vandecappelle
@ 2011-09-07  9:21           ` Maxime Ripard
  2011-09-07 16:22             ` Arnout Vandecappelle
  0 siblings, 1 reply; 16+ messages in thread
From: Maxime Ripard @ 2011-09-07  9:21 UTC (permalink / raw)
  To: buildroot

On 06/09/2011 18:03, Arnout Vandecappelle wrote:
> On Monday 05 September 2011 18:15:14, Maxime Ripard wrote:
>> On 05/09/2011 08:52, Thomas Petazzoni wrote:
>>> Yes, exactly. However, I don't really like the name <pkg>_DEVICE_TABLE
>>> because, it might be for other purposes as well (setting setuid bit,
>>> giving specific owner/group or permissions, etc.). Does anyone has an
>>> idea for a better name?
>>
>> I agree, I don't like it neither, but I have no idea on what could be
>> better...
>>
>> Files, maybe, but I find it way too generic.
> 
>  How about _FILE_MOD_TABLE (cfr. chmod)?

Hmm, I'm not quite sure, it is more than just mod. Maybe reuse the
"skeleton" term already in use in buildroot.

>  BTW, BR2_ROOTFS_DEVICE_TABLE the device_table.txt files should change in the 
> same way.

Of course, and in the menuconfig too.

Maxime

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

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-07  9:21           ` Maxime Ripard
@ 2011-09-07 16:22             ` Arnout Vandecappelle
  2011-09-08  8:18               ` Maxime Ripard
  0 siblings, 1 reply; 16+ messages in thread
From: Arnout Vandecappelle @ 2011-09-07 16:22 UTC (permalink / raw)
  To: buildroot


On Wednesday 07 September 2011 11:21:22, Maxime Ripard wrote:
> On 06/09/2011 18:03, Arnout Vandecappelle wrote:
> > On Monday 05 September 2011 18:15:14, Maxime Ripard wrote:
> >> On 05/09/2011 08:52, Thomas Petazzoni wrote:
> >>> Yes, exactly. However, I don't really like the name <pkg>_DEVICE_TABLE
> >>> because, it might be for other purposes as well (setting setuid bit,
> >>> giving specific owner/group or permissions, etc.). Does anyone has an
> >>> idea for a better name?
> >> 
> >> I agree, I don't like it neither, but I have no idea on what could be
> >> better...
> >> 
> >> Files, maybe, but I find it way too generic.
> >
> > 
> >  How about _FILE_MOD_TABLE (cfr. chmod)?
> 
> Hmm, I'm not quite sure, it is more than just mod. Maybe reuse the
> "skeleton" term already in use in buildroot.

 AFAICS it does three things:
- make device nodes (mknod)
- change permissions (chmod)
- set ownership (chown)


 So skeleton is not really the right term, as it only refers to the mknod 
function again.  (Although not-yet-existing files and directories are created, 
that's not usually the main purpose for files and directories.)

 FILE is also not a good idea since it also applies to directories and device 
nodes which are not really files.

 A complete name would be _NOD_MOD_OWN_TABLE, but that's too long and too 
cryptic :-)  Plus, we might want to add things like setting the utimes etc. in 
the future.

 The functionality is in fact comparable to install - copy files and set 
attributes (except for the copy part).  So we could use _ATTRIBUTE_TABLE. 
Unfortunately, 'attributes' could also refer to the e2fs file attributes, 
which are a different thing entirely (cfr. man chattr).  Or 
_FILE_INSTALL_TABLE.

 We could also consider that it sets most of the content of struct stat.  But 
_STAT_TABLE is again a bit cryptic.


 Enough possibilities...


 Regards,
 Arnout
 

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-07 16:22             ` Arnout Vandecappelle
@ 2011-09-08  8:18               ` Maxime Ripard
  2011-09-08  9:00                 ` Arnout Vandecappelle
  2011-09-08 10:00                 ` Quotient Remainder
  0 siblings, 2 replies; 16+ messages in thread
From: Maxime Ripard @ 2011-09-08  8:18 UTC (permalink / raw)
  To: buildroot

On 07/09/2011 18:22, Arnout Vandecappelle wrote:
> 
> On Wednesday 07 September 2011 11:21:22, Maxime Ripard wrote:
>> On 06/09/2011 18:03, Arnout Vandecappelle wrote:
>>> On Monday 05 September 2011 18:15:14, Maxime Ripard wrote:
>>>> On 05/09/2011 08:52, Thomas Petazzoni wrote:
>>>>> Yes, exactly. However, I don't really like the name <pkg>_DEVICE_TABLE
>>>>> because, it might be for other purposes as well (setting setuid bit,
>>>>> giving specific owner/group or permissions, etc.). Does anyone has an
>>>>> idea for a better name?
>>>>
>>>> I agree, I don't like it neither, but I have no idea on what could be
>>>> better...
>>>>
>>>> Files, maybe, but I find it way too generic.
>>>
>>>
>>>  How about _FILE_MOD_TABLE (cfr. chmod)?
>>
>> Hmm, I'm not quite sure, it is more than just mod. Maybe reuse the
>> "skeleton" term already in use in buildroot.
> 
>  AFAICS it does three things:
> - make device nodes (mknod)
> - change permissions (chmod)
> - set ownership (chown)
> 
>  So skeleton is not really the right term, as it only refers to the mknod 
> function again.  (Although not-yet-existing files and directories are created, 
> that's not usually the main purpose for files and directories.)

In device_table.txt, it also creates the whole basic filesystem
hierarchy, with folders (such as /dev) and files (such as /etc/shadow).
So you will have to add mkdir and touch to your list. That is why is was
going for skeleton,

>  FILE is also not a good idea since it also applies to directories and device 
> nodes which are not really files.

Heresy! :)
More seriously, I was speaking about files with the Unix meaning in
mind, but it is true it can cause confusion.

>  A complete name would be _NOD_MOD_OWN_TABLE, but that's too long and too 
> cryptic :-)  Plus, we might want to add things like setting the utimes etc. in 
> the future.

I agree.

>  The functionality is in fact comparable to install - copy files and set 
> attributes (except for the copy part).  So we could use _ATTRIBUTE_TABLE. 
> Unfortunately, 'attributes' could also refer to the e2fs file attributes, 
> which are a different thing entirely (cfr. man chattr).  Or 
> _FILE_INSTALL_TABLE.

This one seems good to me. Peter ?


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

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-08  8:18               ` Maxime Ripard
@ 2011-09-08  9:00                 ` Arnout Vandecappelle
  2011-09-08 10:00                 ` Quotient Remainder
  1 sibling, 0 replies; 16+ messages in thread
From: Arnout Vandecappelle @ 2011-09-08  9:00 UTC (permalink / raw)
  To: buildroot

 [I really should stop replying to this thread ;-)]
On Thursday 08 September 2011 10:18:14, Maxime Ripard wrote:
> >  AFAICS it does three things:
> > - make device nodes (mknod)
> > - change permissions (chmod)
> > - set ownership (chown)
> >
> > 
> >  So skeleton is not really the right term, as it only refers to the
> >mknod 
> >
> > function again.  (Although not-yet-existing files and directories are
> > created,  that's not usually the main purpose for files and
> > directories.)
> 
> In device_table.txt, it also creates the whole basic filesystem
> hierarchy, with folders (such as /dev) and files (such as /etc/shadow).
> So you will have to add mkdir and touch to your list. That is why is was
> going for skeleton,

 Both /dev and /etc/shadow are (usually) copied from fs/skeleton, 
device_table.txt only updates the permissions.  I guess the /dev and /etc 
lines in device_table.txt are a bit redundant...

 Regards,
 Arnout


-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-08  8:18               ` Maxime Ripard
  2011-09-08  9:00                 ` Arnout Vandecappelle
@ 2011-09-08 10:00                 ` Quotient Remainder
  2011-09-08 11:03                   ` Luca Ceresoli
  1 sibling, 1 reply; 16+ messages in thread
From: Quotient Remainder @ 2011-09-08 10:00 UTC (permalink / raw)
  To: buildroot

Ar D?ar, 2011-09-08 ag 10:18 +0200, scr?obh Maxime Ripard:
> On 07/09/2011 18:22, Arnout Vandecappelle wrote:
> > 
> > On Wednesday 07 September 2011 11:21:22, Maxime Ripard wrote:
> >> On 06/09/2011 18:03, Arnout Vandecappelle wrote:
> >>> On Monday 05 September 2011 18:15:14, Maxime Ripard wrote:
> >>>> On 05/09/2011 08:52, Thomas Petazzoni wrote:
> >>>>> Yes, exactly. However, I don't really like the name <pkg>_DEVICE_TABLE
> >>>>> because, it might be for other purposes as well (setting setuid bit,
> >>>>> giving specific owner/group or permissions, etc.). Does anyone has an
> >>>>> idea for a better name?
> >>>>
> >>>> I agree, I don't like it neither, but I have no idea on what could be
> >>>> better...
> >>>>
> >>>> Files, maybe, but I find it way too generic.
> >>>
> >>>
> >>>  How about _FILE_MOD_TABLE (cfr. chmod)?
> >>
> >> Hmm, I'm not quite sure, it is more than just mod. Maybe reuse the
> >> "skeleton" term already in use in buildroot.
> > 
> >  AFAICS it does three things:
> > - make device nodes (mknod)
> > - change permissions (chmod)
> > - set ownership (chown)
> > 
> >  So skeleton is not really the right term, as it only refers to the mknod 
> > function again.  (Although not-yet-existing files and directories are created, 
> > that's not usually the main purpose for files and directories.)
> 
> In device_table.txt, it also creates the whole basic filesystem
> hierarchy, with folders (such as /dev) and files (such as /etc/shadow).
> So you will have to add mkdir and touch to your list. That is why is was
> going for skeleton,
> 
> >  FILE is also not a good idea since it also applies to directories and device 
> > nodes which are not really files.
> 
> Heresy! :)
> More seriously, I was speaking about files with the Unix meaning in
> mind, but it is true it can cause confusion.
>
> >  A complete name would be _NOD_MOD_OWN_TABLE, but that's too long and too 
> > cryptic :-)  Plus, we might want to add things like setting the utimes etc. in 
> > the future.
> 
> I agree.
> 
> >  The functionality is in fact comparable to install - copy files and set 
> > attributes (except for the copy part).  So we could use _ATTRIBUTE_TABLE. 
> > Unfortunately, 'attributes' could also refer to the e2fs file attributes, 
> > which are a different thing entirely (cfr. man chattr).  Or 
> > _FILE_INSTALL_TABLE.
> 
> This one seems good to me. Peter ?

They're all operations (create or change) on file-system entries so
maybe like ..._EXTRA_FS_OPERATIONS or similar?

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-08 10:00                 ` Quotient Remainder
@ 2011-09-08 11:03                   ` Luca Ceresoli
  2011-09-08 11:24                     ` Michael S. Zick
  0 siblings, 1 reply; 16+ messages in thread
From: Luca Ceresoli @ 2011-09-08 11:03 UTC (permalink / raw)
  To: buildroot

Let me add my two cents to this irresistible, brainstorming-like,
non-violent flamewar. :)

Quotient Remainder wrote:
>>> _FILE_INSTALL_TABLE.
>>
>> This one seems good to me. Peter ?
>
> They're all operations (create or change) on file-system entries so
> maybe like ..._EXTRA_FS_OPERATIONS or similar?

inodes_table?
nodes_table?
fsnodes_table?

Luca

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

* [Buildroot] [PATCH 1/2] Add support for package-declared devices
  2011-09-08 11:03                   ` Luca Ceresoli
@ 2011-09-08 11:24                     ` Michael S. Zick
  0 siblings, 0 replies; 16+ messages in thread
From: Michael S. Zick @ 2011-09-08 11:24 UTC (permalink / raw)
  To: buildroot

On Thu September 8 2011, Luca Ceresoli wrote:
> Let me add my two cents to this irresistible, brainstorming-like,
> non-violent flamewar. :)
> 
> Quotient Remainder wrote:
> >>> _FILE_INSTALL_TABLE.
> >>
> >> This one seems good to me. Peter ?
> >
> > They're all operations (create or change) on file-system entries so
> > maybe like ..._EXTRA_FS_OPERATIONS or similar?
> 
> inodes_table?
> nodes_table?
> fsnodes_table?
>

The action being accomplished is to "provision" the generated
image.
So a name based on the action might be a better choice.

Just avoid anything that implies "provisional", which can be 
misunderstood to have a similar meaning as "conditional".

Mike 
> Luca
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 
> 

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

end of thread, other threads:[~2011-09-08 11:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-02 12:08 [Buildroot] [pull request] Pull request for branch for-2011.11/pkg-device Maxime Ripard
2011-09-02 12:08 ` [Buildroot] [PATCH 1/2] Add support for package-declared devices Maxime Ripard
2011-09-04 21:36   ` Arnout Vandecappelle
2011-09-05  6:52     ` Thomas Petazzoni
2011-09-05 16:15       ` Maxime Ripard
2011-09-06 16:03         ` Arnout Vandecappelle
2011-09-07  9:21           ` Maxime Ripard
2011-09-07 16:22             ` Arnout Vandecappelle
2011-09-08  8:18               ` Maxime Ripard
2011-09-08  9:00                 ` Arnout Vandecappelle
2011-09-08 10:00                 ` Quotient Remainder
2011-09-08 11:03                   ` Luca Ceresoli
2011-09-08 11:24                     ` Michael S. Zick
2011-09-05  9:11     ` Maxime Ripard
2011-09-05 10:08     ` Michael S. Zick
2011-09-02 12:09 ` [Buildroot] [PATCH 2/2] Convert busybox to the device declaration method Maxime Ripard

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.