From ug@svn.opensuse.org Fri Apr 3 11:08:53 2009 From: ug@svn.opensuse.org To: yast-commit@lists.opensuse.org Subject: [yast-commit] r56615 - in /trunk/autoinstallation: doc/CreateProfileDetails.xml doc/examples/example.scripts.xml package/autoyast2.changes src/clients/inst_autoimage.ycp src/modules/AutoinstScripts.ycp Date: Fri, 03 Apr 2009 11:08:57 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9133123078980126626==" --===============9133123078980126626== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: ug Date: Fri Apr 3 13:08:57 2009 New Revision: 56615 URL: http://svn.opensuse.org/viewcvs/yast?rev=3D56615&view=3Drev 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/CreatePr= ofileDetails.xml?rev=3D56615&r1=3D56614&r2=3D56615&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/autoinstallation/doc/CreateProfileDetails.xml (original) +++ trunk/autoinstallation/doc/CreateProfileDetails.xml Fri Apr 3 13:08:57 2= 009 @@ -2051,12 +2051,13 @@ installation. - In the auto-installation process, four types of scripts can be execute= d and they + In the auto-installation process, five types of scripts can be execute= d and they will be described here in order of "appearance" during the installatio= n. pre-scripts (very early, before anyth= ing else really happened) + postpartitioning-scripts (after parti= tioning and mounting to /mnt but before RPM installation - since openSUSE 11.= 2) chroot-scripts (after the package ins= tallation, before the first boot) post-scripts (during the first boot o= f the installed system, no services running) init-scripts (during the first boot o= f the installed system, all servies up and running) @@ -2153,6 +2154,85 @@ + +
+ Postpartitioning Scripts + + Available starting from openSUSE 11.2 only (not SLES11). + + + Executed after &yast2; did the partitioning and wrote the fstab. The empt= y system is mounted to /mnt already. + This type of script is available since openSUSE 11.2 (not SLES11). + + + The following elements must be between the <postpartitioning-= scripts config:type=3D"list"><script> ... </script></postpa= rtitioning-sripts> tags + + + + postpartitioning script XML representation + + + + Element + Description + Comment + + + + + location + you can define a location from where the script gets = fetched. + Locations can be the same like for the profile (http,= ftp,nfs,...). + <location>http://10.10.0.1/myScript.sh&l= t;/location> + either <location> or <source> must be def= ined + + + source + the script itself. The source code of the script if y= ou 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. + + <source> +<![CDATA[=20 +echo "Testing postpart script" > /mnt/postpart_test.txt +]]> +</source> + Either <location> or <source> must be def= ined + + + interpreter + the interpreter that must be used for the script. Sup= ported options are shell and perl. + <interpreter>perl</interpreter> + optional (default is shell) + + + filename + the filename of the script. It will be stored in a te= mporary directory under /tmp/... + <filename>myScript5.sh</filename><= /screen> + optional. The default is the type of the script (pre-= scripts) in this case + + + feedback + if this boolean is true, stdout and stderr of the scr= ipt will be shown in a popup that the + user has to confirm via ok-button. If stdout and stde= rr are empty, no popup is shown and so + no confirmation is needed. + <feedback config:type=3D"boolean">true&l= t;/feedback> + optional. The default is false. This option was inven= ted with SL 10.1 / SLES10 + + + debug + if this is true, every single line of a shell script = is logged. Perl scripts are run with warnings + turned on. + <debug config:type=3D"boolean">true</= debug> + optional. The default is true. This option was invent= ed with SL 10.1 / SLES10 + + + +
+
+
+ + +
Chroot environment scripts 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=3D56615&r1=3D56614&r2=3D56615&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ + + + Modified: trunk/autoinstallation/package/autoyast2.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/auto= yast2.changes?rev=3D56615&r1=3D56614&r2=3D56615&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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(a)suse.de + +- postpartitioning script invented + +------------------------------------------------------------------- Wed Apr 1 16:11:08 CEST 2009 - ug(a)suse.de =20 - 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=3D56615&r1=3D56614&r2=3D56615&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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); =20 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=3D56615&r1=3D56614&r2=3D56615&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/autoinstallation/src/modules/AutoinstScripts.ycp (original) +++ trunk/autoinstallation/src/modules/AutoinstScripts.ycp Fri Apr 3 13:08:5= 7 2009 @@ -33,6 +33,10 @@ /* Init scripts */ global list init =3D []; =20 + /* postpart scripts */ + global list postpart =3D []; + + /* Merged scripts */ global list merged =3D []; =20 @@ -89,6 +93,12 @@ return p; }) ); + result =3D (list)union(result, maplist (map p, postpart, + ``{ + p =3D add(p,"type","postpartiti= oning-scripts"); + return p; + }) + ); return result; } =20 @@ -115,6 +125,7 @@ post =3D []; chroot =3D []; init =3D []; + postpart =3D []; y2milestone("Merged %1", merged); =20 // split @@ -127,6 +138,8 @@ init =3D add(init,s); else if (s["type"]:"" =3D=3D "chroot-scripts") chroot =3D add(chroot,s); + else if (s["type"]:"" =3D=3D "postpartitioning-scripts") + postpart =3D add(postpart,s); }); =20 =20 @@ -168,6 +181,16 @@ "debug":p["debug"]:true ]); }); + list expostpart =3D 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 result =3D $[]; if (size(expre) > 0 ) result["pre-scripts"] =3D expre; @@ -177,6 +200,8 @@ result["chroot-scripts"] =3D exchroot; if (size(exinit) > 0 ) result["init-scripts"] =3D exinit; + if (size(expostpart) > 0 ) + result["postpartitioning-scripts"] =3D expostpart; =20 return result; =20 @@ -220,11 +245,13 @@ init =3D s["init-scripts"]:[]; post =3D s["post-scripts"]:[]; chroot =3D s["chroot-scripts"]:[]; + postpart =3D s["postpartitioning-scripts"]:[]; =20 pre =3D Resolve_relurl(pre); init =3D Resolve_relurl(init); post =3D Resolve_relurl(post); chroot =3D Resolve_relurl(chroot); + postpart =3D Resolve_relurl(postpart); =20 merged =3D mergeScripts(); y2debug("merged: %1", merged); @@ -290,6 +317,19 @@ { summary =3D Summary::AddLine(summary, Summary::NotConfigured()); } + summary =3D Summary::AddHeader(summary, _("Postpartitioning Scripts"= )); + if (size( init) > 0 ) + { + summary =3D Summary::OpenList(summary); + foreach(map script, postpart, ``{ + summary =3D Summary::AddListItem(summary, script["filename"]= :"" ); + }); + summary =3D Summary::CloseList(summary); + } + else + { + summary =3D Summary::AddLine(summary, Summary::NotConfigured()); + } return summary; } =20 @@ -388,6 +428,10 @@ { return _("Chroot"); } + else if (type =3D=3D "postpartitioning-scripts") + { + return _("Postpartitioning"); + } return _("Unknown"); } =20 @@ -549,6 +593,10 @@ { scripts =3D filter(map s, post, ``(s["network_needed"]:false)); } + else if (type =3D=3D "postpartitioning-scripts" ) + { + scripts =3D postpart; + } else { y2error("Unsupported script type"); @@ -559,7 +607,7 @@ string tmpdirString =3D ""; string current_logdir =3D ""; =20 - if (type =3D=3D "pre-scripts") + if (type =3D=3D "pre-scripts" || type =3D=3D "postpartitioning-scrip= ts") { tmpdirString =3D sformat("%1/%2", AutoinstConfig::tmpDir, type); SCR::Execute (.target.mkdir, tmpdirString); @@ -600,12 +648,12 @@ } string scriptPath =3D ""; =20 - if (type =3D=3D "pre-scripts") + if ( type =3D=3D "pre-scripts" || type =3D=3D "postpartitioning-= scripts" ) { // y2milestone("doing /sbin/udevcontrol stop_exec_queue now to preven= t trouble if one is doing partitioning in a pre-script"); // SCR::Execute( .target.bash, "/sbin/udevcontrol stop_exec_queue" ); scriptPath =3D sformat("%1/%2/%3", AutoinstConfig::tmpDir, t= ype, scriptName); - y2milestone("Writing pre script into %1", scriptPath); + y2milestone("Writing %1 script into %2", type, scriptPath); if (s["location"]:"" !=3D "") { y2debug("getting script: %1", s["location"]:"" ); --=20 To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org For additional commands, e-mail: yast-commit+help(a)opensuse.org --===============9133123078980126626==--