* [PATCH 0/6] Avoid config files being overwritten
@ 2014-11-14 9:43 Jian Liu
2014-11-14 9:43 ` [PATCH 1/5] base-files: files will be over written when updating using rpm Jian Liu
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: Jian Liu @ 2014-11-14 9:43 UTC (permalink / raw)
To: openembedded-core
Configure files and scripts may be over written when updating packages with rpm.
For example, if updating base-files with a new version of rpm, the file
/etc/nsswitch.conf which is created by base-files will be substituted by a new file.
This is not what we want since our config files may be lost after updating.
A resolution is to revise spec file of rpm and put %config before config files
like "%config /etc/nsswitch.conf".
Theoretically all editable files created by rpm packages should be protected
with "%config". But currently we only concern about the following packages:
base-files
initscripts
logrotate
lvm2
libpam
nfs-utils
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/5] base-files: files will be over written when updating using rpm
2014-11-14 9:43 [PATCH 0/6] Avoid config files being overwritten Jian Liu
@ 2014-11-14 9:43 ` Jian Liu
2014-11-20 20:37 ` Burton, Ross
2014-11-20 20:40 ` Burton, Ross
2014-11-14 9:43 ` [PATCH 2/5] initscripts: " Jian Liu
` (3 subsequent siblings)
4 siblings, 2 replies; 13+ messages in thread
From: Jian Liu @ 2014-11-14 9:43 UTC (permalink / raw)
To: openembedded-core
If there is no %config micro before the file in the spec file,
this file will be over-written after updating this package
using rpm.
This will make our settings lost.
Signed-off-by: Jian Liu <jian.liu@windriver.com>
---
meta/recipes-core/base-files/base-files_3.0.14.bb | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index 07f5c54..6157ff3 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -151,4 +151,5 @@ FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"
PACKAGE_ARCH = "${MACHINE_ARCH}"
CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname', True) != '')]} ${sysconfdir}/shells"
+CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile"
--
1.8.5.2.233.g932f7e4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/5] initscripts: files will be over written when updating using rpm
2014-11-14 9:43 [PATCH 0/6] Avoid config files being overwritten Jian Liu
2014-11-14 9:43 ` [PATCH 1/5] base-files: files will be over written when updating using rpm Jian Liu
@ 2014-11-14 9:43 ` Jian Liu
2014-11-14 9:43 ` [PATCH 3/5] logrotate: " Jian Liu
` (2 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: Jian Liu @ 2014-11-14 9:43 UTC (permalink / raw)
To: openembedded-core
If there is no %config micro before the file in the spec file,
this file will be over-written after updating this package
using rpm.
This will make our settings lost.
Signed-off-by: Jian Liu <jian.liu@windriver.com>
---
meta/recipes-core/initscripts/initscripts_1.0.bb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
index a665acf..afdc538 100644
--- a/meta/recipes-core/initscripts/initscripts_1.0.bb
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -162,3 +162,5 @@ pkg_postinst_${PN} () {
done
fi
}
+
+CONFFILES_${PN} += "${sysconfdir}/init.d/checkroot.sh"
--
1.8.5.2.233.g932f7e4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/5] logrotate: files will be over written when updating using rpm
2014-11-14 9:43 [PATCH 0/6] Avoid config files being overwritten Jian Liu
2014-11-14 9:43 ` [PATCH 1/5] base-files: files will be over written when updating using rpm Jian Liu
2014-11-14 9:43 ` [PATCH 2/5] initscripts: " Jian Liu
@ 2014-11-14 9:43 ` Jian Liu
2014-11-19 17:54 ` Dan McGregor
2014-11-14 9:43 ` [PATCH 4/5] libpam: " Jian Liu
2014-11-14 9:43 ` [PATCH 5/5] nfs-utils: " Jian Liu
4 siblings, 1 reply; 13+ messages in thread
From: Jian Liu @ 2014-11-14 9:43 UTC (permalink / raw)
To: openembedded-core
If there is no %config micro before the file in the spec file,
this file will be over-written after updating this package
using rpm.
This will make our settings lost.
Signed-off-by: Jian Liu <jian.liu@windriver.com>
---
meta/recipes-extended/logrotate/logrotate_3.8.7.bb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
index faa8e02..8b39602 100644
--- a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
+++ b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
@@ -54,3 +54,5 @@ do_install(){
install -p -m 755 examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
touch ${D}${localstatedir}/lib/logrotate.status
}
+
+CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status"
--
1.8.5.2.233.g932f7e4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 4/5] libpam: files will be over written when updating using rpm
2014-11-14 9:43 [PATCH 0/6] Avoid config files being overwritten Jian Liu
` (2 preceding siblings ...)
2014-11-14 9:43 ` [PATCH 3/5] logrotate: " Jian Liu
@ 2014-11-14 9:43 ` Jian Liu
2014-11-14 9:43 ` [PATCH 5/5] nfs-utils: " Jian Liu
4 siblings, 0 replies; 13+ messages in thread
From: Jian Liu @ 2014-11-14 9:43 UTC (permalink / raw)
To: openembedded-core
If there is no %config micro before the file in the spec file,
this file will be over-written after updating this package
using rpm.
This will make our settings lost.
Signed-off-by: Jian Liu <jian.liu@windriver.com>
---
meta/recipes-extended/pam/libpam_1.1.6.bb | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/recipes-extended/pam/libpam_1.1.6.bb b/meta/recipes-extended/pam/libpam_1.1.6.bb
index 3b6d514..b3b39da 100644
--- a/meta/recipes-extended/pam/libpam_1.1.6.bb
+++ b/meta/recipes-extended/pam/libpam_1.1.6.bb
@@ -163,3 +163,9 @@ python do_pam_sanity () {
addtask pam_sanity before do_configure
BBCLASSEXTEND = "nativesdk native"
+
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-auth"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-password"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-account"
--
1.8.5.2.233.g932f7e4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 5/5] nfs-utils: files will be over written when updating using rpm
2014-11-14 9:43 [PATCH 0/6] Avoid config files being overwritten Jian Liu
` (3 preceding siblings ...)
2014-11-14 9:43 ` [PATCH 4/5] libpam: " Jian Liu
@ 2014-11-14 9:43 ` Jian Liu
4 siblings, 0 replies; 13+ messages in thread
From: Jian Liu @ 2014-11-14 9:43 UTC (permalink / raw)
To: openembedded-core
If there is no %config micro before the file in the spec file,
this file will be over-written after updating this package
using rpm.
This will make our settings lost.
Signed-off-by: Jian Liu <jian.liu@windriver.com>
---
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
index 8ead5d0..3e2d183 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
@@ -114,3 +114,5 @@ do_install_append () {
rm -f ${D}${sbindir}/rpcgen
rm -f ${D}${sbindir}/locktest
}
+
+CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab ${localstatedir}/lib/nfs/statd/state ${localstatedir}/lib/nfs/rmtab"
--
1.8.5.2.233.g932f7e4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 3/5] logrotate: files will be over written when updating using rpm
2014-11-14 9:43 ` [PATCH 3/5] logrotate: " Jian Liu
@ 2014-11-19 17:54 ` Dan McGregor
2014-11-20 2:11 ` Liu Jian
2014-11-20 20:37 ` Burton, Ross
0 siblings, 2 replies; 13+ messages in thread
From: Dan McGregor @ 2014-11-19 17:54 UTC (permalink / raw)
To: Jian Liu; +Cc: Patches and discussions about the oe-core layer
On 14 November 2014 03:43, Jian Liu <jian.liu@windriver.com> wrote:
> If there is no %config micro before the file in the spec file,
> this file will be over-written after updating this package
> using rpm.
> This will make our settings lost.
>
> Signed-off-by: Jian Liu <jian.liu@windriver.com>
> ---
> meta/recipes-extended/logrotate/logrotate_3.8.7.bb | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> index faa8e02..8b39602 100644
> --- a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> +++ b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
> @@ -54,3 +54,5 @@ do_install(){
> install -p -m 755 examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
> touch ${D}${localstatedir}/lib/logrotate.status
> }
> +
> +CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status"
Part of me thinks this shouldn't be an installed file at all; instead
it should be created by a post install script if it doesn't already
exist. Thoughts?
> --
> 1.8.5.2.233.g932f7e4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/5] logrotate: files will be over written when updating using rpm
2014-11-19 17:54 ` Dan McGregor
@ 2014-11-20 2:11 ` Liu Jian
2014-11-20 20:37 ` Burton, Ross
1 sibling, 0 replies; 13+ messages in thread
From: Liu Jian @ 2014-11-20 2:11 UTC (permalink / raw)
To: Dan McGregor; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1826 bytes --]
于 2014年11月20日 01:54, Dan McGregor 写道:
> On 14 November 2014 03:43, Jian Liu <jian.liu@windriver.com> wrote:
>> If there is no %config micro before the file in the spec file,
>> this file will be over-written after updating this package
>> using rpm.
>> This will make our settings lost.
>>
>> Signed-off-by: Jian Liu <jian.liu@windriver.com>
>> ---
>> meta/recipes-extended/logrotate/logrotate_3.8.7.bb | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
>> index faa8e02..8b39602 100644
>> --- a/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
>> +++ b/meta/recipes-extended/logrotate/logrotate_3.8.7.bb
>> @@ -54,3 +54,5 @@ do_install(){
>> install -p -m 755 examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
>> touch ${D}${localstatedir}/lib/logrotate.status
>> }
>> +
>> +CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status"
> Part of me thinks this shouldn't be an installed file at all; instead
> it should be created by a post install script if it doesn't already
> exist. Thoughts?
It does be contained in rpm package and generated during installation
though it is empty.
It is not created when logrotate is running.
I test it on our WRL6.0 and WRL7.0
So if you update logrotate, logrotate.status will be overwritten during
installation.
All previous status may be lost.
//Liu Jian
>
>> --
>> 1.8.5.2.233.g932f7e4
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
--
Jian Liu
Email: jian.liu@windriver.com
Office Phone: 86-10-84778539
[-- Attachment #2: Type: text/html, Size: 3145 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/5] logrotate: files will be over written when updating using rpm
2014-11-19 17:54 ` Dan McGregor
2014-11-20 2:11 ` Liu Jian
@ 2014-11-20 20:37 ` Burton, Ross
1 sibling, 0 replies; 13+ messages in thread
From: Burton, Ross @ 2014-11-20 20:37 UTC (permalink / raw)
To: Dan McGregor; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 410 bytes --]
On 19 November 2014 17:54, Dan McGregor <danismostlikely@gmail.com> wrote:
> > +CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status"
>
> Part of me thinks this shouldn't be an installed file at all; instead
> it should be created by a post install script if it doesn't already
> exist. Thoughts?
Agreed - a file in /var/lib doesn't sound sensible considering it's often
on a tmpfs.
Ross
[-- Attachment #2: Type: text/html, Size: 821 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/5] base-files: files will be over written when updating using rpm
2014-11-14 9:43 ` [PATCH 1/5] base-files: files will be over written when updating using rpm Jian Liu
@ 2014-11-20 20:37 ` Burton, Ross
2014-11-21 2:06 ` Liu Jian
2014-11-21 2:23 ` ChenQi
2014-11-20 20:40 ` Burton, Ross
1 sibling, 2 replies; 13+ messages in thread
From: Burton, Ross @ 2014-11-20 20:37 UTC (permalink / raw)
To: Jian Liu; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 296 bytes --]
On 14 November 2014 09:43, Jian Liu <jian.liu@windriver.com> wrote:
> +CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf
> ${sysconfdir}/profile"
>
I do have to wonder why we don't allow globs in CONFFILES and set
CONFFILES_${PN} to ${sysconfdir} by default...
Ross
[-- Attachment #2: Type: text/html, Size: 697 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/5] base-files: files will be over written when updating using rpm
2014-11-14 9:43 ` [PATCH 1/5] base-files: files will be over written when updating using rpm Jian Liu
2014-11-20 20:37 ` Burton, Ross
@ 2014-11-20 20:40 ` Burton, Ross
1 sibling, 0 replies; 13+ messages in thread
From: Burton, Ross @ 2014-11-20 20:40 UTC (permalink / raw)
To: Jian Liu; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 617 bytes --]
On 14 November 2014 09:43, Jian Liu <jian.liu@windriver.com> wrote:
> If there is no %config micro before the file in the spec file,
> this file will be over-written after updating this package
> using rpm.
> This will make our settings lost.
>
Whilst this commit message is accurate for your situation, it's actually
not just rpm - the same behaviour will happen with opkg and dpkg.
Please resend the patches with a commit message along the lines of "Use
CONFFILES to mark configuration files as such". This isn't rpm-specific
behaviour and it's misleading to state that in the commit log.
Ross
[-- Attachment #2: Type: text/html, Size: 1110 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/5] base-files: files will be over written when updating using rpm
2014-11-20 20:37 ` Burton, Ross
@ 2014-11-21 2:06 ` Liu Jian
2014-11-21 2:23 ` ChenQi
1 sibling, 0 replies; 13+ messages in thread
From: Liu Jian @ 2014-11-21 2:06 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 1358 bytes --]
于 2014年11月21日 04:37, Burton, Ross 写道:
>
> On 14 November 2014 09:43, Jian Liu <jian.liu@windriver.com
> <mailto:jian.liu@windriver.com>> wrote:
>
> +CONFFILES_${PN} += "${sysconfdir}/motd
> ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile"
>
>
> I do have to wonder why we don't allow globs in CONFFILES and set
> CONFFILES_${PN} to ${sysconfdir} by default...
>
> Ross
>
We wanted to deal with all editable files including config files(maybe
under /etc), scripts files and so on. Because they may be changed sometime.
But we find that not all files are necessary to handle. For example,
>>>> base-files /etc/motd
I'd expect the above to be changed...but not...
>>>> libpam-runtime: /etc/pam.d/common-account
>>>> /etc/pam.d/common-auth
>>>> /etc/pam.d/common-password
>>>> /etc/pam.d/common-session
>>>> /etc/pam.d/common-session-noninteractive
The key thing for conf files is, is this an action a system
administrator is likely to do? for motd yes it is.. for pam
configurations, not likely.. the operating system developer is the one
who would make these changes.
This patch just handles files that we think should be protected currently.
--
Jian Liu
Email: jian.liu@windriver.com
Office Phone: 86-10-84778539
[-- Attachment #2: Type: text/html, Size: 2933 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/5] base-files: files will be over written when updating using rpm
2014-11-20 20:37 ` Burton, Ross
2014-11-21 2:06 ` Liu Jian
@ 2014-11-21 2:23 ` ChenQi
1 sibling, 0 replies; 13+ messages in thread
From: ChenQi @ 2014-11-21 2:23 UTC (permalink / raw)
To: openembedded-core, Burton, Ross
[-- Attachment #1: Type: text/plain, Size: 993 bytes --]
On 11/21/2014 04:37 AM, Burton, Ross wrote:
>
> On 14 November 2014 09:43, Jian Liu <jian.liu@windriver.com
> <mailto:jian.liu@windriver.com>> wrote:
>
> +CONFFILES_${PN} += "${sysconfdir}/motd
> ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile"
>
>
> I do have to wonder why we don't allow globs in CONFFILES and set
> CONFFILES_${PN} to ${sysconfdir} by default...
>
> Ross
>
>
>
Hi Ross,
There's a related bug on bugzilla.
https://bugzilla.yoctoproject.org/show_bug.cgi?id=5200
I sent out a patch some time ago about this problem. The patch titile is
"[OE-core] [PATCH 0/2] Change the way of handling CONFFILES".
I think setting CONFFILES to be ${sysconfdir} and allowing overriding
might be better than listing each file in CONFFILES in each individual
recipe.
There's more information in the comment of the bug. If you agree with
this solution, I can rebase the patch and send out V2.
What do you think?
Best Regards,
Chen Qi
[-- Attachment #2: Type: text/html, Size: 2460 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2014-11-21 2:23 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-14 9:43 [PATCH 0/6] Avoid config files being overwritten Jian Liu
2014-11-14 9:43 ` [PATCH 1/5] base-files: files will be over written when updating using rpm Jian Liu
2014-11-20 20:37 ` Burton, Ross
2014-11-21 2:06 ` Liu Jian
2014-11-21 2:23 ` ChenQi
2014-11-20 20:40 ` Burton, Ross
2014-11-14 9:43 ` [PATCH 2/5] initscripts: " Jian Liu
2014-11-14 9:43 ` [PATCH 3/5] logrotate: " Jian Liu
2014-11-19 17:54 ` Dan McGregor
2014-11-20 2:11 ` Liu Jian
2014-11-20 20:37 ` Burton, Ross
2014-11-14 9:43 ` [PATCH 4/5] libpam: " Jian Liu
2014-11-14 9:43 ` [PATCH 5/5] nfs-utils: " Jian Liu
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.