| AutoYast2: Automatic Linux Installation and Configuration with YaST2 | ||
|---|---|---|
| <<< Previous | Chapter 2. The Control File | Next >>> |
The XML configuration format provides a consistent file structure, which is easier to learn and remember when attempting to configure a new system.
Using XML, you can eliminate (nearly) all of the configuration file parsing and error handling - an external XML parser can do that instead - (especially if it is a validating parser). To make sure the control file is well-formatted and that the syntax is valid, you can run the control file through a validating parser before it is actually used for automatic installation. This is especially required if you prefer to edit the profile manually.
The following example shows a control file in XML format:
Example 2-1. XML Control File (Profile)
<?xml version="1.0"?>
<![CDATA[
<!DOCTYPE control_file SYSTEM
"/usr/lib/YaST2/include/control-file.dtd">
<profile
xmlns="http://www.suse.de/1.0/cfns"
xmlns:cfg="http://www.suse.de/1.0/cfgns">
<install>
<partitioning config:type="list">
<drive>
<device>/dev/hda</device>
<partition>
<filesystem>ext2</filesystem>
<size>520Mb</size>
<mount>/</mount>
</partition>
<partition>
<filesystem>reiser</filesystem>
<size>1200Mb</size>
<mount>/data</mount>
</partition>
</drive>
</partitioning>
</install>
<configure>
<scripts>
<pre-scripts>
<script>
<interpreter>shell</interpreter>
<filename>start.sh</filename>
<source>
<![CDATA[
#!/bin/sh
echo "Starting installation"
exit 0
]]>
</source>
</script>
</pre-scripts>
</scripts>
</configure>
</profile>
|
| <<< Previous | Home | Next >>> |
| The Control File | Up | Structure |