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.