![](https://seccdn.libravatar.org/avatar/2f8a5b55b74eb727b5ee47fed82a1454.jpg?s=120&d=mm&r=g)
Author: ug
Date: Fri Apr 3 13:08:57 2009
New Revision: 56615
URL: http://svn.opensuse.org/viewcvs/yast?rev=56615&view=rev
Log:
postpartitioning script invented
Modified:
trunk/autoinstallation/doc/CreateProfileDetails.xml
trunk/autoinstallation/doc/examples/example.scripts.xml
trunk/autoinstallation/package/autoyast2.changes
trunk/autoinstallation/src/clients/inst_autoimage.ycp
trunk/autoinstallation/src/modules/AutoinstScripts.ycp
Modified: trunk/autoinstallation/doc/CreateProfileDetails.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/doc/CreateProfileDetails.xml?rev=56615&r1=56614&r2=56615&view=diff
==============================================================================
--- trunk/autoinstallation/doc/CreateProfileDetails.xml (original)
+++ trunk/autoinstallation/doc/CreateProfileDetails.xml Fri Apr 3 13:08:57 2009
@@ -2051,12 +2051,13 @@
installation.
</para>
<para>
- In the auto-installation process, four types of scripts can be executed and they
+ In the auto-installation process, five types of scripts can be executed and they
will be described here in order of "appearance" during the installation.
</para>
<para>
<itemizedlist>
<listitem><emphasis>pre-scripts</emphasis> (very early, before anything else really happened)</listitem>
+ <listitem><emphasis>postpartitioning-scripts</emphasis> (after partitioning and mounting to /mnt but before RPM installation - since openSUSE 11.2)</listitem>
<listitem><emphasis>chroot-scripts</emphasis> (after the package installation, before the first boot)</listitem>
<listitem><emphasis>post-scripts</emphasis> (during the first boot of the installed system, no services running)</listitem>
<listitem><emphasis>init-scripts</emphasis> (during the first boot of the installed system, all servies up and running)</listitem>
@@ -2153,6 +2154,85 @@
</table>
</para>
</section>
+
+ <section id="postpartitioning-install.scripts">
+ <title>Postpartitioning Scripts</title>
+ <note>
+ <para>Available starting from openSUSE 11.2 only (not SLES11).</para>
+ </note>
+ <para>
+ Executed after &yast2; did the partitioning and wrote the fstab. The empty system is mounted to /mnt already.
+ This type of script is available since openSUSE 11.2 (not SLES11).
+ </para>
+ <para>
+ The following elements must be between the <postpartitioning-scripts config:type="list"><script> ... </script></postpartitioning-sripts> tags
+ </para>
+ <para>
+ <table frame='top'>
+ <title>postpartitioning script XML representation</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Description</entry>
+ <entry>Comment</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>location</entry>
+ <entry>you can define a location from where the script gets fetched.
+ Locations can be the same like for the profile (http,ftp,nfs,...).
+ <para><screen><location>http://10.10.0.1/myScript.sh</location></screen></para></entry>
+ <entry>either <location> or <source> must be defined</entry>
+ </row>
+ <row>
+ <entry>source</entry>
+ <entry>the script itself. The source code of the script if you want so. Encapsulated in a CDATA tag. If you don't want
+ to put the whole shell script into the XML profile, look at the location parameter.
+
+ <para><screen><source>
+<![CDATA[
+echo "Testing postpart script" > /mnt/postpart_test.txt
+]]>
+</source></screen></para></entry>
+ <entry>Either <location> or <source> must be defined</entry>
+ </row>
+ <row>
+ <entry>interpreter</entry>
+ <entry>the interpreter that must be used for the script. Supported options are shell and perl.
+ <para><screen><interpreter>perl</interpreter></screen></para></entry>
+ <entry>optional (default is shell)</entry>
+ </row>
+ <row>
+ <entry>filename</entry>
+ <entry>the filename of the script. It will be stored in a temporary directory under /tmp/...
+ <para><screen><filename>myScript5.sh</filename></screen></para></entry>
+ <entry>optional. The default is the type of the script (pre-scripts) in this case</entry>
+ </row>
+ <row>
+ <entry>feedback</entry>
+ <entry>if this boolean is true, stdout and stderr of the script will be shown in a popup that the
+ user has to confirm via ok-button. If stdout and stderr are empty, no popup is shown and so
+ no confirmation is needed.
+ <para><screen><feedback config:type="boolean">true</feedback></screen></para></entry>
+ <entry>optional. The default is false. This option was invented with SL 10.1 / SLES10</entry>
+ </row>
+ <row>
+ <entry>debug</entry>
+ <entry>if this is true, every single line of a shell script is logged. Perl scripts are run with warnings
+ turned on.
+ <para><screen><debug config:type="boolean">true</debug></screen></para></entry>
+ <entry>optional. The default is true. This option was invented with SL 10.1 / SLES10</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ </section>
+
+
+
<section id="chroot.scripts">
<title>Chroot environment scripts</title>
<para>Chroot scripts are executed before the machine reboots for the first time.
Modified: trunk/autoinstallation/doc/examples/example.scripts.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/doc/examples/example.scripts.xml?rev=56615&r1=56614&r2=56615&view=diff
==============================================================================
--- trunk/autoinstallation/doc/examples/example.scripts.xml (original)
+++ trunk/autoinstallation/doc/examples/example.scripts.xml Fri Apr 3 13:08:57 2009
@@ -68,5 +68,18 @@
</source>
</script>
</pre-scripts>
+ <postpartitioning-scripts config:type="list">
+ <script>
+ <filename>postpart.sh</filename>
+ <interpreter>shell</interpreter>
+ <debug config:type="boolean">false</debug>
+ <feedback config:type="boolean">true</feedback>
+ <source><![CDATA[
+touch /mnt/testfile
+echo Hi
+]]>
+ </source>
+ </script>
+ </postpartitioning-scripts>
</scripts>
</profile>
Modified: trunk/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyast2.changes?rev=56615&r1=56614&r2=56615&view=diff
==============================================================================
--- trunk/autoinstallation/package/autoyast2.changes (original)
+++ trunk/autoinstallation/package/autoyast2.changes Fri Apr 3 13:08:57 2009
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Fri Apr 3 13:08:47 CEST 2009 - ug@suse.de
+
+- postpartitioning script invented
+
+-------------------------------------------------------------------
Wed Apr 1 16:11:08 CEST 2009 - ug@suse.de
- storage lib compatibility with "used_by"
Modified: trunk/autoinstallation/src/clients/inst_autoimage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_autoimage.ycp?rev=56615&r1=56614&r2=56615&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/inst_autoimage.ycp (original)
+++ trunk/autoinstallation/src/clients/inst_autoimage.ycp Fri Apr 3 13:08:57 2009
@@ -16,6 +16,9 @@
import "Report";
import "AutoinstImage";
import "AutoinstSoftware";
+import "AutoinstScripts";
+
+AutoinstScripts::Write("postpartitioning-scripts", false);
if (!AutoinstSoftware::imaging)
return `auto;
Modified: trunk/autoinstallation/src/modules/AutoinstScripts.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/modules/AutoinstScripts.ycp?rev=56615&r1=56614&r2=56615&view=diff
==============================================================================
--- trunk/autoinstallation/src/modules/AutoinstScripts.ycp (original)
+++ trunk/autoinstallation/src/modules/AutoinstScripts.ycp Fri Apr 3 13:08:57 2009
@@ -33,6 +33,10 @@
/* Init scripts */
global list<map> init = [];
+ /* postpart scripts */
+ global list<map> postpart = [];
+
+
/* Merged scripts */
global list<map> merged = [];
@@ -89,6 +93,12 @@
return p;
})
);
+ result = (list<map>)union(result, maplist (map p, postpart,
+ ``{
+ p = add(p,"type","postpartitioning-scripts");
+ return p;
+ })
+ );
return result;
}
@@ -115,6 +125,7 @@
post = [];
chroot = [];
init = [];
+ postpart = [];
y2milestone("Merged %1", merged);
// split
@@ -127,6 +138,8 @@
init = add(init,s);
else if (s["type"]:"" == "chroot-scripts")
chroot = add(chroot,s);
+ else if (s["type"]:"" == "postpartitioning-scripts")
+ postpart = add(postpart,s);
});
@@ -168,6 +181,16 @@
"debug":p["debug"]:true
]);
});
+ list<map> expostpart = maplist (map p, postpart, ``{
+ return ($["filename":p["filename"]:"",
+ "interpreter": p["interpreter"]:"",
+ "source":p["source"]:"",
+ "location":p["location"]:"",
+ "feedback":p["feedback"]:false,
+ "debug":p["debug"]:true
+ ]);
+ });
+
map