Hi Michael,
The way, you proposed to do is wery well known, but it doesn't work in
my case (As I wrote below - I can't use rules :)
Biggest problem is what rules processing fixed only to
"rules/rules.xml" file, it doesn't work for autoYast control file. It
would be nice to use rules/classes constructs, but...
I can't use anything but autoyast control file - no any directory for
rules/rules.xml, etc.
AutoYast control file in my case is generated automatically by CGI
script (Depending on information in database for specific host), and
it need to be changed a little depending on specific part of hardware
configuration.
Best way is to do it like in RedHat - where pre-script can generate
some files for future use by installation process (Partition table,
for example)..
Is there something like this?
How can I use XML XInclude to include file, generated by "pre" scripts?
It was mentioned in FAQ for SLES8, but not working for SLES9...
It's really bad if SuSE installer missing such great functionality...
Regards,
Alexander
2005/6/20, Michael Marion
On 20 Jun, Alexander Dubinin wrote:
Idea is to generate swap partition size automatically, using script. Does I have possibility to start some script _before_ autoyast config file is processed?
The pre scripts are run after the xml file has already been assembled AFAIK.
Preferable is a way, similar to used in RedHat KickStart - run pre-configuration script, generate partition layout and pass this layout to AutoYast like "include" in KickStart.
You can already do this using rules and classes instead of specific xml files. See http://yast.suse.com/autoinstall/9.1/html/rulesandclass.html
example of what I'm doing...
<rule> <disksize> <match>/dev/hda 10000</match>
greater </disksize> <disksize> <match>/dev/hdb 10000</match>greater </disksize> <result> <profile>dideab.xml</profile> <continue config:type="boolean">false</continue> </result> </rule>That rule matches dual IDE disks, installed as hda and hdb (I have a similar rule for hda and hdc). Then the dideab.xml (or dideac.xml if hda and hdc) file is just the partitioning bit.
A custom example is...
<rule> <custom1> <script> <![CDATA[ #!/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin if [ -n "`grep site= /proc/cmdline`" ] then echo -n `cat /proc/cmdline | sed -e 's/.*site=//g' -e 's/ .*//g'` else echo -n sandiego fi ]]> </script> <match>*</match>
exact </custom1> <result> <profile>@custom1@.xml</profile> <continue config:type="boolean">true</continue> </result> </rule>This allows us to pass a site (for remote offices) on the boot line and load the file <site>.xml. In that file, we have the pre/chroot/post install scripts for looking at the local site's NFS installation path. Then we have a generic file that lists all the packages to install, which is the same for everyone..
It's a little confusing at first, but once you get how the rules/classes work, it's pretty slick.
-- Mike Marion-Unix SysAdmin/Staff Engineer-http://www.qualcomm.com Jimmy: "The job market is very competitive right now for someone with my skills! ...There are a whole lot of kids on summer vacation." -- The PJs.
-- Regards, Alexander Dubinin