From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1S87DF-0003B9-FT for ptxdist@pengutronix.de; Thu, 15 Mar 2012 10:43:13 +0100 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1S87DF-0003O0-EL for ptxdist@pengutronix.de; Thu, 15 Mar 2012 10:43:13 +0100 Date: Thu, 15 Mar 2012 10:43:13 +0100 From: Michael Olbrich Message-ID: <20120315094313.GN20481@pengutronix.de> References: <1331737848-8231-1-git-send-email-benoit.burnichon@airtag.com> <4F6108DA.2000002@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4F6108DA.2000002@gmail.com> Subject: Re: [ptxdist] [PATCH] Change some install_alternative to install_config Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Wed, Mar 14, 2012 at 04:08:42PM -0500, George McCollister wrote: > On 03/14/2012 10:10 AM, Beno=EEt Burnichon wrote: > >To avoid loss of configuration when upgrading packages with default > >configurations. > This is a tricky subject. On some embedded systems it may be > expected for a user or configuration utility to change some configs > while not other configs. On some embedded systems it may be > impossible (or unlikely) for the user to modify configurations. > = > When a package is upgraded sometimes new configuration options are > added and sometimes they are deleted, sometimes the format of the > configuration is changed entirely or moved to a different location. > Other times the upgrade is just a maintenance release and only > contains minor fixes. > = > If you mark a file as a config file by default opkg won't upgrade > that file during a package upgrade, even if the user never made any > modifications. At this point you are basically deciding to leave the > original file unchanged and putting the burden of merging old and > new config files on the user. Exactly, and last time I checked opkg didn't have a way to forcefully overwrite the old config file without prompting. > We've dealt with this by leaving install_alternative for all config > files by default and only making custom rules with install_config > for files we intend for users to change. For our device it makes > sense for instance that a user may want to modify ntp.conf to add an > ntp time source (we provide a web based utility to do this), yet it > makes no sense for a user to change the dbus configuration. If > during the course of a version upgrade a configuration option is > renamed, eliminated or added, we provide a .postinstall script to > modify the user configuration and make the required changes so the > user doesn't end up with a broken device. > = > Ultimately I think a better frame work is needed to handle > management of configs. Suppose your user wants to backup his > device's configuration files to a PC. Then suppose said user's > device is burnt to a crisp when lightning strikes an improperly > arrested antenna (this has happened). He orders replacement but it > arrives with new firmware. He sends his backed up config files to it > from a and it doesn't work because the name of a setting in one of > the config files changed. > = > Ideally you could provide a single script to migrate a config file > from one package version to another. This script could be used when > the package is upgraded OR when users send configuration files to > the device. An idea I just had: maybe introduce a new install_* command. And then, depending on an option in ptxconfig, install the file as a config file or not. Also, you'll need to create individual patches for each package, and the current patch contains far too many files that are certainly not meant to be changed by the user. Michael -- = Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- = ptxdist mailing list ptxdist@pengutronix.de