![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package yast2-installation checked in at Thu Aug 14 03:21:11 CEST 2008. -------- --- yast2-installation/yast2-installation.changes 2008-08-08 10:25:58.000000000 +0200 +++ yast2-installation/yast2-installation.changes 2008-08-12 13:05:55.000000000 +0200 @@ -1,0 +2,21 @@ +Tue Aug 12 10:28:24 CEST 2008 - locilka@suse.cz + +- Added documentation and example for list of files to be copied + from the previous installation. +- 2.17.4 + +------------------------------------------------------------------- +Mon Aug 11 17:35:47 CEST 2008 - locilka@suse.cz + +- List of files to be copied from the previous installation moved + to control file, added new API to define own list (module + SystemFilesCopy) (FATE #305019). +- Adapted control files. + +------------------------------------------------------------------- +Mon Aug 11 10:06:02 CEST 2008 - locilka@suse.cz + +- Fixed WFM::Execute to use .local instead of .target in + copy_files_finish script. + +------------------------------------------------------------------- Old: ---- yast2-installation-2.17.3.tar.bz2 New: ---- yast2-installation-2.17.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-installation.spec ++++++ --- /var/tmp/diff_new_pack.C31141/_old 2008-08-14 03:20:40.000000000 +0200 +++ /var/tmp/diff_new_pack.C31141/_new 2008-08-14 03:20:40.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package yast2-installation (Version 2.17.3) +# spec file for package yast2-installation (Version 2.17.4) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,12 +19,12 @@ Name: yast2-installation -Version: 2.17.3 +Version: 2.17.4 Release: 1 License: GPL v2 or later Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-installation-2.17.3.tar.bz2 +Source0: yast2-installation-2.17.4.tar.bz2 Prefix: /usr BuildRequires: docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer sgml-skel update-desktop-files yast2-core-devel yast2-devtools yast2-testsuite # PackageCallbacks::RegisterEmptyProgressCallbacks() @@ -114,7 +114,7 @@ Lukas Ocilka <locilka@suse.cz> %prep -%setup -n yast2-installation-2.17.3 +%setup -n yast2-installation-2.17.4 %build %{prefix}/bin/y2tool y2autoconf @@ -180,6 +180,18 @@ %exclude %{prefix}/share/doc/packages/yast2-installation/COPYING %exclude %{prefix}/share/doc/packages/yast2-installation/README %changelog +* Tue Aug 12 2008 locilka@suse.cz +- Added documentation and example for list of files to be copied + from the previous installation. +- 2.17.4 +* Mon Aug 11 2008 locilka@suse.cz +- List of files to be copied from the previous installation moved + to control file, added new API to define own list (module + SystemFilesCopy) (FATE #305019). +- Adapted control files. +* Mon Aug 11 2008 locilka@suse.cz +- Fixed WFM::Execute to use .local instead of .target in + copy_files_finish script. * Thu Aug 07 2008 locilka@suse.cz - Added new client inst_scenarios to offer main scenarios of the newly installed system. ++++++ yast2-installation-2.17.3.tar.bz2 -> yast2-installation-2.17.4.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.17.3/configure new/yast2-installation-2.17.4/configure --- old/yast2-installation-2.17.3/configure 2008-08-04 16:40:49.000000000 +0200 +++ new/yast2-installation-2.17.4/configure 2008-08-12 13:06:23.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for yast2-installation 2.17.2. +# Generated by GNU Autoconf 2.61 for yast2-installation 2.17.4. # # Report bugs to <http://bugs.opensuse.org/>. # @@ -574,8 +574,8 @@ # Identity of this package. PACKAGE_NAME='yast2-installation' PACKAGE_TARNAME='yast2-installation' -PACKAGE_VERSION='2.17.2' -PACKAGE_STRING='yast2-installation 2.17.2' +PACKAGE_VERSION='2.17.4' +PACKAGE_STRING='yast2-installation 2.17.4' PACKAGE_BUGREPORT='http://bugs.opensuse.org/' ac_unique_file="RPMNAME" @@ -1208,7 +1208,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures yast2-installation 2.17.2 to adapt to many kinds of systems. +\`configure' configures yast2-installation 2.17.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1279,7 +1279,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of yast2-installation 2.17.2:";; + short | recursive ) echo "Configuration of yast2-installation 2.17.4:";; esac cat <<\_ACEOF @@ -1357,7 +1357,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -yast2-installation configure 2.17.2 +yast2-installation configure 2.17.4 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1371,7 +1371,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by yast2-installation $as_me 2.17.2, which was +It was created by yast2-installation $as_me 2.17.4, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2192,7 +2192,7 @@ # Define the identity of the package. PACKAGE='yast2-installation' - VERSION='2.17.2' + VERSION='2.17.4' cat >>confdefs.h <<_ACEOF @@ -2420,7 +2420,7 @@ -VERSION="2.17.2" +VERSION="2.17.4" RPMNAME="yast2-installation" MAINTAINER="Lukas Ocilka <locilka@suse.cz>" @@ -3563,7 +3563,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by yast2-installation $as_me 2.17.2, which was +This file was extended by yast2-installation $as_me 2.17.4, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3606,7 +3606,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -yast2-installation config.status 2.17.2 +yast2-installation config.status 2.17.4 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.17.3/configure.in new/yast2-installation-2.17.4/configure.in --- old/yast2-installation-2.17.3/configure.in 2008-08-04 16:40:46.000000000 +0200 +++ new/yast2-installation-2.17.4/configure.in 2008-08-12 13:06:20.000000000 +0200 @@ -1,9 +1,9 @@ dnl configure.in for yast2-installation dnl -dnl -- This file is generated by y2autoconf 2.17.6 - DO NOT EDIT! -- +dnl -- This file is generated by y2autoconf 2.17.5 - DO NOT EDIT! -- dnl (edit configure.in.in instead) -AC_INIT(yast2-installation, 2.17.2, http://bugs.opensuse.org/, yast2-installation) +AC_INIT(yast2-installation, 2.17.4, http://bugs.opensuse.org/, yast2-installation) dnl Check for presence of file 'RPMNAME' AC_CONFIG_SRCDIR([RPMNAME]) @@ -18,7 +18,7 @@ AM_INIT_AUTOMAKE(tar-ustar -Wno-portability) dnl Important YaST2 variables -VERSION="2.17.2" +VERSION="2.17.4" RPMNAME="yast2-installation" MAINTAINER="Lukas Ocilka <locilka@suse.cz>" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.17.3/control/docs/control-section.xml new/yast2-installation-2.17.4/control/docs/control-section.xml --- old/yast2-installation-2.17.3/control/docs/control-section.xml 2008-08-07 17:13:57.000000000 +0200 +++ new/yast2-installation-2.17.4/control/docs/control-section.xml 2008-08-12 10:28:12.000000000 +0200 @@ -429,6 +429,54 @@ </itemizedlist> </section> + <!-- FATE #305019: configure the files to copy from a previous installation --> + <!-- FATE #300421: Import ssh keys from previous installations --> + <!-- FATE #120103: Import Users From Existing Partition --> + <section id="control_globals_copy_to_system"> + <title>Importing Files from Previous Installation</title> + + <para>Even if users are performing new reinstallation of their system, installation + process can backup some files or directories before their disks are formatted and + restore them after the installation. For instance, SSH keys are reused.</para> + + <para>Typically, there is only one system previously installed, if there are more + systems, the one with the newest access time to required files is chosen.</para> + + <para>See the example:</para> + <programlisting> + <xi:include href="examples/globals-copy_to_system.xml" parse="text" + xmlns:xi="http://www.w3.org/2001/XInclude"/> + </programlisting> + + <para>In the <emphasis>globals</emphasis> section, there is a + <emphasis>copy_to_system</emphasis> list of <emphasis>copy_to_system_item</emphasis> + entries.</para> + + <para>Every <emphasis>copy_to_system_item</emphasis> entry consists of:</para> + + <itemizedlist> + <listitem> + <para>(string) <emphasis>copy_to_dir</emphasis> - files are finally + stored into the mentioned directory, they additionally keep their + path in the previous filesystem, e.g., file <emphasis>/etc/file</emphasis> + copied to directory <emphasis>/var/lib/YaST2/</emphasis> will be finally + stored as <emphasis>/var/lib/YaST2/etc/file</emphasis></para> + </listitem> + <listitem> + <para>(list) <emphasis>mandatory_files</emphasis> - list of (string) + <emphasis>file_item</emphasis> entries, one entry for one file or + directory; these files are mandatory and must all exist on the source + system; if any of the files are missing, such system is skipped</para> + </listitem> + <listitem> + <para>(list) <emphasis>optional_files</emphasis> - list of (string) + <emphasis>file_item</emphasis> entries, one entry for one file or + directory; files are optional and are copied if they exist; missing + files are skipped</para> + </listitem> + </itemizedlist> + </section> + <!-- FATE #303939: Enable redetection of hardware at customer first boot --> <section id="control_globals_automatic_configuration"> <title>Automatic Configuration</title> diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.17.3/control/docs/examples/globals-copy_to_system.xml new/yast2-installation-2.17.4/control/docs/examples/globals-copy_to_system.xml --- old/yast2-installation-2.17.3/control/docs/examples/globals-copy_to_system.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-installation-2.17.4/control/docs/examples/globals-copy_to_system.xml 2008-08-12 10:14:19.000000000 +0200 @@ -0,0 +1,43 @@ + + <globals> + <copy_to_system config:type="list"> + <copy_to_system_item> + <!-- Files are restored directly to "/" after installation --> + <copy_to_dir>/</copy_to_dir> + + <!-- Files that must be all present on the previous system --> + <mandatory_files config:type="list"> + <file_item>/etc/ssh/ssh_host_key</file_item> + <file_item>/etc/ssh/ssh_host_key.pub</file_item> + </mandatory_files> + + <!-- Files thay may be present and are used if exist --> + <optional_files config:type="list"> + <file_item>/etc/ssh/ssh_host_dsa_key</file_item> + <file_item>/etc/ssh/ssh_host_dsa_key.pub</file_item> + <file_item>/etc/ssh/ssh_host_rsa_key</file_item> + <file_item>/etc/ssh/ssh_host_rsa_key.pub</file_item> + </optional_files> + </copy_to_system_item> + + <copy_to_system_item> + <!-- + Files are restored to a special directory + (and used by YaST later) + --> + <copy_to_dir>/var/lib/YaST2/imported/userdata/</copy_to_dir> + + <!-- + They finally appear as + "/var/lib/YaST2/imported/userdata/etc/shadow" + "/var/lib/YaST2/imported/userdata/etc/passwd" ... + --> + <mandatory_files config:type="list"> + <file_item>/etc/shadow</file_item> + <file_item>/etc/passwd</file_item> + <file_item>/etc/login.defs</file_item> + <file_item>/etc/group</file_item> + </mandatory_files> + </copy_to_system_item> + </copy_to_system> + </globals> diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.17.3/src/clients/copy_files_finish.ycp new/yast2-installation-2.17.4/src/clients/copy_files_finish.ycp --- old/yast2-installation-2.17.3/src/clients/copy_files_finish.ycp 2008-07-14 18:09:00.000000000 +0200 +++ new/yast2-installation-2.17.4/src/clients/copy_files_finish.ycp 2008-08-11 10:06:59.000000000 +0200 @@ -8,7 +8,7 @@ * Authors: * Jiri Srain <jsrain@suse.cz> * - * $Id: copy_files_finish.ycp 49074 2008-07-14 16:08:59Z locilka $ + * $Id: copy_files_finish.ycp 49908 2008-08-11 08:06:59Z locilka $ * */ @@ -191,7 +191,7 @@ string license_file = "/license.tar.gz"; // Copy licenses so it can be used in firstboot later // bnc #396976 - map cmd = (map) WFM::Execute (.target.bash_output, + map cmd = (map) WFM::Execute (.local.bash_output, sformat ( "mkdir -p '%1' && cd '%1' && rm -rf license*.txt; tar -xf '%2'", String::Quote (license_dir), diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.17.3/src/clients/inst_pre_install.ycp new/yast2-installation-2.17.4/src/clients/inst_pre_install.ycp --- old/yast2-installation-2.17.3/src/clients/inst_pre_install.ycp 2008-06-03 13:44:43.000000000 +0200 +++ new/yast2-installation-2.17.4/src/clients/inst_pre_install.ycp 2008-08-11 17:41:07.000000000 +0200 @@ -3,6 +3,9 @@ import "FileUtils"; import "Directory"; import "SystemFilesCopy"; + import "ProductFeatures"; + import "ProductControl"; + import "InstData"; // --> Functions @@ -17,34 +20,46 @@ // all partitions that can be used as a list <map <string, any> > useful_partitions = []; - list <symbol> possible_root_fs = [ `ext2, `ext3, `reiser, `xfs, `jfs ]; + list <symbol> possible_root_fs = [ `ext2, `ext3, `ext4, `reiser, `xfs, `jfs ]; /* ******************************************************************************* */ // --> main() Initialize(); - // FATE #300421: Import ssh keys from previous installations - FindAndCopyNewestFiles ( - "/", - // required - ["/etc/ssh/ssh_host_key", "/etc/ssh/ssh_host_key.pub"], - // optional - ["/etc/ssh/ssh_host_dsa_key", "/etc/ssh/ssh_host_dsa_key.pub", "/etc/ssh/ssh_host_rsa_key", "/etc/ssh/ssh_host_rsa_key.pub"] - ); - - // FATE #120103: Import Users From Existing Partition - FindAndCopyNewestFiles ( - sformat ("%1/imported/userdata", Directory::vardir), - ["/etc/shadow", "/etc/passwd", "/etc/login.defs", "/etc/group"], - [] - ); + if (SystemFilesCopy::GetUseControlFileDef()) { + y2milestone ("Using copy_to_system from control file"); + + // FATE #305019: configure the files to copy from a previous installation + // -> configuration moved to control file + list <map> copy_items = (list <map>) ProductFeatures::GetFeature ("globals", "copy_to_system"); + + foreach (map one_copy_item, copy_items, { + string copy_to_dir = tostring (one_copy_item["copy_to_dir"]:Directory::vardir); + list <string> mandatory_files = (list <string>) one_copy_item["mandatory_files"]:[]; + list <string> optional_files = (list <string>) one_copy_item["optional_files"]:[]; + + FindAndCopyNewestFiles (copy_to_dir, mandatory_files, optional_files); + }); + } + + if (SystemFilesCopy::GetCopySystemFiles() != []) { + y2milestone ("Using additional copy_to_system"); + + foreach (map one_copy_item, SystemFilesCopy::GetCopySystemFiles(), { + string copy_to_dir = tostring (one_copy_item["copy_to_dir"]:Directory::vardir); + list <string> mandatory_files = (list <string>) one_copy_item["mandatory_files"]:[]; + list <string> optional_files = (list <string>) one_copy_item["optional_files"]:[]; + + FindAndCopyNewestFiles (copy_to_dir, mandatory_files, optional_files); + }); + } // free the memory useful_partitions = nil; // at least some return - return `a_glass_of_milk_please; + return `auto; // <-- main() /* ******************************************************************************* */ @@ -113,8 +128,8 @@ if (am_exit != 0) { y2warning ("%1 is already mounted, trying to umount...", mnt_tmpdir); - integer umount = (integer) SCR::Execute (.target.umount, mnt_tmpdir); - if (umount != 0) { + boolean umount = (boolean) SCR::Execute (.target.umount, mnt_tmpdir); + if (umount != true) { y2error ("Cannot umount %1", mnt_tmpdir); } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.17.3/src/modules/InstData.ycp new/yast2-installation-2.17.4/src/modules/InstData.ycp --- old/yast2-installation-2.17.3/src/modules/InstData.ycp 2008-05-19 09:24:16.000000000 +0200 +++ new/yast2-installation-2.17.4/src/modules/InstData.ycp 2008-08-11 16:03:14.000000000 +0200 @@ -58,5 +58,14 @@ // <-- other + // --> copy files -- config + // FATE #305019: configure the files to copy from a previous installation + + global boolean copy_files_use_control_file = true; + + global list <map> additional_copy_files = []; + + // <-- copy files -- config + /* EOF */ } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.17.3/src/modules/SystemFilesCopy.ycp new/yast2-installation-2.17.4/src/modules/SystemFilesCopy.ycp --- old/yast2-installation-2.17.3/src/modules/SystemFilesCopy.ycp 2008-04-17 11:08:36.000000000 +0200 +++ new/yast2-installation-2.17.4/src/modules/SystemFilesCopy.ycp 2008-08-11 17:35:01.000000000 +0200 @@ -21,7 +21,7 @@ import "Installation"; import "ProductFeatures"; import "Stage"; - + import "InstData"; // --> Variables @@ -158,7 +158,7 @@ // 'ignore failed read' is for optional files // but needs to be entered after the archive name // bugzilla #326055 - "cd '%1'; tar -zcvf '%2' --ignore-failed-read %3", + "cd '%1'; tar --recursion -zcvf '%2' --ignore-failed-read %3", tmp_mount_directory, String::Quote(archive_name), archive_files ); map cmd_run = (map) SCR::Execute(.target.bash_output, command); @@ -342,5 +342,93 @@ return true; } + // FATE #305019: configure the files to copy from a previous installation + // --> + + /** + * Sets whether copy_files from control file should be used + * + * @returns boolean whether to use them + * @see SetUseControlFileDef + */ + global boolean GetUseControlFileDef () { + return (InstData::copy_files_use_control_file == true); + } + + /** + * Sets whether to use copy_files from control file + * + * @param boolean whether to use them + * @see GetUseControlFileDef + */ + global void SetUseControlFileDef (boolean new_value) { + if (new_value == nil) { + y2error ("Wrong value: %1", new_value); + return; + } + + InstData::copy_files_use_control_file = new_value; + y2milestone ("Using copy_to_system from control file set to: %1", new_value); + } + + /** + * Returns list of copy_files definitions + * @see SetCopySystemFiles for more info + */ + global list <map> GetCopySystemFiles () { + return InstData::additional_copy_files; + } + + /** + * Sets new rules which files will be copied during installation. + * + * @see FATE #305019: configure the files to copy from a previous installation + * @param list <map> of new definitions + * + * @struct + * [ + * "copy_to_dir" : (string) "system_directory_to_copy_to", + * "mandatory_files" : (list <string>) [ list of mandatory files ], + * "optional_files" : (list <string>) [ list of optional files ], + * ] + * + * @example + * SetCopySystemFiles ([ + * $["copy_to_dir":"/root/backup", "mandatory_files":["/etc/passwd", "/etc/shadow"]] + * $["copy_to_dir":"/root/backup", "mandatory_files":["/etc/ssh/ssh_host_dsa_key"], "optional_files":["/etc/ssh/ssh_host_rsa_key.pub"]] + * ]) + */ + global void SetCopySystemFiles (list <map> new_copy_files) { + InstData::additional_copy_files = []; + + boolean use_item = true; + + foreach (map one_copy_item, new_copy_files, { + string copy_to_dir = tostring (one_copy_item["copy_to_dir"]:Directory::vardir); + if (copy_to_dir == nil || copy_to_dir == "") { + y2error ("(string) 'copy_to_dir' must be defined"); + use_item = false; + } + + list <string> mandatory_files = (list <string>) one_copy_item["mandatory_files"]:[]; + if (mandatory_files == nil || mandatory_files == []) { + y2error ("(list <string>) 'mandatory_files' must be defined"); + use_item = false; + } + + list <string> optional_files = (list <string>) one_copy_item["optional_files"]:[]; + if (optional_files == nil) { + y2error ("(list <string>) 'optional_files' wrong definition"); + use_item = false; + } + + if (use_item) { + InstData::additional_copy_files = add (InstData::additional_copy_files, one_copy_item); + } + }); + } + + // <-- + /* EOF */ } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-installation-2.17.3/VERSION new/yast2-installation-2.17.4/VERSION --- old/yast2-installation-2.17.3/VERSION 2008-08-08 10:26:40.000000000 +0200 +++ new/yast2-installation-2.17.4/VERSION 2008-08-12 13:06:01.000000000 +0200 @@ -1 +1 @@ -2.17.3 +2.17.4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org