[oe] [PATCH 3/3] base-files-3.0.14 configuration files

Peter Gsellmann pgsellmann at portner-elektronik.at
Fri Mar 18 13:08:15 UTC 2011


Am Freitag, 18. März 2011, 09:59:17 schrieb Hauser, Wolfgang (external):
> >> > Mark some files in ${sysconfdir} as configuration files so they are
> >> not blindly overwritten when upgrading
> >> 
> >> I would suggest a pre-/post processing in the packages, like debian
> >> does.
> >> If a config file exists or is changed, the current File will be
> rotated
> >> or, if possible, left as it is and the new 
> >> file is installed beside the changed one.
> 
> >The opkg does not touch a present config file, but installs the new
> file with the name *-opkg
> >So if you do a find /etc -name \*-opkg you see the conflicts.
> 
> >Any sensible conversion from old to new config file should be made by
> the package itself.
> 
> As I experienced, opkg exits with an error code if a config file already
> exists, so if you want to create an image, the process will break at
> that error.
> It wasn't possible to create an image automatically then.
If you create a fresh new image, the config files should not exist.
opkg should not complain.

Problem arises if you do a 'opkg upgrade' from the running target;
With patch, opkg knows about Conffiles of base-files:
root at us-3:~# opkg info base-files
Package: base-files
Version: 3.0.14-r101.9
Provides:
Status: install user installed
Section: base
Architecture: pcontrol_g20
Maintainer: Angstrom Developers <angstrom-distro-devel at linuxtogo.org>
MD5Sum: d5553232d20233866c7f626b7f1d6d4f
Size: 4336
Filename: base-files_3.0.14-r101.9_pcontrol_g20.ipk
Conffiles:
 /etc/fstab 8a0d747a1565dfb39ae3b27b33ab5031
 /etc/hostname 0e97f4187e8f27c48206165806f9310a
 /etc/motd d41d8cd98f00b204e9800998ecf8427e
 /etc/profile 573d43f3c53d5bdabca7ec2317f5eb28
 /etc/nsswitch.conf 109e33e2c91d1853b5bc56078a96aa18
 /etc/host.conf a61b9f6548d337c1cc1e5a4de39f7b7f
Source: file://nsswitch.conf file://motd file://inputrc file://host.conf file://profile file://profile.d file://fstab file://filesystems file://issue.net file://issue file://usbd file://share/dot.bashrc file://share/dot.profile file://licenses/BSD file://licenses/GPL-2 file://licenses/GPL-3 file://licenses/LGPL-2 file://licenses/LGPL-2.1 file://licenses/LGPL-3 file://licenses/GFDL-1.2 file://licenses/Artistic
Description: Miscellaneous files for the base system.
Installed-Time: 1300270958


As you can see, opkg maintains some md5-hash value for the unchanged Conffile so a sensible conflict resolution is possible.
If it is not done so, its a opkg bug

Tested: it is possible to create an image with this patch.
Tested: 'opkg upgrade' handles the Conffiles as expected.

Peter




More information about the Openembedded-devel mailing list