Bug 5200

Summary: Improve the handling of CONFFILES
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Chen Qi <Qi.Chen>
Component: coreAssignee: Chen Qi <Qi.Chen>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: bluelightning, liezhi.yang, mark.hatle, meta.mr.watcher, meta.watcher, richard.purdie, ross.burton, sgw, yi.zhao
Version: 1.5   
Target Milestone: 1.8 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Chen Qi 2013-09-15 10:53:38 UTC
I want to change the semantics of the CONFFILES variable and improve its handling during the packaging process. Please see detailed reasons and design bekow.

==============================================================================

For now, the CONFFILES variable is a list of config files to be
packaged. However, as these files may come directly from upstream
instead of from our WORKDIR, it's a common mistake that we forget to set
this variable in our recipes. This will lead to unexpected behavior
when doing an on-target upgrade. For example, we modify the /etc/login.defs
on target and then do an upgrade. The file will be replaced, which is
obviously not correct.

We should change the handling and semantics of CONFFILES.
The CONFFILES should be able to take the same form as FILES.
That means, we don't have to list a bunch of files for CONFFILES in each recipe. It will just be expanded like the FILES variable.

As almost all files under /etc are basically configuration files, we should
provide a default value for CONFFILES.

	CONNFFILES_DEFAULT = "${sysconfdir}"

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_DEFAULT. 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.

//Chen Qi
Comment 1 Chen Qi 2013-09-15 10:55:57 UTC
The following patchset shows the basic idea.

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

Any comment or suggestion would be really appreciated.

//Chen Qi
Comment 2 Chen Qi 2014-07-03 07:57:26 UTC
Hi Saul & Richard,

What do you think of this problem?

If it's decided that the proposal is not reasonable, I'd like to close this bug as 'WON'T FIX'.

Best Regards,
Chen Qi
Comment 3 Ross Burton 2014-11-25 21:23:55 UTC
Sadly that branch no longer exists.  I agree that CONFFILES should behave like FILES with respect to globs, but I don't think we need a CONFFILES_DEFAULT, just set CONFFILES = ${sysconfdir} in bitbake.conf.
Comment 4 Chen Qi 2014-11-26 02:02:45 UTC
(In reply to comment #3)
> Sadly that branch no longer exists.  I agree that CONFFILES should behave
> like FILES with respect to globs, but I don't think we need a
> CONFFILES_DEFAULT, just set CONFFILES = ${sysconfdir} in bitbake.conf.

Got it.
I'll send out a new patchset.

Thanks,
Chen Qi
Comment 5 Ross Burton 2015-02-12 16:18:34 UTC
The consensus on mailing list was that changing the CONFFILES default is a bad idea, can you rebase the branch to master and drop the change to bitbake.conf.
Comment 6 Chen Qi 2015-02-13 02:26:13 UTC
(In reply to comment #5)
> The consensus on mailing list was that changing the CONFFILES default is a
> bad idea, can you rebase the branch to master and drop the change to
> bitbake.conf.

OK.
I'll finish it before Chinese New Year.

//Chen Qi
Comment 7 Ross Burton 2015-02-19 11:21:59 UTC
Merged in oe-core 0d446ef0e5bbca7058eec7259e34f2a1637dfab1.