Patchwork [0/2] Change the way of handling CONFFILES

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Dec. 13, 2013, 3:09 a.m.
Message ID <cover.1386903269.git.Qi.Chen@windriver.com>
Download mbox
Permalink /patch/63301/
State New
Headers show

Pull-request

git://git.pokylinux.org/poky-contrib ChenQi/CONFFILES

Comments

Qi.Chen@windriver.com - Dec. 13, 2013, 3:09 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

It's a very common situation in OE/Yocto that the recipe authors/maintainers
either forget to set the CONFFILES variable or set it wrong.

For example, we don't have CONFFILES set in the shadow recipe. As a result,
/etc/login.defs from the shadow package is not treated as a config file.
Another example is the base-files recipe. We set the CONFFILES variable, but
it's not a complete list. Basically, all files under /etc should be treated as
config files for this recipe.

Such mistakes are not easy to find, because when we add or upgrade a recipe,
we usually only test whether it functions well, we don't take into consideration
the on-target upgrade process.

So we need to improve the situation here.

This patchset consists of two patches. The first one is the main patch which changes
the way CONFFILES is handled in our project. The second one serves as an example how
to fix individual recipes.

As almost all files under /etc should be considerred as config files, we don't need to
modify a lot of recipes after the first patch. Take shadow as an example. We don't need
to modify that recipe after this change. The ones that need to be paid attention to are
those that set CONFFILES in their recipes. The second patch serves as an exmple how to
fix this.

//Chen Qi

The following changes since commit ba8506ee342a1a579ceb309f3f50285eaad84f25:

  local.conf.extended: Bring into sync with OE-Core (2013-12-12 23:18:39 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/CONFFILES
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/CONFFILES

Chen Qi (2):
  packaging: change the process of CONFFILES handling
  base-files: Fix CONFFILES

 meta/classes/insane.bbclass                       |    2 +-
 meta/classes/package.bbclass                      |   35 +++++++++++++++++++++
 meta/classes/package_deb.bbclass                  |    2 +-
 meta/classes/package_ipk.bbclass                  |    2 +-
 meta/classes/package_rpm.bbclass                  |    2 +-
 meta/conf/bitbake.conf                            |    2 ++
 meta/recipes-core/base-files/base-files_3.0.14.bb |    3 --
 7 files changed, 41 insertions(+), 7 deletions(-)
Paul Eggleton - Dec. 13, 2013, 4:51 p.m.
Hi Qi,

On Friday 13 December 2013 11:09:01 Qi.Chen@windriver.com wrote:
> It's a very common situation in OE/Yocto that the recipe authors/maintainers
> either forget to set the CONFFILES variable or set it wrong.
> 
> For example, we don't have CONFFILES set in the shadow recipe. As a result,
> /etc/login.defs from the shadow package is not treated as a config file.
> Another example is the base-files recipe. We set the CONFFILES variable, but
> it's not a complete list. Basically, all files under /etc should be treated
> as config files for this recipe.
> 
> Such mistakes are not easy to find, because when we add or upgrade a recipe,
> we usually only test whether it functions well, we don't take into
> consideration the on-target upgrade process.
> 
> So we need to improve the situation here.
> 
> This patchset consists of two patches. The first one is the main patch which
> changes the way CONFFILES is handled in our project. The second one serves
> as an example how to fix individual recipes.
> 
> As almost all files under /etc should be considerred as config files, we
> don't need to modify a lot of recipes after the first patch. Take shadow as
> an example. We don't need to modify that recipe after this change. The ones
> that need to be paid attention to are those that set CONFFILES in their
> recipes. The second patch serves as an exmple how to fix this.

This definitely sounds like a good idea, but do we need to give special 
consideration to /etc/init.d/ since files under there aren't really 
configuration files?

Cheers,
Paul
Enrico Scholz - Dec. 13, 2013, 5:18 p.m.
<Qi.Chen-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> writes:

> As almost all files under /etc should be considerred as config files,

A lot of projects (especially from the freedesktop edge) are (ab)using
/etc to store non configuration files. E.g. all the dbus confguration or
gconf schemes are not intended to be modified by users.



Enrico
Qi.Chen@windriver.com - Dec. 16, 2013, 2:12 a.m.
On 12/14/2013 12:51 AM, Paul Eggleton wrote:
> Hi Qi,
>
> On Friday 13 December 2013 11:09:01 Qi.Chen@windriver.com wrote:
>> It's a very common situation in OE/Yocto that the recipe authors/maintainers
>> either forget to set the CONFFILES variable or set it wrong.
>>
>> For example, we don't have CONFFILES set in the shadow recipe. As a result,
>> /etc/login.defs from the shadow package is not treated as a config file.
>> Another example is the base-files recipe. We set the CONFFILES variable, but
>> it's not a complete list. Basically, all files under /etc should be treated
>> as config files for this recipe.
>>
>> Such mistakes are not easy to find, because when we add or upgrade a recipe,
>> we usually only test whether it functions well, we don't take into
>> consideration the on-target upgrade process.
>>
>> So we need to improve the situation here.
>>
>> This patchset consists of two patches. The first one is the main patch which
>> changes the way CONFFILES is handled in our project. The second one serves
>> as an example how to fix individual recipes.
>>
>> As almost all files under /etc should be considerred as config files, we
>> don't need to modify a lot of recipes after the first patch. Take shadow as
>> an example. We don't need to modify that recipe after this change. The ones
>> that need to be paid attention to are those that set CONFFILES in their
>> recipes. The second patch serves as an exmple how to fix this.
> This definitely sounds like a good idea, but do we need to give special
> consideration to /etc/init.d/ since files under there aren't really
> configuration files?
>
> Cheers,
> Paul
>

I thought about this issue. I then referenced ubuntu to see how it 
treated files under /etc/init.d/.
On ubuntu, files under /etc/init.d/ are also treated as configuration 
files. I think the rational behind
this decision might be that if the user modifies some init script, he 
must have modified it for some
reason which can not be silently ignored.

That's why I didn't deal with /etc/init.d/ specially.

Best Regards,
Chen Qi
Qi.Chen@windriver.com - Dec. 16, 2013, 2:20 a.m.
On 12/14/2013 01:18 AM, Enrico Scholz wrote:
> <Qi.Chen-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> writes:
>
>> As almost all files under /etc should be considerred as config files,
> A lot of projects (especially from the freedesktop edge) are (ab)using
> /etc to store non configuration files. E.g. all the dbus confguration or
> gconf schemes are not intended to be modified by users.
>

Thanks for your information.

To be frank, I'm not familiar with dbus.
But I think in such situations where some files under /etc are not 
configuration files, we can override the CONFFILES variable in those 
related recipes. And this work could be well handled by someone who's 
familiar with those recipes.

Note that this patch will not affect recipes that have already set the 
CONFFILES variable
Take dbus as an example. In dbus.inc, we have:
CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf 
${sysconfdir}/dbus-1/session.conf"

So the CONFFILES for dbus are not all files under /etc/, but only the 
two files listed above.

Best Regards,
Chen Qi

>
> Enrico
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>
Ross Burton - Dec. 16, 2013, 10:34 a.m.
On 13 December 2013 17:18, Enrico Scholz
<enrico.scholz@sigma-chemnitz.de> wrote:
> A lot of projects (especially from the freedesktop edge) are (ab)using
> /etc to store non configuration files. E.g. all the dbus confguration or
> gconf schemes are not intended to be modified by users.

DBus configuration is available to be modified by admins, which is why
it's in /etc.

Ross