[OE-core] [PATCH 1/4] packaging: allow globs in CONFFILES

ChenQi Qi.Chen at windriver.com
Tue Dec 23 08:44:26 UTC 2014


On 12/23/2014 02:25 PM, Anders Darander wrote:
> * ChenQi <Qi.Chen at windriver.com> [141223 02:58]:
>
>> On 12/19/2014 02:42 PM, Mike Looijmans wrote:
>>> On 12/19/2014 07:21 AM, Chen Qi wrote:
>>>> ...
>>>> As almost all files under /etc are basically configuration files, we
>>>> provide a default value for CONFFILES.
>>>>      CONNFFILES = "${sysconfdir}"
>>> This is going to hurt a lot of recipes. Please do not set this.
> Definitely true!
>
>>> The default has always been that CONFFILES is empty. I see no reason
>>> whatsoever to suddenly change this.
>>>> In this way, we don't need to modify every recipe to set the
>>>> CONFFILES variable. Of course, setting CONFFILES in recipes take
>>>> precedence over the CONFFILES. For example, if the recipe author
>>>> decides that package A should only treat files under
>>>> ${sysconfdir}/default/ as config files, he/she can write like this.
>>>>      CONFFILES_A = "${sysconfdir}/default"
>>>> The above situation should not be common. As according to FHS, the
>>>> /etc directory is a place for all system related configuration
>>>> files.
> No, similar lines will be required for quite a few recipes...
>
>>> FHS may have written that somewhere, but if you just take a quick
>>> look at what is in /etc/, you'll find that actual configuration files
>>> are quite rare, but there are tons of scripts and distro related
>>> files there.  Whether or not a file there is supposed to be edited by
>>> the end-user is something of a distro decision.
>>> Also, "configuration file" does not necessarily mean that the USER is
>>> in control. A configuration file may also simply distinguish machine
>>> capabilities or software features.
>>> We'll end up having to patch hundreds of recipes with a CONFFILES=""
>>> or similar line.
>> Most files under /etc are configuration files. If we don't default
>> CONFFILES to ${sysconfdir}, then we have to patch a lot of recipes
>> with CONFFILES_xxx = "xxxx" lines.
> Well, there are a lot of those configuration files, that only the
> distribution will care about. Especially if we're talking embedded
> devices.
>
>> The fact is that when people write recipes, they often forget about
>> CONFFILES.  The typical example is the shadow recipe. And I can easily
>> give you more examples.
> This patch won't help this, it just shifts everything 180 degrees
> around. Now we have to explicitly remove a number of files from
> CONFFILES in a number of packages; which obviously is something that
> people will forget...
>
>> And it's not uncommon that people forget to check CONFFILES when they
>> update the recipe.  When the recipe is updated to a new version, it's
>> possible that the CONFFILES should change.  The typical example is the
>> systemd recipe.
>> *The bad effect of the above? On-target package upgrades override user
>> changes. That's a really annoying problem, isn't it?* Users of OE
>> based projects have complained about this. There were patches on OE
>> which fixed several recipes. But the solution doesn't scale.
> I tend to agree with Mike here. It's better to explicitly add files (or
> directories) in each recipe, as that will make it more obvious which
> files won't get overwritten during a package upgrade. Sure, short-term
> this might mean more patches (I'm nt really sure of the status regarding
> this).
>
> But more importantly, it will keep the determinism and explicit marking
> of CONFFILES. Again, remember that we're primarily talking about
> embedded devices here, where the distibution/distributor quite likely
> need some more control, compared to a regular desktop distribution.


Hi Anders,

I read your comments carefully and thought for a while. Sorry but I 
still insist my opinion.
Please see reasons below.

First of all, I don't think this issue has anything to do with the 
'embedded devices' or 'desktop distribution' thing. The two concepts are 
too large and should not become the reason. Some desktop distributions 
support image based upgrades. Many small embedded devices should only do 
image based upgrades. Most desktop distributions support package based 
upgrades, some embedded devices should also support it.
What we are talking here is on-target package upgrades. If the 
distributor wants to have full control, then its users/customers should 
be suggested to only do image-based upgrades.
But now, let's just focus on package based upgrades.

We have to be aware that package managers are designed to handle config 
files specially. Why they are designed to do so? Because users should 
not be surprised.
Take 'rpm' as an example.

File marked as 	Changed in update RPM? 	On-disk file untouched 	On-disk 
file edited
[default] 	No 	File from update 	File from update
Yes 	File from update 	File from update
%config 	No 	File from update 	Edited file
Yes 	File from update 	File from update, edited file in .rpmsave
%config(noreplace) 	No 	File from update 	Edited file
Yes 	File from update 	Edited file, file from the update in .rpmnew



You can see that it's pretty reasonable.
The problem we have now is that if the user edit a configuration file 
(e.g. /etc/login.defs), the file will still be overridden by upgrades 
even if the file doesn't change in the new package.

Now the focus is whether we should take ${sysconfdir} as the default 
value for CONFFILES.
I strongly think we should. Why? We can easily make use of the power of 
package managers for dealing with configuration files.
If we don't do so, very likely the user changes would be overridden 
silently without informing the user.
This should not happen, especially when the files are under /etc. 
Otherwise we will get angry users or customers. How are we gonna explain 
to them? I don't 'embedded device' could be a satisfactory reason.
Please see the number below. Hope this will reveal the situation of 
CONFFILES in OE.
chenqi at pek-hostel-deb01:~/poky [0] $ find meta meta-openembedded/ -name 
"*.bb" | wc -l
1897
chenqi at pek-hostel-deb01:~/poky [0] $ find meta meta-openembedded/ -name 
"*.bb" -o -name "*.inc" | xargs grep CONFFILES | wc -l
86

Best Regards,
Chen Qi

>> The patchset is an effort to change this situation.
> I don't think we'll gain that much from this patch; rather we'll
> loose...
>
> Cheers,
> Anders
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20141223/2e45b511/attachment-0002.html>


More information about the Openembedded-core mailing list