[opensuse-autoinstall] general rules question
I have a working autoyast install for 11.1 without using rules. Right now I would like to introduce rules but I do not seem to understand exactly how to make this work. The current install is done by supplying information for a linuxrc info file on the kernel command line info=nfs://<ip-address>/<path>/1055_init.linuxrc The info file has several parameters defined for network access, the install and the autoyast variable autoyast: nfs://<ip-address>/<path>/1055_init.autoyast <- this is my autoinst profile below the path I have created the rules directory which includes a rules .xml file with following content <?xml version="1.0"?> <!DOCTYPE autoinstall SYSTEM "/usr/share/autoinstall/dtd/rules.dtd"> <!-- comments --> <autoinstall xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> <rules config:type="list"> <rule> <custom1> <script> # CPU_TYPE on vm's is giving same result for CPU as on real hardware we have to extend to video to understand the difference between virtual and real CPU_TYPE=`cat /proc/cpuinfo|grep 'model name'|uniq|awk 'BEGIN {FS=":"};{print $2}'` VIDEO_TYPE=`/sbin/lspci | grep "VGA compatible controller"|awk 'BEGIN {FS=":"};{print $3}'` if [ "$CPU_TYPE" == " AMD Athlon(tm) 64 X2 Dual Core Processor 4400+" ]; then if [ "$VIDEO_TYPE" == " nVidia Corporation G70 [GeForce 7300 GT] (rev a1)" ]; then echo -n "host1.xml" elif [ "$VIDEO_TYPE" == " InnoTek Systemberatung GmbH VirtualBox Graphics Adapter" ]; then echo -n "host1-virtualbox.xml" fi # information for scan64-3200 elif [ "$CPU_TYPE" == " AMD Athlon(tm) 64 Processor 3200+" ]; then if [ "$VIDEO_TYPE" == " nVidia Corporation G70 [GeForce 7300 GT] (rev a1)" ]; then echo -n "host2.xml" elif [ "$VIDEO_TYPE" == " InnoTek Systemberatung GmbH VirtualBox Graphics Adapter" ]; then echo -n "host2-virtualbox.xml" fi fi </script> <match>*</match> <match_type>exact</match_type> </custom1> <result> <profile>@custom1@</profile> <continue config:type="boolean">true</continue> </result> </rule> <rule> <custom> <script> </script> <match>*</match> <match_type>exact</match_type> </custom> <result> <profile>1055_init.autoyast</profile> <continue config:type="boolean">false</continue> </result> </rule> </rules> </autoinstall> I have tried to change the autoyast parameter in the info file with the following values autoyast: nfs://<ip-address>/<path>/ <-- question about profile location autoyast: nfs://<ip-address>/<path>/rules/ <-- question about profile location autoyast: nfs://<ip-address>/<path>/rules/rules.xml Above direct reference to rules file seems to work but not as expected. When I check the box I can see that in /tmp/profile/autoinst.xml I find a copy of my rules.xml file where I'm expecting a merged profile from my 1055_init.autoyast and host2.xml information I'm not sure exactly what I'm doing wrong and even after extensive check via google haven't found the right references. I've used http://forgeftp.novell.com/yast/doc/SL11.1/autoinstall/ for documentation but it is not giving me enough detail to solve above issue. Any input would be welcomed. -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
On Sat, Oct 17, 2009 at 09:50:13AM -0700, dutchguy69 wrote:
if [ "$CPU_TYPE" == " AMD Athlon(tm) 64 X2 Dual Core Processor 4400+" ];
I'd recommend using simple grep checks for some basics vs a complete == check as you're going to have to update every time you have any change in hw. Unless you're cool with that of course. :)
<rule> <custom> <script> </script> <match>*</match> <match_type>exact</match_type> </custom> <result> <profile>1055_init.autoyast</profile> <continue config:type="boolean">false</continue> </result> </rule>
Not sure that works. We have a default file we include and do it via: <rule> <memsize> <match>1</match> <match_type>greater</match_type> </memsize> <result> <profile>scripts.xml</profile> <continue config:type="boolean">true</continue> </result> </rule> This means any box with at least 1 meg (byte?) of ram.. so all. This is something I've using since sles9 though, and I don't think I ever tried what you did above.
autoyast: nfs://<ip-address>/<path>/ <-- question about profile location
That looks right. Assuming your referenced files the rules.xml outputs are in there, and rules/rules.xml is relative to there.
Above direct reference to rules file seems to work but not as expected. When I check the box I can see that in /tmp/profile/autoinst.xml I find a copy of my rules.xml file where I'm expecting a merged profile from my 1055_init.autoyast and host2.xml information
Check the /var/log/Yast/y2log file(s). They'll be VERY verbose showing the results of the rules steps, which file(s) it tries to copy and when. For example, it specifcially shows it copying the scripts.xml I ref above: 2009-10-15 00:09:04 <1> 10.46.16.84(3129) [YCP] autoinstall/io.ycp:180 Copy Command: /bin/cp /tmp/YaST2-03129-h399Sr/tmp_mount/scripts.xml /tmp/YaST2-03129-D4d8Xe/rules/scripts.xml Note that if using NFS or other network locations, it'll do everything relative from the path that autoyast: part points to, so you can't symlink from there to another path, unless it's below that one. I had that bite me in the past. Well, maybe with http it works, but with NFS it'll mount to the full path pointed to by autoyast: so it can't do a link like ../scripts/foo.xml in there. -- Mike Marion-Unix SysAdmin/Staff IT Engineer-http://www.qualcomm.com Homer: "Bless you boys." [He's saluting the men marching by in the parade] Marge: "Homer, those are ice cream men." [Homer tears up] Homer: "I know." ==>Simpsons -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
By using the y2log file I found that the rules were being processed but it seemed that when it was complaining it couldn't find any profile it was actually complaining about the fact that there was no active rule available. After changing the <match>*</match> to the memory size check it worked. Will need to work some more on this to understand how this is exactly working since the <match>*</match> was from an example I found on the net. dutchguy69 wrote:
I have a working autoyast install for 11.1 without using rules. Right now I would like to introduce rules but I do not seem to understand exactly how to make this work.
The current install is done by supplying information for a linuxrc info file on the kernel command line
info=nfs://<ip-address>/<path>/1055_init.linuxrc
The info file has several parameters defined for network access, the install and the autoyast variable
autoyast: nfs://<ip-address>/<path>/1055_init.autoyast <- this is my autoinst profile
below the path I have created the rules directory which includes a rules .xml file with following content
<?xml version="1.0"?> <!DOCTYPE autoinstall SYSTEM "/usr/share/autoinstall/dtd/rules.dtd"> <!-- comments -->
<autoinstall xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> <rules config:type="list"> <rule> <custom1> <script> # CPU_TYPE on vm's is giving same result for CPU as on real hardware we have to extend to video to understand the difference between virtual and real CPU_TYPE=`cat /proc/cpuinfo|grep 'model name'|uniq|awk 'BEGIN {FS=":"};{print $2}'` VIDEO_TYPE=`/sbin/lspci | grep "VGA compatible controller"|awk 'BEGIN {FS=":"};{print $3}'`
if [ "$CPU_TYPE" == " AMD Athlon(tm) 64 X2 Dual Core Processor 4400+" ]; then if [ "$VIDEO_TYPE" == " nVidia Corporation G70 [GeForce 7300 GT] (rev a1)" ]; then echo -n "host1.xml" elif [ "$VIDEO_TYPE" == " InnoTek Systemberatung GmbH VirtualBox Graphics Adapter" ]; then echo -n "host1-virtualbox.xml" fi elif [ "$CPU_TYPE" == " AMD Athlon(tm) 64 Processor 3200+" ]; then if [ "$VIDEO_TYPE" == " nVidia Corporation G70 [GeForce 7300 GT] (rev a1)" ]; then echo -n "host2.xml" elif [ "$VIDEO_TYPE" == " InnoTek Systemberatung GmbH VirtualBox Graphics Adapter" ]; then echo -n "host2-virtualbox.xml" fi fi </script> <match>*</match> <match_type>exact</match_type> </custom1> <result> <profile>@custom1@</profile> <continue config:type="boolean">true</continue> </result> </rule> <rule> <custom> <script> </script> <match>*</match> <match_type>exact</match_type> </custom> <result> <profile>1055_init.autoyast</profile> <continue config:type="boolean">false</continue> </result> </rule> </rules> </autoinstall>
I have tried to change the autoyast parameter in the info file with the following values
autoyast: nfs://<ip-address>/<path>/ <-- question about profile location
autoyast: nfs://<ip-address>/<path>/rules/ <-- question about profile location
autoyast: nfs://<ip-address>/<path>/rules/rules.xml
Above direct reference to rules file seems to work but not as expected. When I check the box I can see that in /tmp/profile/autoinst.xml I find a copy of my rules.xml file where I'm expecting a merged profile from my 1055_init.autoyast and host2.xml information
I'm not sure exactly what I'm doing wrong and even after extensive check via google haven't found the right references. I've used http://forgeftp.novell.com/yast/doc/SL11.1/autoinstall/ for documentation but it is not giving me enough detail to solve above issue.
Any input would be welcomed.
-- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
On Mon, Oct 19, 2009 at 10:26:37AM -0700, dutchguy69 wrote:
available. After changing the <match>*</match> to the memory size check it worked. Will need to work some more on this to understand how this is exactly working since the <match>*</match> was from an example I found on the net.
Is that exactly how it was in the example you found? With the empty <script></script> part? I'd think that's what confused it. Maybe just having that part be as simple as: <script> echo true </script> Would at least give it something for the <match>*</match> part to actually match against. -- Mike Marion-Unix SysAdmin/Staff IT Engineer-http://www.qualcomm.com UNIX - live it,love it,fork() it ! -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
My working rules file which include 1 customer rule which worked fine for 11.1 does not seem to be working for 11.3 anymore. Within the 11.1 y2log-1 I can see the following lines 2010-07-25 17:26:51 <1> 162.61.5.251(3863) [YCP] AutoInstallRules.ycp:485 Writing rule script into /tmp/YaST2-03863-bYu6zP/rule_custom1 2010-07-25 17:26:51 <1> 162.61.5.251(3863) [YCP] AutoInstallRules.ycp:390 Bash return: if ( [ "1" = "1" ] ) ; then exit 0; else exit 1; fi ($["exit":0, "stderr":"", "stdout":""]) ($["custom1":"rules/1060_scan64-3200.xml"]) 2010-07-25 17:26:51 <1> 162.61.5.251(3863) [YCP] AutoInstallRules.ycp:397 file: @custom1@ 2010-07-25 17:26:51 <1> 162.61.5.251(3863) [YCP] AutoInstallRules.ycp:410 var: custom1 2010-07-25 17:26:51 <1> 162.61.5.251(3863) [YCP] AutoInstallRules.ycp:576 Final Profile name: rules/1060_scan64-3200.xml 2010-07-25 17:26:51 <1> 162.61.5.251(3863) [YCP] AutoInstallRules.ycp:390 Bash return: if ( [ "$memsize" -gt "1" ] ) ; then exit 0; else exit 1; fi ($["exit":0, "stderr":"", "stdout":""]) ($["custom1":"rules/1060_scan64-3200.xml", "memsize":2048]) 2010-07-25 17:26:51 <1> 162.61.5.251(3863) [YCP] AutoInstallRules.ycp:397 file: 1060_init.autoyast 2010-07-25 17:26:51 <1> 162.61.5.251(3863) [YCP] AutoInstallRules.ycp:410 var: 2010-07-25 17:26:51 <1> 162.61.5.251(3863) [YCP] AutoInstallRules.ycp:418 val: 1060_init.autoyast 2010-07-25 17:26:51 <1> 162.61.5.251(3863) [YCP] AutoInstallRules.ycp:576 Final Profile name: 1060_init.autoyast Within the 11.3 y2log-1 I can see the following lines 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:486 Writing rule script into /tmp/YaST2-03387-LfMSYn/rule_custom1 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:398 file: @custom1@ 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:411 var: custom1 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:419 val: @custom1@ 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:391 Bash return: if ( [ "1" = "1" ] ) ; then exit 0; else exit 1; fi ($["exit":0, "stderr":"", "stdout":""]) ($["custom1":""]) 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:579 Final Profile name: @custom1@ 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:398 file: 1061_init.autoyast 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:411 var: 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:419 val: 1061_init.autoyast 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:391 Bash return: if ( [ "$memsize" -gt "1" ] ) ; then exit 0; else exit 1; fi ($["exit":0, "stderr":"", "stdout":""]) ($["custom1":"", "memsize":2048]) 2010-07-25 18:51:28 <1> 162.61.5.251(3387) [YCP] AutoInstallRules.ycp:579 Final Profile name: 1061_init.autoyast Not sure whether the different sequencing is part of the issue or not. Clearly "Final Profile name: rules/1060_scan64-3200.xml" is not the same as "Final Profile name: @custom1@". Is this some different functionality in 11.3 or a bug or something I have overlooked maybe Any help is appreciated. -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Monday 26 July 2010 dutchguy69 wrote:
My working rules file which include 1 customer rule which worked fine for 11.1 does not seem to be working for 11.3 anymore.
can I see your rules.xml? -- ciao, Uwe Gansert Uwe Gansert SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Business: http://www.suse.de/~ug listening to: "I Love 64" by mind.in.a.box -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
participants (3)
-
dutchguy69
-
Mike Marion
-
Uwe Gansert