On Tue, Mar 01, 2011 at 09:42:10AM +0100, Jean-Noël Avila wrote: > Le lundi 28 février 2011 19:33:57 Benoît Burnichon, vous avez écrit : > > > > How could I tell ipkg not to overwrite the already present configuration > > files? I know there is an option when building ipkgs to indicate that > > files are config ones (conffiles in CONTROL directory of the ipk). And how > > to indicate ptxdist that there are some prerm, postrm, preinst and > > postinst scripts? > > To add files to conffile, we created new make macros (ptxdist 1.x): > > # > # install_control > # > # Installs a file in the control section of the package > # > # > # $1: packet label > # $2: source > # $3: destination file, either preinst, postinst, prerm or postrm > # > install_control = > \ [...]
With the current ptxdist installing control files is already possible. Just add rules/<pkg>.preinst etc. Where '<pkg>' is the package name used in '$(call install_init, <pkg>)'. > # > # install_conffile > # > # Flags a file as a configuration file in package > # This enables updating a packet without overwriting existing > # configuration > # > # > # $1: packet label > # $2: dest > # > install_conffile = > \ > PKG=$(strip $(1)); > \ > DST=$(strip $(2)); > \ > echo "install_conffile:"; > \ > echo " dst=$$DST"; > \ > grep $$DST $(IMAGEDIR)/$$PKG/ipkg/CONTROL/conffiles || > \ > echo $$DST >> $(IMAGEDIR)/$$PKG/ipkg/CONTROL/conffiles; > \ > if [ $$? -ne 0 ]; then > \ > echo "Error: install_conffile failed : " $$?; > \ > exit 1; > \ > fi; > \ > echo "done"; The handling of install_* macros has changed alot. This won't work anymore. Hmmm, this means two install_* calls for each config file. I'd make install_conffile a install_alternative + flagging. > The point is that updating a packet basically boils down to uninstalling the > old one and installing the new one. In this case, the modified conf files are > not preserved. > > We did not face the issue of preserving modified files, as the first upgrade > we needed to do was to introduce the ability to modify some conf files which > were static before. What's the exact handling of config files? What happen on update (with/without modified config files)? How are modifications detected? Regards, Michael Olbrich -- 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 [email protected]
